oizys/lib/generators.nix

78 lines
1.5 KiB
Nix
Raw Normal View History

2024-07-03 13:05:25 -05:00
{
inputs,
self,
lib,
...
}:
let
inherit (builtins) filter;
inherit (lib)
nixosSystem
isNixFile
mkDefaultOizysModule
mkOizysModule
enabled
enableAttrs
2024-07-25 09:57:26 -05:00
pkgsFromSystem
pkgFromSystem
2024-07-25 10:06:12 -05:00
overlayFrom
2024-07-03 13:05:25 -05:00
;
inherit (lib.filesystem) listFilesRecursive;
2024-07-25 09:57:26 -05:00
pkgFrom = pkgFromSystem "x86_64-linux";
pkgsFrom = pkgsFromSystem "x86_64-linux";
2024-07-03 13:05:25 -05:00
mkIso = nixosSystem {
system = "x86_64-linux";
modules = [
self.nixosModules.nix
self.nixosModules.essentials
(
2024-07-25 09:57:26 -05:00
{ pkgs, modulesPath, ... }:
2024-07-03 13:05:25 -05:00
{
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ];
2024-07-25 09:57:26 -05:00
environment.systemPackages = (with pkgs; [ neovim ]) ++ [ (pkgFrom "self") ];
2024-07-03 13:05:25 -05:00
}
)
];
2024-07-07 14:32:46 -05:00
specialArgs = {
inherit
inputs
lib
self
enabled
;
};
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 = [
../modules/oizys.nix
../overlays
inputs.lix-module.nixosModules.default
inputs.hyprland.nixosModules.default
] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}"));
specialArgs = {
inherit
inputs
lib
self
mkDefaultOizysModule
mkOizysModule
enabled
enableAttrs
hostName
2024-07-25 09:57:26 -05:00
pkgFrom
pkgsFrom
2024-07-25 10:06:12 -05:00
overlayFrom
2024-07-03 13:05:25 -05:00
;
};
};
in
{
inherit mkIso mkSystem;
}