Don't allow just any unfree software

This commit is contained in:
Charlotte Van Petegem 2021-01-07 18:41:42 +01:00
parent 8d10382c46
commit 8aa29e173c
No known key found for this signature in database
GPG key ID: 019E764B7184435A
2 changed files with 10 additions and 12 deletions

View file

@ -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;
};
}

View file

@ -1 +0,0 @@
{ allowUnfree = true; }