refactor: add home 'allowedUnfree' option
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
_:
|
||||
|
||||
{
|
||||
nixpkgs.allowedUnfree = [
|
||||
"spotify"
|
||||
"spotify-unwrapped"
|
||||
];
|
||||
|
||||
security.rtkit.enable = true;
|
||||
services = {
|
||||
pulseaudio.enable = false;
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
let
|
||||
flakePath = "/home/h/nix";
|
||||
in
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
dotsPath,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
options.nixpkgs.allowedUnfree = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
config = {
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
@@ -20,7 +27,8 @@ in
|
||||
"flakes"
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.allowUnfreePredicate =
|
||||
pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowedUnfree;
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
@@ -44,7 +52,6 @@ in
|
||||
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
flake = flakePath;
|
||||
flags = [
|
||||
"--recreate-lock-file"
|
||||
"--commit-lock-file"
|
||||
@@ -55,4 +62,5 @@ in
|
||||
randomizedDelaySec = "45min";
|
||||
allowReboot = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user