mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-27 20:01:29 +01:00
feat: simplify flake.nix
This commit is contained in:
35
lib/nixosSystem.nix
Normal file
35
lib/nixosSystem.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nixos-generators,
|
||||
system,
|
||||
specialArgs,
|
||||
nixos-modules,
|
||||
home-module,
|
||||
}: let
|
||||
username = specialArgs.username;
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
modules =
|
||||
nixos-modules
|
||||
++ [
|
||||
nixos-generators.nixosModules.all-formats
|
||||
{
|
||||
# formatConfigs.iso = {config, ...}: {};
|
||||
formatConfigs.proxmox = {config, ...}: {
|
||||
# custom proxmox's image name
|
||||
proxmox.qemuConf.name = "${config.networking.hostName}-nixos-${config.system.nixos.label}";
|
||||
};
|
||||
}
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user