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

View file

@ -1,9 +1,15 @@
final: prev: let final: prev: let
inherit (final) hasSuffix; inherit (final) hasSuffix;
runes = import ../modules/runes; runes = import ../modules/runes;
in { in rec {
enabled = {enable = true;}; enabled = {enable = true;};
disabled = {enable = false;}; 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; isNixFile = path: hasSuffix ".nix" path;
mkIfIn = name: list: prev.mkIf (builtins.elem name list); mkIfIn = name: list: prev.mkIf (builtins.elem name list);
mkRune = { mkRune = {