1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2024-12-29 20:23:53 +00:00
ultima/libx/builder.nix

50 lines
997 B
Nix

{
inputs,
lib,
# VARIABLES
hostName ? "sus",
userName ? "amogus",
flakeDir ? null,
# SYSINFO
plfrm,
ver,
dev,
...
}:
{
flake =
let
# OTHER
inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (inputs.home-manager.lib) homeManagerConfiguration;
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
# NEEDS
sec = import ./secrets.nix;
x = import ./options.nix { inherit lib; } // {
inherit
hostName
userName
flakeDir
plfrm
ver
dev
sec
;
};
# ARGS
args = { inherit x inputs; };
in
{
# CONFIGURATION
nixosConfigurations.${hostName} = nixosSystem {
modules = [ ../${hostName}/host ];
specialArgs = args;
};
homeConfigurations.${userName} = homeManagerConfiguration {
modules = [ ../${hostName}/home ];
extraSpecialArgs = args;
inherit pkgs;
};
};
}