modules/home/unfree: init

This commit is contained in:
Nikodem Rabuliński 2025-01-05 01:01:56 +01:00
parent b9c7bda91c
commit bfddcef2fd
4 changed files with 35 additions and 2 deletions

View file

@ -1,4 +1,15 @@
{ config, lib, ... }:
{
config,
lib,
username,
...
}:
let
# TODO: Maybe eventually support multi-user
userAllowedPackages =
lib.optionals config.settei.user.enable
config.home-manager.users.${username}.settei.unfree.allowedPackages;
in
{
_file = ./unfree.nix;
@ -8,12 +19,13 @@
with lib;
mkOption {
type = types.listOf types.str;
default = [ ];
};
};
config = {
nixpkgs.config.allowUnfreePredicate = lib.mkForce (
pkg: builtins.elem (lib.getName pkg) config.settei.unfree.allowedPackages
pkg: builtins.elem (lib.getName pkg) (config.settei.unfree.allowedPackages ++ userAllowedPackages)
);
};
}