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;
services = {
pulseaudio.enable = false;

View File

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