modules/home/unfree: init
This commit is contained in:
parent
b9c7bda91c
commit
bfddcef2fd
4 changed files with 35 additions and 2 deletions
|
@ -21,6 +21,7 @@ in
|
||||||
./desktop
|
./desktop
|
||||||
fishOverlayModule
|
fishOverlayModule
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
|
./unfree.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
fontconfig
|
fontconfig
|
||||||
signal-desktop
|
signal-desktop
|
||||||
];
|
];
|
||||||
|
settei.unfree.allowedPackages = [ "signal-desktop" ];
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
|
19
modules/home/unfree.nix
Normal file
19
modules/home/unfree.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Copy of modules/system/unfree.nix
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
_file = ./unfree.nix;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
settei.unfree.allowedPackages =
|
||||||
|
with lib;
|
||||||
|
mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
nixpkgs.config.allowUnfreePredicate = lib.mkForce (
|
||||||
|
pkg: builtins.elem (lib.getName pkg) config.settei.unfree.allowedPackages
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
|
@ -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;
|
_file = ./unfree.nix;
|
||||||
|
|
||||||
|
@ -8,12 +19,13 @@
|
||||||
with lib;
|
with lib;
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
nixpkgs.config.allowUnfreePredicate = lib.mkForce (
|
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