feat: vm setup
This commit is contained in:
37
flake.nix
37
flake.nix
@@ -42,6 +42,43 @@
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
packages.aarch64-darwin = {
|
||||
setup-vm = let
|
||||
pkgs = import nixpkgs { system = "aarch64-darwin"; };
|
||||
script-name = "setup-vm";
|
||||
src = builtins.readFile ./nixos/proxmox/setup-vm.sh;
|
||||
script = (pkgs.writeScriptBin script-name src).overrideAttrs(old: {
|
||||
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||
});
|
||||
buildInputs = with pkgs; [
|
||||
gum
|
||||
agenix.packages.aarch64-darwin.default
|
||||
];
|
||||
in pkgs.symlinkJoin {
|
||||
name = script-name;
|
||||
paths = [ script ] ++ buildInputs;
|
||||
nativeBuildInputs = with pkgs; [makeWrapper];
|
||||
postBuild = "wrapProgram $out/bin/${script-name} --prefix PATH : $out/bin";
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = let
|
||||
nodes = ["premhome-falcon-1" "premhome-falcon-2"];
|
||||
in builtins.listToAttrs (map (name: {
|
||||
name = name;
|
||||
value = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { meta = { hostname = name; }; };
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
./nixos/server/disko-config.nix
|
||||
./nixos/server/configuration.nix
|
||||
./nixos/server/hardware-configuration.nix
|
||||
];
|
||||
};
|
||||
}) nodes);
|
||||
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
||||
Reference in New Issue
Block a user