oizys/lib/generators.nix

73 lines
1.4 KiB
Nix
Raw Normal View History

2024-07-03 13:05:25 -05:00
{
inputs,
self,
lib,
...
}:
let
inherit (builtins) filter;
inherit (lib)
nixosSystem
mkDefaultOizysModule
mkOizysModule
enabled
enableAttrs
2024-07-25 11:56:35 -05:00
isNixFile
2024-07-27 11:45:03 -05:00
flakeFromSystem
2024-08-12 11:39:14 -05:00
listify
2024-07-03 13:05:25 -05:00
;
inherit (lib.filesystem) listFilesRecursive;
2024-07-27 11:45:03 -05:00
flake = flakeFromSystem "x86_64-linux";
2024-07-25 11:56:35 -05:00
hostPath = host: ../. + "/hosts/${host}";
# all nix files not including pkgs.nix
2024-08-10 15:50:20 -05:00
# hostFiles = host: filter isNixFile (listFilesRecursive (hostPath host));
hostFiles = host: host |> hostPath |> listFilesRecursive |> filter isNixFile;
2024-07-25 11:56:35 -05:00
2024-08-10 17:26:38 -05:00
commonSpecialArgs = {
inherit
self
inputs
lib
enabled
;
};
2024-08-10 16:18:37 -05:00
2024-07-03 13:05:25 -05:00
mkIso = nixosSystem {
system = "x86_64-linux";
modules = [
2024-08-09 15:28:32 -05:00
inputs.lix-module.nixosModules.default
2024-07-03 13:05:25 -05:00
self.nixosModules.nix
self.nixosModules.essentials
2024-08-10 15:50:20 -05:00
self.nixosModules.iso
2024-07-03 13:05:25 -05:00
];
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 {
system = "x86_64-linux";
modules = [
2024-09-04 11:51:35 -05:00
../modules/oizys.nix
2024-07-03 13:05:25 -05:00
inputs.lix-module.nixosModules.default
inputs.hyprland.nixosModules.default
2024-11-05 21:39:52 -06:00
inputs.comin.nixosModules.comin
2024-07-25 11:56:35 -05:00
] ++ (hostFiles hostName);
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
2024-07-27 11:45:03 -05:00
flake
2024-07-03 13:05:25 -05:00
;
};
};
in
{
inherit mkIso mkSystem;
}