diff --git a/SwarselSystems.org b/SwarselSystems.org index 8b1274e..e3d8791 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -1533,25 +1533,31 @@ This is the central station for self-defined packages. These are all referenced #+begin_src nix :tangle pkgs/default.nix { pkgs, ... }: let - inherit (pkgs) callPackage; - in - { - pass-fuzzel = callPackage ./pass-fuzzel { }; - cura5 = callPackage ./cura5 { }; - hm-specialisation = callPackage ./hm-specialisation { }; - cdw = callPackage ./cdw { }; - cdb = callPackage ./cdb { }; - bak = callPackage ./bak { }; - timer = callPackage ./timer { }; - e = callPackage ./e { }; - swarselcheck = callPackage ./swarselcheck { }; - waybarupdate = callPackage ./waybarupdate { }; - opacitytoggle = callPackage ./opacitytoggle { }; - fs-diff = callPackage ./fs-diff { }; - update-checker = callPackage ./update-checker { }; - github-notifications = callPackage ./github-notifications { }; - screenshare = callPackage ./screenshare { }; - } + packageNames = [ + "pass-fuzzel" + "cura5" + "hm-specialisation" + "cdw" + "cdb" + "bak" + "timer" + "e" + "swarselcheck" + "waybarupdate" + "opacitytoggle" + "fs-diff" + "update-checker" + "github-notifications" + "screenshare" + "bootstrap" + ]; + mkPackages = names: builtins.listToAttrs (map (name: { + inherit name; + value = pkgs.callPackage ./${name} { }; + }) names); + in + mkPackages packageNames + #+end_src @@ -2349,14 +2355,24 @@ In this section I define custom modules under the =swarsel= attribute. These are Modules that need to be loaded on the NixOS level. Note that these will not be available on systems that are not running NixOS #+begin_src nix :tangle modules/nixos/default.nix - { - 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 + #+end_src @@ -2493,18 +2509,27 @@ This lets me quickly set flags for "special" file systems. These options mostly This holds modules that are to be used on most hosts. These are also the most important options to configure, as these allow me easy access to monitor, keyboard, and other setups. #+BEGIN_src nix :tangle modules/home/default.nix - { - 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 #+end_src ***** Laptop diff --git a/modules/home/default.nix b/modules/home/default.nix index b653515..6fbac0b 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -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 diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index cf79e66..f2afbb4 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -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 diff --git a/pkgs/default.nix b/pkgs/default.nix index 14fba08..c680b45 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,21 +1,28 @@ { pkgs, ... }: let - inherit (pkgs) callPackage; + packageNames = [ + "pass-fuzzel" + "cura5" + "hm-specialisation" + "cdw" + "cdb" + "bak" + "timer" + "e" + "swarselcheck" + "waybarupdate" + "opacitytoggle" + "fs-diff" + "update-checker" + "github-notifications" + "screenshare" + "bootstrap" + ]; + mkPackages = names: builtins.listToAttrs (map + (name: { + inherit name; + value = pkgs.callPackage ./${name} { }; + }) + names); in -{ - pass-fuzzel = callPackage ./pass-fuzzel { }; - cura5 = callPackage ./cura5 { }; - hm-specialisation = callPackage ./hm-specialisation { }; - cdw = callPackage ./cdw { }; - cdb = callPackage ./cdb { }; - bak = callPackage ./bak { }; - timer = callPackage ./timer { }; - e = callPackage ./e { }; - swarselcheck = callPackage ./swarselcheck { }; - waybarupdate = callPackage ./waybarupdate { }; - opacitytoggle = callPackage ./opacitytoggle { }; - fs-diff = callPackage ./fs-diff { }; - update-checker = callPackage ./update-checker { }; - github-notifications = callPackage ./github-notifications { }; - screenshare = callPackage ./screenshare { }; -} +mkPackages packageNames