modular unfree whitelist

This commit is contained in:
Victor Ișan 2026-01-27 21:18:01 +01:00
parent 72a18f3661
commit d496f8a7de
3 changed files with 30 additions and 14 deletions

View File

@ -1,18 +1,33 @@
{ config, pkgs, mainDisk, ... }: { config, pkgs, mainDisk, lib, ... }:
let
cfg = config.my.allowUnfree;
in
{ {
nix.settings = { options = {
experimental-features = [ "nix-command" "flakes" ]; my.allowUnfree.names = lib.mkOption {
auto-optimise-store = true; type = lib.types.listOf lib.types.str;
default = [];
description = "Package names allowed by allowUnfreePredicate";
};
}; };
config = {
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
programs.zsh.enable = true; programs.zsh.enable = true;
environment.systemPackages = with pkgs; [
git
curl
htop
tmux
neovim
];
environment.systemPackages = with pkgs; [ nixpkgs.config.allowUnfreePredicate =
git pkg: builtins.elem (lib.getName pkg) cfg.names;
curl };
htop
tmux
neovim
];
} }

View File

@ -1,7 +1,7 @@
{ config, pkgs, myUser, release, lib, ... }: { config, pkgs, myUser, release, lib, ... }:
{ {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ my.allowUnfree.names = lib.mkAfter [
"steam" "steam"
"steam-unwrapped" "steam-unwrapped"
]; ];

View File

@ -12,8 +12,9 @@
# Nvidia # Nvidia
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ my.allowUnfree.names = lib.mkAfter [
"nvidia-x11" "nvidia-x11"
"nvidia-settings"
]; ];
hardware.graphics.enable = true; hardware.graphics.enable = true;
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];