modules/home/unfree: init
This commit is contained in:
parent
b9c7bda91c
commit
bfddcef2fd
4 changed files with 35 additions and 2 deletions
|
@ -1,4 +1,15 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# TODO: Maybe eventually support multi-user
|
||||
userAllowedPackages =
|
||||
lib.optionals config.settei.user.enable
|
||||
config.home-manager.users.${username}.settei.unfree.allowedPackages;
|
||||
in
|
||||
{
|
||||
_file = ./unfree.nix;
|
||||
|
||||
|
@ -8,12 +19,13 @@
|
|||
with lib;
|
||||
mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
nixpkgs.config.allowUnfreePredicate = lib.mkForce (
|
||||
pkg: builtins.elem (lib.getName pkg) config.settei.unfree.allowedPackages
|
||||
pkg: builtins.elem (lib.getName pkg) (config.settei.unfree.allowedPackages ++ userAllowedPackages)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue