refactor: add home 'allowedUnfree' option

This commit is contained in:
2026-02-22 14:08:19 +01:00
parent dec73a74d8
commit 635583669f
2 changed files with 53 additions and 42 deletions

View File

@@ -1,6 +1,9 @@
_:
{ {
nixpkgs.allowedUnfree = [
"spotify"
"spotify-unwrapped"
];
security.rtkit.enable = true; security.rtkit.enable = true;
services = { services = {
pulseaudio.enable = false; pulseaudio.enable = false;

View File

@@ -1,18 +1,25 @@
let
flakePath = "/home/h/nix";
in
{ {
inputs, inputs,
outputs, outputs,
dotsPath, dotsPath,
config,
... ...
}: }:
let
inherit (inputs.nixpkgs) lib;
in
{ {
imports = [ imports = [
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
]; ];
options.nixpkgs.allowedUnfree = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
config = {
system.stateVersion = "25.05"; system.stateVersion = "25.05";
nix.settings.experimental-features = [ nix.settings.experimental-features = [
@@ -20,7 +27,8 @@ in
"flakes" "flakes"
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfreePredicate =
pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowedUnfree;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
@@ -44,7 +52,6 @@ in
system.autoUpgrade = { system.autoUpgrade = {
enable = true; enable = true;
flake = flakePath;
flags = [ flags = [
"--recreate-lock-file" "--recreate-lock-file"
"--commit-lock-file" "--commit-lock-file"
@@ -55,4 +62,5 @@ in
randomizedDelaySec = "45min"; randomizedDelaySec = "45min";
allowReboot = false; allowReboot = false;
}; };
};
} }