2023-07-06 21:07:54 +02:00
|
|
|
{
|
2023-07-13 12:49:20 +02:00
|
|
|
inputs,
|
|
|
|
...
|
2023-07-06 21:07:54 +02:00
|
|
|
}: let
|
2023-09-08 16:10:15 +02:00
|
|
|
inherit (inputs) self;
|
2024-03-19 00:04:33 +01:00
|
|
|
inherit (self) lib;
|
2024-03-08 15:12:45 +01:00
|
|
|
|
2024-09-01 22:31:32 +02:00
|
|
|
inherit (lib.attrsets) listToAttrs;
|
|
|
|
inherit (lib.path) append;
|
|
|
|
|
2024-09-01 20:31:24 +02:00
|
|
|
createHost' = extraModules: hostDir: lib.nixosSystem {
|
2024-07-15 21:14:23 +02:00
|
|
|
system = null;
|
2024-08-30 20:27:43 +02:00
|
|
|
specialArgs = {
|
|
|
|
inherit lib inputs self;
|
|
|
|
};
|
2024-02-19 17:06:47 +01:00
|
|
|
modules = [
|
2024-08-30 20:29:16 +02:00
|
|
|
hostDir
|
2024-02-19 17:06:47 +01:00
|
|
|
../modules
|
2024-09-01 20:31:24 +02:00
|
|
|
./common/core
|
|
|
|
] ++ extraModules;
|
2024-02-19 17:06:47 +01:00
|
|
|
};
|
2024-09-01 20:31:24 +02:00
|
|
|
|
2024-09-01 22:31:32 +02:00
|
|
|
createHost = createHost' [];
|
2024-09-01 20:31:24 +02:00
|
|
|
createDesktop = createHost' [ ./common/desktop ];
|
|
|
|
createServer = createHost' [];
|
2024-07-15 21:58:14 +02:00
|
|
|
|
2024-09-01 22:31:32 +02:00
|
|
|
createHosts = hosts: listToAttrs (map (host: let
|
|
|
|
createFn = {
|
|
|
|
desktop = createDesktop;
|
|
|
|
server = createServer;
|
|
|
|
generic = createHost;
|
|
|
|
}."${host.type}";
|
|
|
|
path' = append host.dir "system.nix";
|
|
|
|
cfg = (import path') {
|
|
|
|
inherit inputs;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
name = cfg.poz.other.system.hostname;
|
|
|
|
value = createFn host.dir;
|
|
|
|
}) hosts);
|
|
|
|
in createHosts [
|
2024-09-02 11:16:53 +02:00
|
|
|
{ dir = ./niks; type = "desktop"; }
|
|
|
|
{ dir = ./del; type = "desktop"; }
|
|
|
|
{ dir = ./hape; type = "desktop"; }
|
|
|
|
{ dir = ./chmura; type = "server"; }
|
|
|
|
{ dir = ./work; type = "desktop"; }
|
2024-09-01 22:31:32 +02:00
|
|
|
]
|