feat: nixpkgsUnfree module for listing unfree packages

This commit is contained in:
Guz
2026-05-14 19:46:24 -03:00
parent 941aebe60d
commit fbca2e954d
4 changed files with 63 additions and 39 deletions

View File

@@ -72,6 +72,22 @@
"x86_64-darwin"
"aarch64-darwin"
];
nixpkgsUnfree = {
config,
lib,
...
}:
with lib; let
list = config.nix.allowUnfreeList;
in {
options.nix.allowUnfreeList = mkOption {
type = with types; listOf str;
default = [];
};
config.nixpkgs.config.allowUnfreePredicate = p:
builtins.elem (getName p) list;
};
commonModules = [nixpkgsUnfree];
forAllSystems = f:
nixpkgs.lib.genAttrs systems (system: let
pkgs = import nixpkgs {inherit system;};
@@ -98,12 +114,14 @@
};
inherit inputs self;
};
modules = [
./hosts/dreadnought/configuration.nix
./home/terminal/configuration.nix
inputs.stylix.nixosModules.stylix
./style.nix
];
modules =
[
./hosts/dreadnought/configuration.nix
./home/terminal/configuration.nix
inputs.stylix.nixosModules.stylix
./style.nix
]
++ commonModules;
};
"battleship" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
@@ -115,10 +133,12 @@
};
inherit inputs self;
};
modules = [
./hosts/battleship/configuration.nix
./home/worm/configuration.nix
];
modules =
[
./hosts/battleship/configuration.nix
./home/worm/configuration.nix
]
++ commonModules;
};
"fighter" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
@@ -130,12 +150,14 @@
};
inherit inputs self;
};
modules = [
./hosts/fighter/configuration.nix
./home/terminal/configuration.nix
inputs.stylix.nixosModules.stylix
./style.nix
];
modules =
[
./hosts/fighter/configuration.nix
./home/terminal/configuration.nix
inputs.stylix.nixosModules.stylix
./style.nix
]
++ commonModules;
};
"rusty" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
@@ -147,12 +169,14 @@
};
inherit inputs self;
};
modules = [
./hosts/lost-home/configuration.nix
./home/terminal/configuration.nix
inputs.stylix.nixosModules.stylix
./style.nix
];
modules =
[
./hosts/lost-home/configuration.nix
./home/terminal/configuration.nix
inputs.stylix.nixosModules.stylix
./style.nix
]
++ commonModules;
};
"infiltrator" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
@@ -164,9 +188,11 @@
};
inherit inputs self;
};
modules = [
./hosts/infriltrator/configuration.nix
];
modules =
[
./hosts/infriltrator/configuration.nix
]
++ commonModules;
};
};

View File

@@ -62,15 +62,17 @@
# Drawing Tablet
hardware.opentabletdriver.enable = true;
# Nixpkgs
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"obsidian"
"steam"
"steam-unwrapped"
"via"
"vivaldi"
];
# Nixpkgs
nix.allowUnfreeList = [
# "davinci-resolve"
"obsidian"
"steam"
"steam-unwrapped"
"via"
"vivaldi"
];
environment.sessionVariables.NIXOS_OZONE_WL = "1";
}

View File

@@ -29,6 +29,5 @@
users.groups."guz" = {};
# Nixpkgs
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) ["via"];
nix.allowUnfreeList = ["via"];
}

View File

@@ -79,10 +79,7 @@
# Nix
nix.settings.experimental-features = ["nix-command" "flakes"];
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"via"
];
nix.allowUnfreeList = ["via"];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions