forked from fediversity/fediversity
automated deployment to proxmox (in nix run) of vm booting to login
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
parent
bd631227e7
commit
bf317c600a
11 changed files with 237 additions and 257 deletions
|
@ -126,6 +126,8 @@ let
|
||||||
../common/sharedOptions.nix
|
../common/sharedOptions.nix
|
||||||
# tests need this, however outside tests this (and esp its import nixos-test-base) must not be used
|
# tests need this, however outside tests this (and esp its import nixos-test-base) must not be used
|
||||||
../common/targetNode.nix
|
../common/targetNode.nix
|
||||||
|
"${nixpkgs}/nixos/modules/profiles/minimal.nix"
|
||||||
|
"${nixpkgs}/nixos/modules/profiles/perlless.nix"
|
||||||
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
|
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
|
||||||
../../../infra/common/nixos/repart.nix
|
../../../infra/common/nixos/repart.nix
|
||||||
# disko needed in makeInstallerIso.nix
|
# disko needed in makeInstallerIso.nix
|
||||||
|
|
|
@ -76,6 +76,7 @@ in
|
||||||
machine =
|
machine =
|
||||||
(pkgs.nixos [
|
(pkgs.nixos [
|
||||||
./targetNode.nix
|
./targetNode.nix
|
||||||
|
../../../infra/common/nixos/repart.nix
|
||||||
config.system.extraDependenciesFromModule
|
config.system.extraDependenciesFromModule
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
runNixOSTest,
|
|
||||||
inputs,
|
inputs,
|
||||||
sources,
|
sources,
|
||||||
system,
|
system,
|
||||||
|
@ -25,7 +24,7 @@ let
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
runNixOSTest {
|
pkgs.testers.runNixOSTest {
|
||||||
node.specialArgs = {
|
node.specialArgs = {
|
||||||
inherit
|
inherit
|
||||||
sources
|
sources
|
||||||
|
|
|
@ -62,13 +62,13 @@ in
|
||||||
sockets = 1;
|
sockets = 1;
|
||||||
kvm = true;
|
kvm = true;
|
||||||
scsi = [ { file = "local:16"; } ];
|
scsi = [ { file = "local:16"; } ];
|
||||||
cdrom = "local:iso/minimal.iso";
|
# cdrom = "local:iso/minimal.iso";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
additionalPaths = [ minimalIso ];
|
additionalPaths = [ minimalIso ];
|
||||||
diskSize = 2*1024;
|
diskSize = 2 * 1024;
|
||||||
memorySize = 2048;
|
memorySize = 2048;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -95,131 +95,131 @@ in
|
||||||
system.extraDependencies =
|
system.extraDependencies =
|
||||||
# (lib.lists.map lib.traceVal)
|
# (lib.lists.map lib.traceVal)
|
||||||
# (
|
# (
|
||||||
# (lib.lists.concatMap (
|
# (lib.lists.concatMap (
|
||||||
# pkg:
|
# pkg:
|
||||||
# (
|
# (
|
||||||
# if
|
# if
|
||||||
# pkg ? inputDerivation
|
# pkg ? inputDerivation
|
||||||
# # error: output '/nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2' is not allowed to refer to the following paths:
|
# # error: output '/nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2' is not allowed to refer to the following paths:
|
||||||
# # /nix/store/2xdmps65ryklmbf025bm4pxv16gb8ajv-sudo-1.9.16p2.tar.gz
|
# # /nix/store/2xdmps65ryklmbf025bm4pxv16gb8ajv-sudo-1.9.16p2.tar.gz
|
||||||
# # /nix/store/58br4vk3q5akf4g8lx0pqzfhn47k3j8d-bash-5.2p37
|
# # /nix/store/58br4vk3q5akf4g8lx0pqzfhn47k3j8d-bash-5.2p37
|
||||||
# # /nix/store/8v6k283dpbc0qkdq81nb6mrxrgcb10i1-gcc-wrapper-14-20241116
|
# # /nix/store/8v6k283dpbc0qkdq81nb6mrxrgcb10i1-gcc-wrapper-14-20241116
|
||||||
# # /nix/store/9r1nl9ksiyszy4qzzg6y2gcdkca0xmhy-stdenv-linux
|
# # /nix/store/9r1nl9ksiyszy4qzzg6y2gcdkca0xmhy-stdenv-linux
|
||||||
# # /nix/store/a4rmp6in7igbl1wbz9pli5nq0wiclq0y-groff-1.23.0
|
# # /nix/store/a4rmp6in7igbl1wbz9pli5nq0wiclq0y-groff-1.23.0
|
||||||
# # /nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2
|
# # /nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2
|
||||||
# # /nix/store/f5y58qz2fzpzgkhp0nizixi10x04ppyy-linux-pam-1.6.1
|
# # /nix/store/f5y58qz2fzpzgkhp0nizixi10x04ppyy-linux-pam-1.6.1
|
||||||
# # /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh
|
# # /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh
|
||||||
# # /nix/store/vj1c3wf9c11a0qs6p3ymfvrnsdgsdcbq-source-stdenv.sh
|
# # /nix/store/vj1c3wf9c11a0qs6p3ymfvrnsdgsdcbq-source-stdenv.sh
|
||||||
# # /nix/store/yh6qg1nsi5h2xblcr67030pz58fsaxx3-coreutils-9.6
|
# # /nix/store/yh6qg1nsi5h2xblcr67030pz58fsaxx3-coreutils-9.6
|
||||||
# && !(lib.strings.hasInfix "sudo" (lib.traceVal (builtins.toString pkg)))
|
# && !(lib.strings.hasInfix "sudo" (lib.traceVal (builtins.toString pkg)))
|
||||||
# then
|
# then
|
||||||
# lib.trace "yes" [
|
# lib.trace "yes" [
|
||||||
# # lib.traceVal pkg.inputDerivation # not of type `path in the Nix store'
|
# # lib.traceVal pkg.inputDerivation # not of type `path in the Nix store'
|
||||||
# (
|
# (
|
||||||
# (
|
# (
|
||||||
# x: builtins.trace "${builtins.toString pkg}: ${builtins.toString (lib.isPath x.inputDerivation)}" x
|
# x: builtins.trace "${builtins.toString pkg}: ${builtins.toString (lib.isPath x.inputDerivation)}" x
|
||||||
# )
|
# )
|
||||||
# pkg
|
# pkg
|
||||||
# ).inputDerivation
|
# ).inputDerivation
|
||||||
# ]
|
# ]
|
||||||
# else
|
# else
|
||||||
# lib.trace "no" [ ]
|
# lib.trace "no" [ ]
|
||||||
# )
|
# )
|
||||||
# ) machine.environment.systemPackages)
|
# ) machine.environment.systemPackages)
|
||||||
# ++ (let
|
# ++ (let
|
||||||
# base =
|
# base =
|
||||||
# (import "${pkgs.nixos-generators}/share/nixos-generator/nixos-generate.nix" {
|
# (import "${pkgs.nixos-generators}/share/nixos-generator/nixos-generate.nix" {
|
||||||
# inherit system;
|
# inherit system;
|
||||||
# inherit (sources) nixpkgs;
|
# inherit (sources) nixpkgs;
|
||||||
# formatConfig = "${pkgs.nixos-generators}/share/nixos-generator/formats/proxmox.nix";
|
# formatConfig = "${pkgs.nixos-generators}/share/nixos-generator/formats/proxmox.nix";
|
||||||
# configuration = "${pkgs.nixos-generators}/share/nixos-generator/configuration.nix";
|
# configuration = "${pkgs.nixos-generators}/share/nixos-generator/configuration.nix";
|
||||||
# }).config;
|
# }).config;
|
||||||
# in [
|
# in [
|
||||||
# base.system.build.toplevel.inputDerivation
|
# base.system.build.toplevel.inputDerivation
|
||||||
# base.system.build.etc.inputDerivation
|
# base.system.build.etc.inputDerivation
|
||||||
# base.system.build.etcBasedir.inputDerivation
|
# base.system.build.etcBasedir.inputDerivation
|
||||||
# base.system.build.etcMetadataImage.inputDerivation
|
# base.system.build.etcMetadataImage.inputDerivation
|
||||||
# base.system.build.extraUtils.inputDerivation
|
# base.system.build.extraUtils.inputDerivation
|
||||||
# base.system.path.inputDerivation
|
# base.system.path.inputDerivation
|
||||||
# base.system.build.setEnvironment.inputDerivation
|
# base.system.build.setEnvironment.inputDerivation
|
||||||
# base.system.build.vm.inputDerivation
|
# base.system.build.vm.inputDerivation
|
||||||
# base.system.build.bootStage1.inputDerivation
|
# base.system.build.bootStage1.inputDerivation
|
||||||
# base.system.build.bootStage2.inputDerivation
|
# base.system.build.bootStage2.inputDerivation
|
||||||
# ])
|
# ])
|
||||||
# ++
|
# ++
|
||||||
[
|
[
|
||||||
# )
|
|
||||||
# (
|
|
||||||
# (x: builtins.trace "machine.system.build.vm.inputDerivation: ${builtins.toString (lib.isPath x)}" x)
|
|
||||||
# machine.system.build.toplevel.inputDerivation
|
|
||||||
# machine.system.build.etc.inputDerivation
|
|
||||||
# machine.system.build.etcBasedir.inputDerivation
|
|
||||||
# machine.system.build.etcMetadataImage.inputDerivation
|
|
||||||
# machine.system.build.extraUtils.inputDerivation
|
|
||||||
# machine.system.path.inputDerivation
|
|
||||||
# machine.system.build.setEnvironment.inputDerivation
|
|
||||||
# machine.system.build.vm.inputDerivation
|
|
||||||
# machine.system.build.bootStage1.inputDerivation
|
|
||||||
# machine.system.build.bootStage2.inputDerivation
|
|
||||||
pkgs.gnu-config
|
|
||||||
# pkgs.gnu-config.inputDerivation
|
|
||||||
pkgs.byacc
|
|
||||||
# pkgs.byacc.inputDerivation
|
|
||||||
pkgs.stdenv
|
|
||||||
pkgs.stdenvNoCC
|
|
||||||
sources.nixpkgs
|
|
||||||
pkgs.vte
|
|
||||||
|
|
||||||
# (
|
|
||||||
# ## We build a whole NixOS system that contains the module
|
|
||||||
# ## `system.extraDependenciesFromModule`, only to grab its
|
|
||||||
# ## configuration and the store paths needed to build it and
|
|
||||||
# ## dump them in `system.extraDependencies`.
|
|
||||||
# # see: https://git.fediversity.eu/Fediversity/Fediversity/pulls/338/files
|
|
||||||
|
|
||||||
# pkgs.closureInfo {
|
|
||||||
# rootPaths = map (drv: drv.drvPath) (
|
|
||||||
# [
|
|
||||||
# machine.system.build.toplevel.inputDerivation
|
|
||||||
# machine.system.build.etc.inputDerivation
|
|
||||||
# machine.system.build.etcBasedir.inputDerivation
|
|
||||||
# machine.system.build.etcMetadataImage.inputDerivation
|
|
||||||
# machine.system.build.extraUtils.inputDerivation
|
|
||||||
# machine.system.path.inputDerivation
|
|
||||||
# machine.system.build.setEnvironment.inputDerivation
|
|
||||||
# machine.system.build.vm.inputDerivation
|
|
||||||
# machine.system.build.bootStage1.inputDerivation
|
|
||||||
# machine.system.build.bootStage2.inputDerivation
|
|
||||||
# ]
|
|
||||||
# ++ lib.concatMap (x: if x ? source.inputDerivation then [ x.source.inputDerivation ] else [ ]) (
|
|
||||||
# lib.attrValues machine.environment.etc
|
|
||||||
# )
|
|
||||||
# ++ machine.environment.systemPackages
|
|
||||||
# );
|
|
||||||
# }
|
|
||||||
# )
|
|
||||||
|
|
||||||
]
|
|
||||||
# ++ lib.concatLists (
|
|
||||||
# lib.mapAttrsToList (
|
|
||||||
# _k: v:
|
|
||||||
# if v ? source.inputDerivation then
|
|
||||||
# [
|
|
||||||
# # v.source.inputDerivation
|
|
||||||
# (
|
|
||||||
# (
|
|
||||||
# x:
|
|
||||||
# builtins.trace "${builtins.toString (lib.attrNames v)}: ${builtins.toString (lib.isPath x.source.inputDerivation)}" x
|
|
||||||
# )
|
|
||||||
# v
|
|
||||||
# ).source.inputDerivation
|
|
||||||
# ]
|
|
||||||
# else
|
|
||||||
# [ ]
|
|
||||||
# ) machine.environment.etc
|
|
||||||
# )
|
# )
|
||||||
# )
|
# (
|
||||||
;
|
# (x: builtins.trace "machine.system.build.vm.inputDerivation: ${builtins.toString (lib.isPath x)}" x)
|
||||||
|
# machine.system.build.toplevel.inputDerivation
|
||||||
|
# machine.system.build.etc.inputDerivation
|
||||||
|
# machine.system.build.etcBasedir.inputDerivation
|
||||||
|
# machine.system.build.etcMetadataImage.inputDerivation
|
||||||
|
# machine.system.build.extraUtils.inputDerivation
|
||||||
|
# machine.system.path.inputDerivation
|
||||||
|
# machine.system.build.setEnvironment.inputDerivation
|
||||||
|
# machine.system.build.vm.inputDerivation
|
||||||
|
# machine.system.build.bootStage1.inputDerivation
|
||||||
|
# machine.system.build.bootStage2.inputDerivation
|
||||||
|
pkgs.gnu-config
|
||||||
|
# pkgs.gnu-config.inputDerivation
|
||||||
|
pkgs.byacc
|
||||||
|
# pkgs.byacc.inputDerivation
|
||||||
|
pkgs.stdenv
|
||||||
|
pkgs.stdenvNoCC
|
||||||
|
sources.nixpkgs
|
||||||
|
pkgs.vte
|
||||||
|
|
||||||
|
# (
|
||||||
|
# ## We build a whole NixOS system that contains the module
|
||||||
|
# ## `system.extraDependenciesFromModule`, only to grab its
|
||||||
|
# ## configuration and the store paths needed to build it and
|
||||||
|
# ## dump them in `system.extraDependencies`.
|
||||||
|
# # see: https://git.fediversity.eu/Fediversity/Fediversity/pulls/338/files
|
||||||
|
|
||||||
|
# pkgs.closureInfo {
|
||||||
|
# rootPaths = map (drv: drv.drvPath) (
|
||||||
|
# [
|
||||||
|
# machine.system.build.toplevel.inputDerivation
|
||||||
|
# machine.system.build.etc.inputDerivation
|
||||||
|
# machine.system.build.etcBasedir.inputDerivation
|
||||||
|
# machine.system.build.etcMetadataImage.inputDerivation
|
||||||
|
# machine.system.build.extraUtils.inputDerivation
|
||||||
|
# machine.system.path.inputDerivation
|
||||||
|
# machine.system.build.setEnvironment.inputDerivation
|
||||||
|
# machine.system.build.vm.inputDerivation
|
||||||
|
# machine.system.build.bootStage1.inputDerivation
|
||||||
|
# machine.system.build.bootStage2.inputDerivation
|
||||||
|
# ]
|
||||||
|
# ++ lib.concatMap (x: if x ? source.inputDerivation then [ x.source.inputDerivation ] else [ ]) (
|
||||||
|
# lib.attrValues machine.environment.etc
|
||||||
|
# )
|
||||||
|
# ++ machine.environment.systemPackages
|
||||||
|
# );
|
||||||
|
# }
|
||||||
|
# )
|
||||||
|
|
||||||
|
]
|
||||||
|
# ++ lib.concatLists (
|
||||||
|
# lib.mapAttrsToList (
|
||||||
|
# _k: v:
|
||||||
|
# if v ? source.inputDerivation then
|
||||||
|
# [
|
||||||
|
# # v.source.inputDerivation
|
||||||
|
# (
|
||||||
|
# (
|
||||||
|
# x:
|
||||||
|
# builtins.trace "${builtins.toString (lib.attrNames v)}: ${builtins.toString (lib.isPath x.source.inputDerivation)}" x
|
||||||
|
# )
|
||||||
|
# v
|
||||||
|
# ).source.inputDerivation
|
||||||
|
# ]
|
||||||
|
# else
|
||||||
|
# [ ]
|
||||||
|
# ) machine.environment.etc
|
||||||
|
# )
|
||||||
|
# )
|
||||||
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
runNixOSTest,
|
|
||||||
inputs,
|
inputs,
|
||||||
sources,
|
sources,
|
||||||
system,
|
system,
|
||||||
|
@ -22,10 +21,11 @@ let
|
||||||
})
|
})
|
||||||
proxmox-ve
|
proxmox-ve
|
||||||
pve-ha-manager
|
pve-ha-manager
|
||||||
|
pve-qemu
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
runNixOSTest {
|
pkgs.testers.runNixOSTest {
|
||||||
node.specialArgs = {
|
node.specialArgs = {
|
||||||
inherit
|
inherit
|
||||||
sources
|
sources
|
||||||
|
|
|
@ -28,35 +28,6 @@ let
|
||||||
url = "https://releases.nixos.org/nixos/24.05/nixos-24.05.7139.bcba2fbf6963/nixos-minimal-24.05.7139.bcba2fbf6963-x86_64-linux.iso";
|
url = "https://releases.nixos.org/nixos/24.05/nixos-24.05.7139.bcba2fbf6963/nixos-minimal-24.05.7139.bcba2fbf6963-x86_64-linux.iso";
|
||||||
hash = "sha256-plre/mIHdIgU4xWU+9xErP+L4i460ZbcKq8iy2n4HT8=";
|
hash = "sha256-plre/mIHdIgU4xWU+9xErP+L4i460ZbcKq8iy2n4HT8=";
|
||||||
};
|
};
|
||||||
proxmox = {
|
|
||||||
formatConfig = "${pkgs.nixos-generators}/share/nixos-generator/formats/proxmox.nix";
|
|
||||||
formatAttr = "VMA";
|
|
||||||
fileExtension = ".vma.zst";
|
|
||||||
};
|
|
||||||
format = proxmox;
|
|
||||||
# qcow = {
|
|
||||||
# formatConfig = "${pkgs.nixos-generators}/share/nixos-generator/formats/qcow.nix";
|
|
||||||
# formatAttr = "qcow";
|
|
||||||
# fileExtension = ".qcow2";
|
|
||||||
# };
|
|
||||||
# format = qcow;
|
|
||||||
# qcow-efi = {
|
|
||||||
# formatConfig = "${pkgs.nixos-generators}/share/nixos-generator/formats/qcow-efi.nix";
|
|
||||||
# formatAttr = "qcow-efi";
|
|
||||||
# fileExtension = ".qcow2";
|
|
||||||
# };
|
|
||||||
# format = qcow-efi;
|
|
||||||
inherit (format) formatConfig; # formatAttr fileExtension
|
|
||||||
# TODO parameterize things to let this flow into the terraform
|
|
||||||
# btw qcow can be made by nixos-generators (qcow, qcow-efi) or by `image.repart`
|
|
||||||
# wait, so i generate an image for the nixos config from the data model? how would i then propagate that to deploy?
|
|
||||||
gen = import "${pkgs.nixos-generators}/share/nixos-generator/nixos-generate.nix" {
|
|
||||||
inherit system formatConfig;
|
|
||||||
inherit (sources) nixpkgs;
|
|
||||||
# formatConfig = "${pkgs.nixos-generators}/share/nixos-generator/formats/proxmox.nix";
|
|
||||||
configuration = deployment.nixos-configuration;
|
|
||||||
};
|
|
||||||
machine = gen.config;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
_class = "nixosTest";
|
_class = "nixosTest";
|
||||||
|
@ -90,7 +61,7 @@ in
|
||||||
sockets = 1;
|
sockets = 1;
|
||||||
kvm = true;
|
kvm = true;
|
||||||
scsi = [ { file = "local:16"; } ];
|
scsi = [ { file = "local:16"; } ];
|
||||||
cdrom = "local:iso/minimal.iso";
|
# cdrom = "local:iso/minimal.iso";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -123,37 +94,37 @@ in
|
||||||
system.extraDependencies =
|
system.extraDependencies =
|
||||||
# (lib.lists.map lib.traceVal)
|
# (lib.lists.map lib.traceVal)
|
||||||
(
|
(
|
||||||
(lib.lists.concatMap (
|
# (lib.lists.concatMap (
|
||||||
pkg:
|
# pkg:
|
||||||
(
|
# (
|
||||||
if
|
# if
|
||||||
pkg ? inputDerivation
|
# pkg ? inputDerivation
|
||||||
# error: output '/nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2' is not allowed to refer to the following paths:
|
# # error: output '/nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2' is not allowed to refer to the following paths:
|
||||||
# /nix/store/2xdmps65ryklmbf025bm4pxv16gb8ajv-sudo-1.9.16p2.tar.gz
|
# # /nix/store/2xdmps65ryklmbf025bm4pxv16gb8ajv-sudo-1.9.16p2.tar.gz
|
||||||
# /nix/store/58br4vk3q5akf4g8lx0pqzfhn47k3j8d-bash-5.2p37
|
# # /nix/store/58br4vk3q5akf4g8lx0pqzfhn47k3j8d-bash-5.2p37
|
||||||
# /nix/store/8v6k283dpbc0qkdq81nb6mrxrgcb10i1-gcc-wrapper-14-20241116
|
# # /nix/store/8v6k283dpbc0qkdq81nb6mrxrgcb10i1-gcc-wrapper-14-20241116
|
||||||
# /nix/store/9r1nl9ksiyszy4qzzg6y2gcdkca0xmhy-stdenv-linux
|
# # /nix/store/9r1nl9ksiyszy4qzzg6y2gcdkca0xmhy-stdenv-linux
|
||||||
# /nix/store/a4rmp6in7igbl1wbz9pli5nq0wiclq0y-groff-1.23.0
|
# # /nix/store/a4rmp6in7igbl1wbz9pli5nq0wiclq0y-groff-1.23.0
|
||||||
# /nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2
|
# # /nix/store/dki9d3vldafg9ydrfm7x0g0rr0qljk98-sudo-1.9.16p2
|
||||||
# /nix/store/f5y58qz2fzpzgkhp0nizixi10x04ppyy-linux-pam-1.6.1
|
# # /nix/store/f5y58qz2fzpzgkhp0nizixi10x04ppyy-linux-pam-1.6.1
|
||||||
# /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh
|
# # /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh
|
||||||
# /nix/store/vj1c3wf9c11a0qs6p3ymfvrnsdgsdcbq-source-stdenv.sh
|
# # /nix/store/vj1c3wf9c11a0qs6p3ymfvrnsdgsdcbq-source-stdenv.sh
|
||||||
# /nix/store/yh6qg1nsi5h2xblcr67030pz58fsaxx3-coreutils-9.6
|
# # /nix/store/yh6qg1nsi5h2xblcr67030pz58fsaxx3-coreutils-9.6
|
||||||
&& !(lib.strings.hasInfix "sudo" (lib.traceVal (builtins.toString pkg)))
|
# && !(lib.strings.hasInfix "sudo" (lib.traceVal (builtins.toString pkg)))
|
||||||
then
|
# then
|
||||||
lib.trace "yes" [
|
# lib.trace "yes" [
|
||||||
# lib.traceVal pkg.inputDerivation # not of type `path in the Nix store'
|
# # lib.traceVal pkg.inputDerivation # not of type `path in the Nix store'
|
||||||
(
|
# (
|
||||||
(
|
# (
|
||||||
x: builtins.trace "${builtins.toString pkg}: ${builtins.toString (lib.isPath x.inputDerivation)}" x
|
# x: builtins.trace "${builtins.toString pkg}: ${builtins.toString (lib.isPath x.inputDerivation)}" x
|
||||||
)
|
# )
|
||||||
pkg
|
# pkg
|
||||||
).inputDerivation
|
# ).inputDerivation
|
||||||
]
|
# ]
|
||||||
else
|
# else
|
||||||
lib.trace "no" [ ]
|
# lib.trace "no" [ ]
|
||||||
)
|
# )
|
||||||
) machine.environment.systemPackages)
|
# ) machine.environment.systemPackages)
|
||||||
# ++ (let
|
# ++ (let
|
||||||
# base =
|
# base =
|
||||||
# (import "${pkgs.nixos-generators}/share/nixos-generator/nixos-generate.nix" {
|
# (import "${pkgs.nixos-generators}/share/nixos-generator/nixos-generate.nix" {
|
||||||
|
@ -174,20 +145,27 @@ in
|
||||||
# base.system.build.bootStage1.inputDerivation
|
# base.system.build.bootStage1.inputDerivation
|
||||||
# base.system.build.bootStage2.inputDerivation
|
# base.system.build.bootStage2.inputDerivation
|
||||||
# ])
|
# ])
|
||||||
++ [
|
# ++
|
||||||
|
[
|
||||||
# )
|
# )
|
||||||
# (
|
# (
|
||||||
# (x: builtins.trace "machine.system.build.vm.inputDerivation: ${builtins.toString (lib.isPath x)}" x)
|
# (x: builtins.trace "machine.system.build.vm.inputDerivation: ${builtins.toString (lib.isPath x)}" x)
|
||||||
machine.system.build.toplevel.inputDerivation
|
# machine.system.build.toplevel.inputDerivation
|
||||||
machine.system.build.etc.inputDerivation
|
# machine.system.build.etc.inputDerivation
|
||||||
machine.system.build.etcBasedir.inputDerivation
|
# machine.system.build.etcBasedir.inputDerivation
|
||||||
machine.system.build.etcMetadataImage.inputDerivation
|
# machine.system.build.etcMetadataImage.inputDerivation
|
||||||
machine.system.build.extraUtils.inputDerivation
|
# machine.system.build.extraUtils.inputDerivation
|
||||||
machine.system.path.inputDerivation
|
# machine.system.path.inputDerivation
|
||||||
machine.system.build.setEnvironment.inputDerivation
|
# machine.system.build.setEnvironment.inputDerivation
|
||||||
machine.system.build.vm.inputDerivation
|
# machine.system.build.vm.inputDerivation
|
||||||
machine.system.build.bootStage1.inputDerivation
|
# machine.system.build.bootStage1.inputDerivation
|
||||||
machine.system.build.bootStage2.inputDerivation
|
# machine.system.build.bootStage2.inputDerivation
|
||||||
|
pkgs.ubootQemuX86
|
||||||
|
pkgs.ubootQemuX86.inputDerivation
|
||||||
|
pkgs.pve-qemu
|
||||||
|
pkgs.pve-qemu.inputDerivation
|
||||||
|
# (pkgs.callPackage "${sources.proxmox-nixos}/pkgs/pve-qemu" { })
|
||||||
|
# (pkgs.callPackage "${sources.proxmox-nixos}/pkgs/pve-qemu" { }).inputDerivation
|
||||||
pkgs.gnu-config
|
pkgs.gnu-config
|
||||||
# pkgs.gnu-config.inputDerivation
|
# pkgs.gnu-config.inputDerivation
|
||||||
pkgs.byacc
|
pkgs.byacc
|
||||||
|
@ -197,54 +175,54 @@ in
|
||||||
sources.nixpkgs
|
sources.nixpkgs
|
||||||
pkgs.vte
|
pkgs.vte
|
||||||
|
|
||||||
(
|
# (
|
||||||
## We build a whole NixOS system that contains the module
|
# ## We build a whole NixOS system that contains the module
|
||||||
## `system.extraDependenciesFromModule`, only to grab its
|
# ## `system.extraDependenciesFromModule`, only to grab its
|
||||||
## configuration and the store paths needed to build it and
|
# ## configuration and the store paths needed to build it and
|
||||||
## dump them in `system.extraDependencies`.
|
# ## dump them in `system.extraDependencies`.
|
||||||
# see: https://git.fediversity.eu/Fediversity/Fediversity/pulls/338/files
|
# # see: https://git.fediversity.eu/Fediversity/Fediversity/pulls/338/files
|
||||||
|
|
||||||
pkgs.closureInfo {
|
# pkgs.closureInfo {
|
||||||
rootPaths = map (drv: drv.drvPath) (
|
# rootPaths = map (drv: drv.drvPath) (
|
||||||
[
|
# [
|
||||||
machine.system.build.toplevel.inputDerivation
|
# machine.system.build.toplevel.inputDerivation
|
||||||
machine.system.build.etc.inputDerivation
|
# machine.system.build.etc.inputDerivation
|
||||||
machine.system.build.etcBasedir.inputDerivation
|
# machine.system.build.etcBasedir.inputDerivation
|
||||||
machine.system.build.etcMetadataImage.inputDerivation
|
# machine.system.build.etcMetadataImage.inputDerivation
|
||||||
machine.system.build.extraUtils.inputDerivation
|
# machine.system.build.extraUtils.inputDerivation
|
||||||
machine.system.path.inputDerivation
|
# machine.system.path.inputDerivation
|
||||||
machine.system.build.setEnvironment.inputDerivation
|
# machine.system.build.setEnvironment.inputDerivation
|
||||||
machine.system.build.vm.inputDerivation
|
# machine.system.build.vm.inputDerivation
|
||||||
machine.system.build.bootStage1.inputDerivation
|
# machine.system.build.bootStage1.inputDerivation
|
||||||
machine.system.build.bootStage2.inputDerivation
|
# machine.system.build.bootStage2.inputDerivation
|
||||||
]
|
# ]
|
||||||
++ lib.concatMap (x: if x ? source.inputDerivation then [ x.source.inputDerivation ] else [ ]) (
|
# ++ lib.concatMap (x: if x ? source.inputDerivation then [ x.source.inputDerivation ] else [ ]) (
|
||||||
lib.attrValues machine.environment.etc
|
# lib.attrValues machine.environment.etc
|
||||||
)
|
# )
|
||||||
++ machine.environment.systemPackages
|
# ++ machine.environment.systemPackages
|
||||||
);
|
# );
|
||||||
}
|
# }
|
||||||
)
|
# )
|
||||||
|
|
||||||
]
|
]
|
||||||
++ lib.concatLists (
|
# ++ lib.concatLists (
|
||||||
lib.mapAttrsToList (
|
# lib.mapAttrsToList (
|
||||||
_k: v:
|
# _k: v:
|
||||||
if v ? source.inputDerivation then
|
# if v ? source.inputDerivation then
|
||||||
[
|
# [
|
||||||
# v.source.inputDerivation
|
# # v.source.inputDerivation
|
||||||
(
|
# (
|
||||||
(
|
# (
|
||||||
x:
|
# x:
|
||||||
builtins.trace "${builtins.toString (lib.attrNames v)}: ${builtins.toString (lib.isPath x.source.inputDerivation)}" x
|
# builtins.trace "${builtins.toString (lib.attrNames v)}: ${builtins.toString (lib.isPath x.source.inputDerivation)}" x
|
||||||
)
|
# )
|
||||||
v
|
# v
|
||||||
).source.inputDerivation
|
# ).source.inputDerivation
|
||||||
]
|
# ]
|
||||||
else
|
# else
|
||||||
[ ]
|
# [ ]
|
||||||
) machine.environment.etc
|
# ) machine.environment.etc
|
||||||
)
|
# )
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -485,7 +485,7 @@ let
|
||||||
vm-names = [ "test14" ];
|
vm-names = [ "test14" ];
|
||||||
vm_name = "test14";
|
vm_name = "test14";
|
||||||
in
|
in
|
||||||
pkgs.writers.writeBashBin "deploy-tf-proxmox.sh"
|
lib.trace (lib.strings.toJSON environment) pkgs.writers.writeBashBin "deploy-tf-proxmox.sh"
|
||||||
(withPackages [
|
(withPackages [
|
||||||
pkgs.jq
|
pkgs.jq
|
||||||
pkgs.qemu
|
pkgs.qemu
|
||||||
|
@ -493,8 +493,6 @@ let
|
||||||
pkgs.httpie
|
pkgs.httpie
|
||||||
(pkgs.callPackage ./run/tf-proxmox/tf.nix { inherit sources; })
|
(pkgs.callPackage ./run/tf-proxmox/tf.nix { inherit sources; })
|
||||||
])
|
])
|
||||||
lib.trace
|
|
||||||
(lib.strings.toJSON environment)
|
|
||||||
''
|
''
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
|
|
|
@ -43,12 +43,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment-model-bash-proxmox = import ./check/data-model-bash-proxmox {
|
deployment-model-bash-proxmox = import ./check/data-model-bash-proxmox {
|
||||||
inherit (pkgs.testers) runNixOSTest;
|
|
||||||
inherit inputs sources system;
|
inherit inputs sources system;
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment-model-tf-proxmox = import ./check/data-model-tf-proxmox {
|
deployment-model-tf-proxmox = import ./check/data-model-tf-proxmox {
|
||||||
inherit (pkgs.testers) runNixOSTest;
|
|
||||||
inherit inputs sources system;
|
inherit inputs sources system;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,6 +17,9 @@ locals {
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
endpoint = "https://${var.host}:8006/"
|
endpoint = "https://${var.host}:8006/"
|
||||||
insecure = true
|
insecure = true
|
||||||
|
# timeouts {
|
||||||
|
# create = "60m"
|
||||||
|
# }
|
||||||
|
|
||||||
ssh {
|
ssh {
|
||||||
agent = true
|
agent = true
|
||||||
|
@ -77,8 +80,8 @@ resource "proxmox_virtual_environment_file" "upload" {
|
||||||
# datastore_id = "backup"
|
# datastore_id = "backup"
|
||||||
node_name = var.node_name
|
node_name = var.node_name
|
||||||
overwrite = true
|
overwrite = true
|
||||||
# timeout_upload = 3600
|
timeout_upload = 3600
|
||||||
timeout_upload = 1
|
# timeout_upload = 1
|
||||||
|
|
||||||
source_file {
|
source_file {
|
||||||
# path = "/tmp/proxmox-image/${local.dump_name}"
|
# path = "/tmp/proxmox-image/${local.dump_name}"
|
||||||
|
|
|
@ -3,6 +3,7 @@ set -xeuo pipefail
|
||||||
declare tf_env
|
declare tf_env
|
||||||
|
|
||||||
export TF_LOG=info
|
export TF_LOG=info
|
||||||
|
# # on upload explodes RAM use + logs file content, causing timeout
|
||||||
# export TF_LOG=debug
|
# export TF_LOG=debug
|
||||||
|
|
||||||
cd "${tf_env}/deployment/run/tf-proxmox"
|
cd "${tf_env}/deployment/run/tf-proxmox"
|
||||||
|
|
|
@ -189,9 +189,9 @@
|
||||||
},
|
},
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"submodules": false,
|
"submodules": false,
|
||||||
"revision": "48f39fbe2e8f90f9ac160dd4b6929f3ac06d8223",
|
"revision": "ce8768f43b4374287cd8b88d8fa9c0061e749d9a",
|
||||||
"url": "https://github.com/SaumonNet/proxmox-nixos/archive/48f39fbe2e8f90f9ac160dd4b6929f3ac06d8223.tar.gz",
|
"url": "https://github.com/SaumonNet/proxmox-nixos/archive/ce8768f43b4374287cd8b88d8fa9c0061e749d9a.tar.gz",
|
||||||
"hash": "0606qcs8x1jwckd1ivf52rqdmi3lkn66iiqh6ghd4kqx0g2bw3nv"
|
"hash": "116zplxh64wxbq81wsfkmmssjs1l228kvhxfi9d434xd54k6vr35"
|
||||||
},
|
},
|
||||||
"terraform-provider-proxmox": {
|
"terraform-provider-proxmox": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
|
Loading…
Add table
Reference in a new issue