summaryrefslogtreecommitdiff
path: root/hosts/default.nix
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-05-09 17:54:45 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-05-09 17:54:45 -0500
commit4ea08b3976188eb01a74548d68b227a7794b4caa (patch)
tree505c0df98ed00ed592be15895b8ed3eb7aa9e2c3 /hosts/default.nix
downloadnixos-config-4ea08b3976188eb01a74548d68b227a7794b4caa.tar.gz
nixos-config-4ea08b3976188eb01a74548d68b227a7794b4caa.zip
Add current configuration
Diffstat (limited to 'hosts/default.nix')
-rw-r--r--hosts/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/hosts/default.nix b/hosts/default.nix
new file mode 100644
index 0000000..deba17c
--- /dev/null
+++ b/hosts/default.nix
@@ -0,0 +1,41 @@
+{ nixpkgs }:
+
+let
+ mkHost = system: hostname: modules: {
+ "${hostname}" = nixpkgs.lib.nixosSystem {
+ inherit system;
+ modules = [ ../modules ../users ] ++ modules;
+ specialArgs = {
+ inherit hostname nixpkgs;
+ };
+ };
+ };
+
+ inherit (nixpkgs.lib.attrsets)
+ mergeAttrsList;
+ inherit (builtins)
+ concatLists
+ attrValues
+ mapAttrs
+ map;
+
+ hosts = systemsHosts:
+ mergeAttrsList
+ (concatLists
+ (attrValues
+ (mapAttrs
+ (system: hostnames:
+ map (h: mkHost system h [./${h}]) hostnames)
+ systemsHosts)));
+
+ hostsImport = file:
+ import file {
+ inherit nixpkgs mkHost hosts;
+ };
+in
+hosts {
+ "x86_64-linux" = [
+ "thyme"
+ ];
+} //
+hostsImport ./ades