Implement better remote build script
This commit is contained in:
+2
-1
@@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
@@ -16,5 +16,6 @@
|
||||
./jenkins
|
||||
./gaming
|
||||
./yubikey
|
||||
./scripts
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "pve-build" ''
|
||||
export PATH="${
|
||||
lib.makeBinPath [
|
||||
pkgs.jq
|
||||
pkgs.openssh
|
||||
]
|
||||
}:$PATH"
|
||||
${builtins.readFile ./pve-build.sh}
|
||||
'')
|
||||
];
|
||||
|
||||
home-manager.users.${username} = {
|
||||
programs.nushell.extraConfig =
|
||||
lib.mkIf config.home-manager.users.${username}.programs.nushell.enable
|
||||
''
|
||||
def "nu-complete pve-build-cmds" [] {
|
||||
[build test switch boot check-image deploy-image update-image start-builder build-on activate destroy-builder info]
|
||||
}
|
||||
|
||||
def "nu-complete pve-build-activate" [] {
|
||||
[test switch boot]
|
||||
}
|
||||
|
||||
extern pve-build [
|
||||
command?: string@"nu-complete pve-build-cmds"
|
||||
--machine: string
|
||||
--pve-host: string
|
||||
--pve-storage: string
|
||||
--rootfs-storage: string
|
||||
--bridge: string
|
||||
--vmid-start: int
|
||||
--vmid-floor: int
|
||||
--rootfs-gib: int
|
||||
--keep
|
||||
--local-build
|
||||
--show-trace
|
||||
--verbose
|
||||
--debug
|
||||
--help(-h)
|
||||
]
|
||||
'';
|
||||
};
|
||||
}
|
||||
Executable
+1103
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user