refactor: package and module generation

This commit is contained in:
Swarsel 2024-12-10 22:51:13 +01:00
parent 3a272b1fe6
commit 2cf03a3243
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
4 changed files with 131 additions and 77 deletions

View file

@ -1,12 +1,23 @@
{
laptop = import ./laptop.nix;
hardware = import ./hardware.nix;
monitors = import ./monitors.nix;
input = import ./input.nix;
nixos = import ./nixos.nix;
darwin = import ./darwin.nix;
waybar = import ./waybar.nix;
startup = import ./startup.nix;
wallpaper = import ./wallpaper.nix;
filesystem = import ./filesystem.nix;
}
let
moduleNames = [
"laptop"
"hardware"
"monitors"
"input"
"nixos"
"darwin"
"waybar"
"startup"
"wallpaper"
"filesystem"
];
mkImports = names: builtins.listToAttrs (map
(name: {
inherit name;
value = import ./${name}.nix;
})
names);
in
mkImports moduleNames

View file

@ -1,8 +1,19 @@
{
wallpaper = import ./wallpaper.nix;
hardware = import ./hardware.nix;
setup = import ./setup.nix;
impermanence = import ./impermanence.nix;
filesystem = import ./filesystem.nix;
input = import ./input.nix;
}
let
moduleNames = [
"wallpaper"
"hardware"
"setup"
"impermanence"
"filesystem"
"input"
];
mkImports = names: builtins.listToAttrs (map
(name: {
inherit name;
value = import ./${name}.nix;
})
names);
in
mkImports moduleNames