make unnesscary function

This commit is contained in:
Daylin Morgan 2024-03-19 08:54:11 -05:00
parent 71cab562fc
commit 4287d698b9
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 24 additions and 9 deletions

View file

@ -4,7 +4,8 @@
lib,
...
}: let
inherit (lib) enabled;
inherit (lib) enabled enableAttrs;
in {
imports = with self.nixosModules; [
restic
@ -18,13 +19,21 @@ in {
"tex"
"node"
];
nix-ld = enabled;
docker = enabled;
vbox = enabled;
desktop = enabled;
vpn = enabled;
chrome = enabled;
};
} // enableAttrs [
"chrome"
"desktop"
"docker"
"nix-ld"
"vbox"
"vpn"
];
# nix-ld = enabled;
# docker = enabled;
# vbox = enabled;
# desktop = enabled;
# vpn = enabled;
# chrome = enabled;
# };
environment.systemPackages = with pkgs; [
zk

View file

@ -1,9 +1,15 @@
final: prev: let
inherit (final) hasSuffix;
runes = import ../modules/runes;
in {
in rec {
enabled = {enable = true;};
disabled = {enable = false;};
# ["a" "b"] -> {a.enable = true; b.enable = true;}
enableAttrs = attrs: builtins.listToAttrs (map (attr: {name = attr; value = enabled; }) attrs);
# ["a" "b"] -> {a.enable = false; b.enable = false;}
disableAttrs = attrs: builtins.listToAttrs (map (attr: {name = attr; value = disabled; }) attrs);
isNixFile = path: hasSuffix ".nix" path;
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
mkRune = {