From 8aa29e173c79e8621590c179054aed9c08228f96 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Thu, 7 Jan 2021 18:41:42 +0100 Subject: [PATCH] Don't allow just any unfree software --- modules/nix.nix | 21 ++++++++++----------- modules/nix/unfree.nix | 1 - 2 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 modules/nix/unfree.nix diff --git a/modules/nix.nix b/modules/nix.nix index 2fca9147..8b0d5ab2 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -7,9 +7,6 @@ let enableNixDirenvIntegration = true; }; }; - baseUnfree = { - xdg.configFile."nixpkgs/config.nix".source = ./nix/unfree.nix; - }; baseNixIndex = { home.packages = with pkgs; [ nix-index ]; programs.zsh.initExtra = '' @@ -87,7 +84,14 @@ in ''); }; - nixpkgs.config = lib.mkIf config.chvp.nix.enableUnfree (import ./nix/unfree.nix); + nixpkgs.config = lib.mkIf config.chvp.nix.enableUnfree { + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "citrix-workspace" + "dropbox" + "teams" + "google-chrome" + ]; + }; nixpkgs.overlays = lib.mkIf config.chvp.nix.enableFlakes [ (self: super: { nix = super.nixUnstable; @@ -97,12 +101,7 @@ in home-manager.users.charlotte = { ... }: lib.recursiveUpdate (lib.optionalAttrs config.chvp.nix.enableDirenv baseDirenv) - (lib.recursiveUpdate - (lib.optionalAttrs config.chvp.nix.enableUnfree baseUnfree) - (lib.optionalAttrs config.chvp.nix.enableNixIndex baseNixIndex)); - home-manager.users.root = { ... }: - lib.recursiveUpdate - (lib.optionalAttrs config.chvp.nix.enableDirenv baseDirenv) - (lib.optionalAttrs config.chvp.nix.enableUnfree baseUnfree); + (lib.optionalAttrs config.chvp.nix.enableNixIndex baseNixIndex); + home-manager.users.root = { ... }: lib.optionalAttrs config.chvp.nix.enableDirenv baseDirenv; }; } diff --git a/modules/nix/unfree.nix b/modules/nix/unfree.nix deleted file mode 100644 index 69baf106..00000000 --- a/modules/nix/unfree.nix +++ /dev/null @@ -1 +0,0 @@ -{ allowUnfree = true; }