oizys/lib/generators.nix

69 lines
1.2 KiB
Nix
Raw Normal View History

2024-07-03 13:05:25 -05:00
{
inputs,
self,
lib,
...
}:
let
inherit (lib)
nixosSystem
mkDefaultOizysModule
mkOizysModule
enabled
enableAttrs
2024-07-27 11:45:03 -05:00
flakeFromSystem
2024-08-12 11:39:14 -05:00
listify
2025-01-06 15:29:31 -06:00
readSettings
hostFiles
2024-07-03 13:05:25 -05:00
;
2024-07-27 11:45:03 -05:00
flake = flakeFromSystem "x86_64-linux";
2024-11-28 17:35:38 -06:00
nixosModules = names: names |> listify |> map (n: inputs.${n}.nixosModules.default);
selfModules = names: names |> listify |> map (n: self.nixosModules.${n});
2024-08-10 17:26:38 -05:00
commonSpecialArgs = {
inherit
self
inputs
lib
2025-01-16 17:12:11 -06:00
flake
2024-08-10 17:26:38 -05:00
enabled
;
};
2024-08-10 16:18:37 -05:00
2024-07-03 13:05:25 -05:00
mkIso = nixosSystem {
2025-01-16 15:59:08 -06:00
modules =
[
{ nixpkgs.hostPlatform = "x86_64-linux"; }
]
++ (nixosModules "lix-module")
2025-01-16 17:12:11 -06:00
++ (selfModules "essentials|iso");
2024-08-10 16:18:37 -05:00
specialArgs = commonSpecialArgs;
2024-07-03 13:05:25 -05:00
};
2024-07-10 13:06:28 -05:00
2024-07-03 13:05:25 -05:00
mkSystem =
hostName:
nixosSystem {
2024-11-28 17:35:38 -06:00
modules =
2025-01-06 15:29:31 -06:00
[
2025-01-16 15:59:08 -06:00
{ nixpkgs.hostPlatform = "x86_64-linux"; }
2025-01-06 15:29:31 -06:00
]
2024-11-28 17:35:38 -06:00
++ (selfModules ''oizys'')
2024-12-12 16:38:33 -06:00
++ (nixosModules ''lix-module|sops-nix'')
2024-11-28 17:35:38 -06:00
++ (hostFiles hostName);
2024-07-25 11:56:35 -05:00
2024-08-10 16:18:37 -05:00
specialArgs = commonSpecialArgs // {
2024-07-03 13:05:25 -05:00
inherit
mkDefaultOizysModule
mkOizysModule
2024-08-12 11:39:14 -05:00
listify
2024-07-03 13:05:25 -05:00
enableAttrs
hostName
2025-01-06 15:29:31 -06:00
readSettings
2024-07-03 13:05:25 -05:00
;
};
};
in
{
inherit mkIso mkSystem;
}