nix/lib/default.nix

44 lines
1.3 KiB
Nix
Raw Normal View History

2023-08-23 21:39:51 +09:00
{ inputs, outputs, stateVersion, hmStateVersion, ... }: {
2023-08-25 19:07:54 +09:00
2023-08-23 16:53:29 +09:00
# Helper function for generating home-manager configs
2023-08-31 20:22:44 +09:00
mkHome = {
hostname,
2023-09-16 21:21:45 +09:00
username ? "albert",
2023-08-31 20:22:44 +09:00
desktop ? null,
platform ? "x86_64-linux",
2023-09-15 12:03:35 +09:00
theme ? "default"
2023-08-31 20:22:44 +09:00
}: inputs.home-manager.lib.homeManagerConfiguration {
2023-08-23 19:47:21 +09:00
pkgs = inputs.nixpkgs.legacyPackages.${platform};
2023-08-31 20:22:44 +09:00
extraSpecialArgs = { inherit inputs outputs desktop hostname platform username hmStateVersion theme; };
2023-08-25 19:07:54 +09:00
modules = [
../home-manager
inputs.doom-emacs.hmModule
];
2023-08-23 16:53:29 +09:00
};
# Helper function for generating host configs
2023-08-31 20:22:44 +09:00
mkHost = {
hostname,
2023-09-16 21:21:45 +09:00
username ? "albert",
2023-08-31 20:22:44 +09:00
desktop ? null,
installer ? null,
gpu ? null,
platform ? "x86_64-linux",
2023-09-15 12:03:35 +09:00
theme ? "default"
2023-08-31 20:22:44 +09:00
}: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; };
2023-08-23 16:53:29 +09:00
modules = [
2023-08-23 17:11:24 +09:00
../nixos
2023-08-27 19:50:23 +09:00
inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote
2023-08-23 16:53:29 +09:00
] ++ (inputs.nixpkgs.lib.optionals (installer != null) [ installer ]);
};
forAllSystems = inputs.nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
2023-08-25 19:07:54 +09:00
}