forked from fediversity/fediversity
Compare commits
129 commits
5cd02be848
...
098298a31c
| Author | SHA1 | Date | |
|---|---|---|---|
| 098298a31c | |||
| 43e4d3a497 | |||
| c209a1bdad | |||
| e0c6390ef5 | |||
| b5c3caa984 | |||
| 365fbc7c18 | |||
| d9b380d279 | |||
| 1496b51be5 | |||
| 5c32e73cb1 | |||
| c574eb3ba8 | |||
| 7b0db200c3 | |||
| 20ac7d6aff | |||
| 0cd7a523d0 | |||
| b242670cfc | |||
| a45d64bbf4 | |||
| 218330b676 | |||
| 9d4a3cbf75 | |||
| aaa49de5c0 | |||
| 71a979e5db | |||
| e86035bc52 | |||
| 4b2898f831 | |||
| 6cb8a38321 | |||
| 92b8535ff9 | |||
| e64684f906 | |||
| ea1f76fd40 | |||
| f13a9e18a7 | |||
| 53dc08f5e9 | |||
| 0b3e545c58 | |||
| b42d6887dd | |||
| 30f15835c1 | |||
| 7ee1422f2b | |||
| cf24255ab9 | |||
| eabd540910 | |||
| 09297b9b4e | |||
| 80570064a9 | |||
| c0e0aa1ee6 | |||
| 9ede4a41f8 | |||
| 5b4d811c75 | |||
| d2d61f3646 | |||
| 74743b00fd | |||
| f0f23f43fe | |||
| 9931269b17 | |||
| bd4b870556 | |||
| 0654205eda | |||
| a973c2589f | |||
| 1b9c99b2d3 | |||
| 0e17329e2c | |||
| be01af269d | |||
| c6cfe9eef9 | |||
| aea15084fd | |||
| ab67a6d637 | |||
| 892b18e23f | |||
| 37177ce993 | |||
| 186cdbd79e | |||
| 017bbf05b5 | |||
| 979747dd79 | |||
| 7bcc854ef1 | |||
| 28264801d7 | |||
| 56d8c4235b | |||
| f97db2802c | |||
| 1328e76fe9 | |||
| 1c52088125 | |||
| 3e0280c40e | |||
| 67e28644f2 | |||
| 35ff03c9f8 | |||
| c25a1727a9 | |||
| ea26048e58 | |||
| 811f5c3f84 | |||
| 89ced0cb82 | |||
| a6a3396211 | |||
| 6522ef8e67 | |||
| c1fe32f12a | |||
| 5b28788387 | |||
| 42c1cfd888 | |||
| 430754cf95 | |||
| 98bc0754cc | |||
| ca304932b6 | |||
| bfe0e51983 | |||
| 65863cd9e1 | |||
| 67fa4b2274 | |||
| 469b22fe4e | |||
| 0d0890cb17 | |||
| d35db3dcab | |||
| 3eb42e7991 | |||
| a40a23a3d7 | |||
| a758147b16 | |||
| 73630ffac6 | |||
| 4009d6c8e0 | |||
| b71d152b34 | |||
| 4a0aa7f0a6 | |||
| f5db4bd51e | |||
| 27d33141d2 | |||
| 6238b12f88 | |||
| f8a2d11c2f | |||
| f13348fb57 | |||
| 29d8345a57 | |||
| d2ee86a77c | |||
| e1a22437a0 | |||
| 9ebca54d50 | |||
| 09ef3ebbc7 | |||
| d73fa538c1 | |||
| d3a4137900 | |||
| 40fad454a7 | |||
| 6464cf61ec | |||
| 6c00f98801 | |||
| 98d8a91a80 | |||
| b5d2b2cb87 | |||
| b0b158050d | |||
| 6613959037 | |||
| d3a0d66fe6 | |||
| d051c9ffc6 | |||
| d76e0ddb98 | |||
| eb39b278a3 | |||
| 0758f6aa5b | |||
| 3c375da97c | |||
| a8a62f00cf | |||
| c5351e85ce | |||
| 03e564f3d8 | |||
| b89c7cbd3d | |||
| c9c8d8b457 | |||
| 4d0e549c6b | |||
| c4e06a5748 | |||
| 9bdfdf6ef7 | |||
| a6fdff0b18 | |||
| 14d7ce7214 | |||
| a97d658f1e | |||
| df9814f0f5 | |||
| 7f6aad0a58 | |||
| 0440758e28 |
41 changed files with 1449 additions and 39 deletions
|
|
@ -12,7 +12,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
_checks:
|
_checks:
|
||||||
needs: ["deployment-basic","deployment-cli","deployment-model-nixops4","deployment-model-ssh","deployment-model-tf","deployment-panel","nixops-deployment-providers-default","nixops-deployment-providers-fedi200","nixops-deployment-providers-fedi201","nixops-deployment-providers-forgejo-ci","nixops-deployment-providers-test","nixops-deployment-providers-vm02116","nixops-deployment-providers-vm02187","nixosConfigurations-fedi200","nixosConfigurations-fedi201","nixosConfigurations-forgejo-ci","nixosConfigurations-test01","nixosConfigurations-test02","nixosConfigurations-test03","nixosConfigurations-test04","nixosConfigurations-test05","nixosConfigurations-test06","nixosConfigurations-test11","nixosConfigurations-test12","nixosConfigurations-test13","nixosConfigurations-test14","nixosConfigurations-vm02116","nixosConfigurations-vm02187","panel","pre-commit","proxmox-basic","test-mastodon-service","test-peertube-service","vmOptions-fedi200","vmOptions-fedi201","vmOptions-test01","vmOptions-test02","vmOptions-test03","vmOptions-test04","vmOptions-test05","vmOptions-test06","vmOptions-test11","vmOptions-test12","vmOptions-test13","vmOptions-test14"]
|
needs: ["deployment-basic","deployment-cli","deployment-model-nixops4","deployment-model-ssh","deployment-model-tf","deployment-model-tf-proxmox","deployment-panel","nixops-deployment-providers-default","nixops-deployment-providers-fedi200","nixops-deployment-providers-fedi201","nixops-deployment-providers-forgejo-ci","nixops-deployment-providers-test","nixops-deployment-providers-vm02116","nixops-deployment-providers-vm02187","nixosConfigurations-fedi200","nixosConfigurations-fedi201","nixosConfigurations-forgejo-ci","nixosConfigurations-test01","nixosConfigurations-test02","nixosConfigurations-test03","nixosConfigurations-test04","nixosConfigurations-test05","nixosConfigurations-test06","nixosConfigurations-test11","nixosConfigurations-test12","nixosConfigurations-test13","nixosConfigurations-test14","nixosConfigurations-vm02116","nixosConfigurations-vm02187","panel","pre-commit","proxmox-basic","test-mastodon-service","test-peertube-service","vmOptions-fedi200","vmOptions-fedi201","vmOptions-test01","vmOptions-test02","vmOptions-test03","vmOptions-test04","vmOptions-test05","vmOptions-test06","vmOptions-test11","vmOptions-test12","vmOptions-test13","vmOptions-test14"]
|
||||||
runs-on: native
|
runs-on: native
|
||||||
steps:
|
steps:
|
||||||
- run: true
|
- run: true
|
||||||
|
|
@ -53,6 +53,12 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: nix build .#checks.x86_64-linux.deployment-model-tf -vL
|
- run: nix build .#checks.x86_64-linux.deployment-model-tf -vL
|
||||||
|
|
||||||
|
deployment-model-tf-proxmox:
|
||||||
|
runs-on: native
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: nix build .#checks.x86_64-linux.deployment-model-tf-proxmox -vL
|
||||||
|
|
||||||
deployment-panel:
|
deployment-panel:
|
||||||
runs-on: native
|
runs-on: native
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
runNixOSTest,
|
runNixOSTest,
|
||||||
inputs,
|
inputs,
|
||||||
sources,
|
sources,
|
||||||
|
|
@ -9,7 +10,10 @@ runNixOSTest {
|
||||||
../common/nixosTest.nix
|
../common/nixosTest.nix
|
||||||
./nixosTest.nix
|
./nixosTest.nix
|
||||||
];
|
];
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = {
|
||||||
|
inherit inputs sources;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
|
};
|
||||||
inherit (import ./constants.nix)
|
inherit (import ./constants.nix)
|
||||||
targetMachines
|
targetMachines
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
runNixOSTest,
|
runNixOSTest,
|
||||||
inputs,
|
inputs,
|
||||||
sources,
|
sources,
|
||||||
|
|
@ -9,7 +10,10 @@ runNixOSTest {
|
||||||
../common/nixosTest.nix
|
../common/nixosTest.nix
|
||||||
./nixosTest.nix
|
./nixosTest.nix
|
||||||
];
|
];
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = {
|
||||||
|
inherit inputs sources;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
|
};
|
||||||
inherit (import ./constants.nix)
|
inherit (import ./constants.nix)
|
||||||
targetMachines
|
targetMachines
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
|
modulesPath,
|
||||||
sources,
|
sources,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
@ -75,6 +76,7 @@ in
|
||||||
machine =
|
machine =
|
||||||
(pkgs.nixos [
|
(pkgs.nixos [
|
||||||
./targetNode.nix
|
./targetNode.nix
|
||||||
|
"${modulesPath}/../lib/testing/nixos-test-base.nix"
|
||||||
config.system.extraDependenciesFromModule
|
config.system.extraDependenciesFromModule
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
config,
|
config,
|
||||||
hostPkgs,
|
hostPkgs,
|
||||||
sources,
|
sources,
|
||||||
|
modulesPath,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
@ -112,7 +113,9 @@ in
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(genAttrs config.targetMachines (_: {
|
(genAttrs config.targetMachines (_: {
|
||||||
imports = [ ./targetNode.nix ];
|
imports = [
|
||||||
|
./targetNode.nix
|
||||||
|
] ++ (lib.optional config.useFlake "${modulesPath}/../lib/testing/nixos-test-base.nix");
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = { inherit inputs sources; };
|
||||||
enableAcme = config.enableAcme;
|
enableAcme = config.enableAcme;
|
||||||
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ in
|
||||||
_class = "nixos";
|
_class = "nixos";
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/profiles/qemu-guest.nix")
|
"${modulesPath}/profiles/minimal.nix"
|
||||||
(modulesPath + "/../lib/testing/nixos-test-base.nix")
|
"${modulesPath}/profiles/qemu-guest.nix"
|
||||||
./sharedOptions.nix
|
./sharedOptions.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -42,8 +42,8 @@ in
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
|
|
||||||
## Test VMs don't have a bootloader by default.
|
# Test VMs don't have a bootloader by default.
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = lib.mkDefault false;
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf config.enableAcme {
|
(mkIf config.enableAcme {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
sources,
|
sources,
|
||||||
|
modulesPath,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
@ -39,6 +40,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
./targetNode.nix
|
./targetNode.nix
|
||||||
(lib.modules.importJSON (config.pathToCwd + "/${config.nodeName}-network.json"))
|
(lib.modules.importJSON (config.pathToCwd + "/${config.nodeName}-network.json"))
|
||||||
|
"${modulesPath}/../lib/testing/nixos-test-base.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = { inherit inputs sources; };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
sources ? import ../../../npins,
|
modulesPath,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
../common/sharedOptions.nix
|
../common/sharedOptions.nix
|
||||||
../common/targetNode.nix
|
../common/targetNode.nix
|
||||||
"${sources.nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
|
"${modulesPath}/profiles/qemu-guest.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users = environment.config.resources."operator-environment".login-shell.apply {
|
users.users = environment.config.resources."operator-environment".login-shell.apply {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
system,
|
system,
|
||||||
|
modulesPath,
|
||||||
inputs,
|
inputs,
|
||||||
sources ? import ../../../npins,
|
sources ? import ../../../npins,
|
||||||
...
|
...
|
||||||
|
|
@ -9,7 +10,7 @@ let
|
||||||
inherit (sources) nixpkgs;
|
inherit (sources) nixpkgs;
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
inherit (pkgs.callPackage ../common/utils.nix { }) mkNixosConfiguration;
|
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
|
||||||
inherit (config)
|
inherit (config)
|
||||||
nodeName
|
nodeName
|
||||||
pathFromRoot
|
pathFromRoot
|
||||||
|
|
@ -17,7 +18,7 @@ let
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
(pkgs.callPackage ../../utils.nix { inherit inputs; }).evalModel (
|
(pkgs.callPackage ../../utils.nix { inherit inputs; }).evalModel (
|
||||||
{ config, ... }:
|
{ config, modulesPath, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../common/model.nix ];
|
imports = [ ../common/model.nix ];
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -41,7 +42,12 @@ in
|
||||||
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
||||||
../common/targetResource.nix
|
../common/targetResource.nix
|
||||||
];
|
];
|
||||||
nixos.module = mkNixosConfiguration environment required-resources;
|
nixos.module = {
|
||||||
|
imports = [
|
||||||
|
(mkNixosConfiguration environment required-resources)
|
||||||
|
"${modulesPath}/../lib/testing/nixos-test-base.nix"
|
||||||
|
];
|
||||||
|
};
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = { inherit inputs sources; };
|
||||||
inherit nodeName pathToRoot pathFromRoot;
|
inherit nodeName pathToRoot pathFromRoot;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
runNixOSTest,
|
runNixOSTest,
|
||||||
inputs,
|
inputs,
|
||||||
sources,
|
sources,
|
||||||
|
|
@ -11,7 +12,10 @@ runNixOSTest {
|
||||||
../common/nixosTest.nix
|
../common/nixosTest.nix
|
||||||
./nixosTest.nix
|
./nixosTest.nix
|
||||||
];
|
];
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = {
|
||||||
|
inherit inputs sources;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
|
};
|
||||||
inherit (import ./constants.nix)
|
inherit (import ./constants.nix)
|
||||||
targetMachines
|
targetMachines
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
outputs =
|
outputs =
|
||||||
inputs:
|
inputs:
|
||||||
import ./mkFlake.nix inputs (
|
import ./mkFlake.nix inputs (
|
||||||
{ inputs, ... }:
|
{ inputs, modulesPath, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
in
|
in
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
nixops4Deployments.check-deployment-model =
|
nixops4Deployments.check-deployment-model =
|
||||||
(import ./deployment/check/data-model-nixops4/data-model.nix {
|
(import ./deployment/check/data-model-nixops4/data-model.nix {
|
||||||
inherit system inputs;
|
inherit system inputs modulesPath;
|
||||||
config = {
|
config = {
|
||||||
inherit (import ./deployment/check/data-model-nixops4/constants.nix) pathToRoot pathFromRoot;
|
inherit (import ./deployment/check/data-model-nixops4/constants.nix) pathToRoot pathFromRoot;
|
||||||
nodeName = "nixops4";
|
nodeName = "nixops4";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
system,
|
system,
|
||||||
|
modulesPath,
|
||||||
sources ? import ../../../npins,
|
sources ? import ../../../npins,
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
|
|
@ -8,7 +9,7 @@ let
|
||||||
inherit (sources) nixpkgs;
|
inherit (sources) nixpkgs;
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
inherit (pkgs.callPackage ../common/utils.nix { }) mkNixosConfiguration;
|
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
|
||||||
inherit (config)
|
inherit (config)
|
||||||
nodeName
|
nodeName
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
@ -17,7 +18,7 @@ let
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
(pkgs.callPackage ../../utils.nix { }).evalModel (
|
(pkgs.callPackage ../../utils.nix { }).evalModel (
|
||||||
{ config, ... }:
|
{ config, modulesPath, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../common/model.nix ];
|
imports = [ ../common/model.nix ];
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -31,7 +32,12 @@ in
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
ssh-host = {
|
ssh-host = {
|
||||||
nixos-configuration = mkNixosConfiguration environment required-resources;
|
nixos-configuration = {
|
||||||
|
imports = [
|
||||||
|
(mkNixosConfiguration environment required-resources)
|
||||||
|
"${modulesPath}/../lib/testing/nixos-test-base.nix"
|
||||||
|
];
|
||||||
|
};
|
||||||
system = targetSystem;
|
system = targetSystem;
|
||||||
ssh = {
|
ssh = {
|
||||||
username = "root";
|
username = "root";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
runNixOSTest,
|
runNixOSTest,
|
||||||
inputs,
|
inputs,
|
||||||
sources,
|
sources,
|
||||||
|
|
@ -11,7 +12,10 @@ runNixOSTest {
|
||||||
../common/nixosTest.nix
|
../common/nixosTest.nix
|
||||||
./nixosTest.nix
|
./nixosTest.nix
|
||||||
];
|
];
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = {
|
||||||
|
inherit inputs sources;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
|
};
|
||||||
inherit (import ./constants.nix)
|
inherit (import ./constants.nix)
|
||||||
targetMachines
|
targetMachines
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -8,7 +9,7 @@ let
|
||||||
nodeName = "ssh";
|
nodeName = "ssh";
|
||||||
deploy =
|
deploy =
|
||||||
(import ./data-model.nix {
|
(import ./data-model.nix {
|
||||||
inherit system;
|
inherit system modulesPath;
|
||||||
config = {
|
config = {
|
||||||
inherit nodeName;
|
inherit nodeName;
|
||||||
inherit (import ./constants.nix) pathToRoot;
|
inherit (import ./constants.nix) pathToRoot;
|
||||||
|
|
|
||||||
10
deployment/check/data-model-tf-proxmox/constants.nix
Normal file
10
deployment/check/data-model-tf-proxmox/constants.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
targetMachines = [
|
||||||
|
"pve"
|
||||||
|
];
|
||||||
|
pathToRoot = builtins.path {
|
||||||
|
path = ../../..;
|
||||||
|
name = "root";
|
||||||
|
};
|
||||||
|
pathFromRoot = "/deployment/check/data-model-tf-proxmox";
|
||||||
|
}
|
||||||
54
deployment/check/data-model-tf-proxmox/default.nix
Normal file
54
deployment/check/data-model-tf-proxmox/default.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
sources,
|
||||||
|
system,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
pkgs = import sources.nixpkgs-stable {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ overlay ];
|
||||||
|
};
|
||||||
|
overlay = _: prev: {
|
||||||
|
terraform-backend =
|
||||||
|
prev.callPackage "${sources.nixpkgs-unstable}/pkgs/by-name/te/terraform-backend/package.nix"
|
||||||
|
{ };
|
||||||
|
inherit
|
||||||
|
(import "${sources.proxmox-nixos}/pkgs" {
|
||||||
|
craneLib = pkgs.callPackage "${sources.crane}/lib" { };
|
||||||
|
# breaks from https://github.com/NixOS/nixpkgs/commit/06b354eb2dc535c57e9b4caaa16d79168f117a26,
|
||||||
|
# which updates libvncserver to 0.9.15, which was not yet patched at https://git.proxmox.com/?p=vncterm.git.
|
||||||
|
inherit pkgs;
|
||||||
|
# not so picky about version for our purposes
|
||||||
|
pkgs-unstable = pkgs;
|
||||||
|
})
|
||||||
|
proxmox-ve
|
||||||
|
pve-manager
|
||||||
|
pve-ha-manager
|
||||||
|
pve-qemu
|
||||||
|
;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.testers.runNixOSTest {
|
||||||
|
node.specialArgs = {
|
||||||
|
inherit
|
||||||
|
sources
|
||||||
|
pkgs
|
||||||
|
;
|
||||||
|
};
|
||||||
|
imports = [
|
||||||
|
../../data-model.nix
|
||||||
|
../../function.nix
|
||||||
|
../common/nixosTest.nix
|
||||||
|
./nixosTest.nix
|
||||||
|
];
|
||||||
|
_module.args = {
|
||||||
|
inherit inputs sources;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
|
};
|
||||||
|
inherit (import ./constants.nix)
|
||||||
|
targetMachines
|
||||||
|
pathToRoot
|
||||||
|
pathFromRoot
|
||||||
|
;
|
||||||
|
}
|
||||||
253
deployment/check/data-model-tf-proxmox/nixosTest.nix
Normal file
253
deployment/check/data-model-tf-proxmox/nixosTest.nix
Normal file
|
|
@ -0,0 +1,253 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
sources,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (pkgs) system;
|
||||||
|
backendPort = builtins.toString 8080;
|
||||||
|
tfBackend = fragment: rec {
|
||||||
|
TF_HTTP_USERNAME = "basic";
|
||||||
|
TF_HTTP_PASSWORD = "fake-secret";
|
||||||
|
TF_HTTP_LOCK_ADDRESS = TF_HTTP_ADDRESS;
|
||||||
|
TF_HTTP_UNLOCK_ADDRESS = TF_HTTP_ADDRESS;
|
||||||
|
TF_HTTP_ADDRESS = "http://localhost:${backendPort}/state/${fragment}";
|
||||||
|
};
|
||||||
|
# FIXME generate the image `nixos-generate` was to make, but now do it for a desired `-c configuration.nix` rather than whatever generic thing now
|
||||||
|
template-deployment =
|
||||||
|
(import ./setups/template.nix {
|
||||||
|
inherit sources system modulesPath;
|
||||||
|
config = {
|
||||||
|
httpBackend = tfBackend "proxmox-test/upload";
|
||||||
|
nodeName = "pve";
|
||||||
|
targetSystem = system;
|
||||||
|
node-name = "pve";
|
||||||
|
imageDatastoreId = "local";
|
||||||
|
};
|
||||||
|
}).default.tf-proxmox-template;
|
||||||
|
vm-deployment =
|
||||||
|
(import ./setups/vm.nix {
|
||||||
|
inherit sources system modulesPath;
|
||||||
|
config = {
|
||||||
|
httpBackend = tfBackend "proxmox-test/nixos";
|
||||||
|
inherit (import ./constants.nix) pathToRoot;
|
||||||
|
nodeName = "pve";
|
||||||
|
targetSystem = system;
|
||||||
|
sshOpts = [
|
||||||
|
"ProxyCommand=ssh -W %h:%p pve"
|
||||||
|
];
|
||||||
|
key-file = "/root/.ssh/id_ed25519";
|
||||||
|
node-name = "pve";
|
||||||
|
bridge = "br0";
|
||||||
|
vlanId = 0;
|
||||||
|
imageDatastoreId = "local";
|
||||||
|
vmDatastoreId = "local";
|
||||||
|
cdDatastoreId = "local";
|
||||||
|
ipv4Gateway = "192.168.10.1";
|
||||||
|
ipv4Address = "192.168.10.236/24";
|
||||||
|
ipv6Gateway = "";
|
||||||
|
ipv6Address = "";
|
||||||
|
# dynamically get the id from the template upload step
|
||||||
|
templateId = null;
|
||||||
|
};
|
||||||
|
}).default.tf-proxmox-vm;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
_class = "nixosTest";
|
||||||
|
name = "deployment-model";
|
||||||
|
sourceFileset = lib.fileset.unions [
|
||||||
|
../../run/tf-proxmox-template/run.sh
|
||||||
|
../../run/tf-proxmox-vm/run.sh
|
||||||
|
../../run/tf-proxmox-vm/await-ssh.sh
|
||||||
|
];
|
||||||
|
|
||||||
|
nodes.pve =
|
||||||
|
{ sources, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
"${sources.proxmox-nixos}/modules/proxmox-ve"
|
||||||
|
];
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.jq
|
||||||
|
pkgs.qemu
|
||||||
|
];
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
networking.vlans = {
|
||||||
|
vlan0 = {
|
||||||
|
id = 0;
|
||||||
|
interface = "eth0";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
networking.useDHCP = false;
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
bridges.br0.interfaces = [ ];
|
||||||
|
interfaces.br0.ipv4.addresses = [
|
||||||
|
{
|
||||||
|
address = "192.168.10.1";
|
||||||
|
prefixLength = 24;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
nat = {
|
||||||
|
enable = true;
|
||||||
|
internalInterfaces = [ "br0" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
boot.kernel.sysctl."net.ipv4.ip_forward" = "1";
|
||||||
|
|
||||||
|
users.users.root = {
|
||||||
|
password = "mytestpw";
|
||||||
|
hashedPasswordFile = lib.mkForce null;
|
||||||
|
};
|
||||||
|
# https://github.com/SaumonNet/proxmox-nixos/blob/main/modules/proxmox-ve/default.nix
|
||||||
|
services.proxmox-ve = {
|
||||||
|
enable = true;
|
||||||
|
ipAddress = "192.168.1.1";
|
||||||
|
};
|
||||||
|
virtualisation = {
|
||||||
|
diskSize = 5 * 1024;
|
||||||
|
memorySize = 3 * 1024;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.deployer =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../modules/terraform-backend
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
nix.nixPath = [
|
||||||
|
(lib.concatStringsSep ":" (lib.mapAttrsToList (k: v: k + "=" + v) sources))
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
vm-deployment.run
|
||||||
|
template-deployment.run
|
||||||
|
pkgs.pve-manager
|
||||||
|
pkgs.openssl
|
||||||
|
pkgs.jq
|
||||||
|
(pkgs.callPackage ../../run/tf-proxmox-template/tf.nix { })
|
||||||
|
(pkgs.callPackage ../../run/tf-proxmox-vm/tf.nix { })
|
||||||
|
];
|
||||||
|
|
||||||
|
# needed only when building from deployer
|
||||||
|
system.extraDependenciesFromModule =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
hello
|
||||||
|
];
|
||||||
|
};
|
||||||
|
system.extraDependencies = [
|
||||||
|
sources.disko
|
||||||
|
pkgs.ubootQemuX86
|
||||||
|
pkgs.ubootQemuX86.inputDerivation
|
||||||
|
pkgs.pve-qemu
|
||||||
|
pkgs.pve-qemu.inputDerivation
|
||||||
|
pkgs.gnu-config
|
||||||
|
pkgs.byacc
|
||||||
|
pkgs.stdenv
|
||||||
|
pkgs.stdenvNoCC
|
||||||
|
sources.nixpkgs
|
||||||
|
pkgs.vte
|
||||||
|
];
|
||||||
|
services.terraform-backend = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
LISTEN_ADDR = ":${backendPort}";
|
||||||
|
KMS_KEY = "tsjxw9NjKUBUlzbTnD7orqIAdEmpGYRARvxD51jtY+o=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
extraTestScript = ''
|
||||||
|
pve.wait_for_unit("pveproxy.service")
|
||||||
|
assert "running" in pve.succeed("pveproxy status")
|
||||||
|
pve.succeed("mkdir -p /run/pve")
|
||||||
|
assert "Proxmox" in pve.succeed("curl -s -i -k https://localhost:8006")
|
||||||
|
|
||||||
|
cert = pve.succeed("cat /etc/pve/pve-root-ca.pem").strip()
|
||||||
|
|
||||||
|
# set up proxmox
|
||||||
|
pve.succeed("""
|
||||||
|
pvesh create /pools --poolid Fediversity
|
||||||
|
pvesh set /storage/local --content "vztmpl,rootdir,backup,snippets,import,iso,images" 1>/dev/null
|
||||||
|
""")
|
||||||
|
|
||||||
|
template_token = pve.succeed("""
|
||||||
|
pvesh create /access/users/root@pam/token/template --output-format json | jq -r .value
|
||||||
|
pvesh set /access/acl --path "/" --token "root@pam!template" --roles "PVEDatastoreAdmin"
|
||||||
|
""").strip()
|
||||||
|
|
||||||
|
vm_token = pve.succeed("""
|
||||||
|
pvesh create /access/users/root@pam/token/vm --output-format json | jq -r .value
|
||||||
|
pvesh set /access/acl --path "/" --token "root@pam!vm" --roles "PVEVMAdmin PVEDatastoreAdmin PVESDNUser"
|
||||||
|
""").strip()
|
||||||
|
|
||||||
|
# skip indent for EOF
|
||||||
|
deployer.succeed(f"""
|
||||||
|
cat > /etc/ssl/certs/pve-root-ca.pem <<EOF
|
||||||
|
{cert}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
mkdir -p /root/.ssh
|
||||||
|
cat > /root/.ssh/id_ed25519 <<EOF
|
||||||
|
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||||
|
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||||
|
QyNTUxOQAAACBWbJXVjBLGo2MrI2LBKTbzDozuA/C9taU630EtU/h38gAAAJDAOy8uwDsv
|
||||||
|
LgAAAAtzc2gtZWQyNTUxOQAAACBWbJXVjBLGo2MrI2LBKTbzDozuA/C9taU630EtU/h38g
|
||||||
|
AAAECcF8xjLavgWePoVx45Euewsh6Kw07L6QDDy3WXFCn4bFZsldWMEsajYysjYsEpNvMO
|
||||||
|
jO4D8L21pTrfQS1T+HfyAAAAC2tpYXJhQG5peG9zAQI=
|
||||||
|
-----END OPENSSH PRIVATE KEY-----
|
||||||
|
EOF
|
||||||
|
chmod 600 /root/.ssh/id_ed25519
|
||||||
|
""")
|
||||||
|
|
||||||
|
deployer.succeed("""
|
||||||
|
set -e
|
||||||
|
cd /etc/ssl/certs
|
||||||
|
{ cat ca-bundle.crt
|
||||||
|
cat ca-certificates.crt
|
||||||
|
cat pve-root-ca.pem
|
||||||
|
} > new-ca-bundle.crt
|
||||||
|
rm ca-bundle.crt ca-certificates.crt
|
||||||
|
mv new-ca-bundle.crt ca-bundle.crt
|
||||||
|
ln -s ca-bundle.crt ca-certificates.crt
|
||||||
|
openssl verify -CApath /etc/ssl/certs ./pve-root-ca.pem
|
||||||
|
""")
|
||||||
|
|
||||||
|
with subtest("Deploy the template"):
|
||||||
|
template_id = deployer.succeed(f"""
|
||||||
|
ssh -o BatchMode=yes -o StrictHostKeyChecking=no pve "true"
|
||||||
|
export PROXMOX_VE_INSECURE="true"
|
||||||
|
export SSL_CERT_FILE=/tmp/pve-ca-bundle.crt
|
||||||
|
export PROXMOX_VE_API_TOKEN="root@pam!template={template_token}"
|
||||||
|
${lib.getExe template-deployment.run} | jq -r '.id.value'
|
||||||
|
""").strip()
|
||||||
|
|
||||||
|
deploy = f"""
|
||||||
|
set -e
|
||||||
|
ssh -o BatchMode=yes -o StrictHostKeyChecking=no pve "true"
|
||||||
|
export PROXMOX_VE_INSECURE="true"
|
||||||
|
export SSL_CERT_FILE=/tmp/pve-ca-bundle.crt
|
||||||
|
export PROXMOX_VE_API_TOKEN="root@pam!vm={vm_token}"
|
||||||
|
export TF_VAR_template_id="{template_id}"
|
||||||
|
${lib.getExe vm-deployment.run} | jq -r '.ipv4.value[0]'
|
||||||
|
"""
|
||||||
|
|
||||||
|
with subtest("Run the deployment"):
|
||||||
|
ip = deployer.succeed(deploy).strip()
|
||||||
|
|
||||||
|
with subtest("Verify package"):
|
||||||
|
deployer.succeed(f"""
|
||||||
|
ssh -i "/root/.ssh/id_ed25519" -o StrictHostKeyChecking=no -o BatchMode=yes -J pve root@{ip} su - operator -c hello >&2
|
||||||
|
""")
|
||||||
|
|
||||||
|
with subtest("No-op update"):
|
||||||
|
deployer.succeed(deploy, timeout=120)
|
||||||
|
'';
|
||||||
|
}
|
||||||
67
deployment/check/data-model-tf-proxmox/setups/shared.nix
Normal file
67
deployment/check/data-model-tf-proxmox/setups/shared.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
sources ? import ../../../../npins,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
"${sources.disko}/module.nix"
|
||||||
|
../../../../infra/common/proxmox-qemu-vm.nix
|
||||||
|
];
|
||||||
|
networking.useDHCP = false;
|
||||||
|
services.qemuGuest.enable = true;
|
||||||
|
services.openssh.enable = true;
|
||||||
|
services.cloud-init = {
|
||||||
|
enable = true;
|
||||||
|
network.enable = true;
|
||||||
|
};
|
||||||
|
users.users.root.openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFZsldWMEsajYysjYsEpNvMOjO4D8L21pTrfQS1T+Hfy"
|
||||||
|
];
|
||||||
|
boot.loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi = {
|
||||||
|
canTouchEfiVariables = true;
|
||||||
|
efiSysMountPoint = "/boot";
|
||||||
|
};
|
||||||
|
grub.enable = false;
|
||||||
|
};
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
fsType = "vfat";
|
||||||
|
device = lib.mkDefault "/dev/sda1";
|
||||||
|
options = [
|
||||||
|
"fmask=0022"
|
||||||
|
"dmask=0022"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
disko.devices.disk.main = {
|
||||||
|
device = "/dev/sda";
|
||||||
|
type = "disk";
|
||||||
|
imageSize = "20G"; # needed for image generation
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
esp = {
|
||||||
|
priority = 1;
|
||||||
|
size = "500M";
|
||||||
|
type = "EF00";
|
||||||
|
label = "boot";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
priority = 2;
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
69
deployment/check/data-model-tf-proxmox/setups/template.nix
Normal file
69
deployment/check/data-model-tf-proxmox/setups/template.nix
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
system,
|
||||||
|
modulesPath,
|
||||||
|
sources ? import ../../../../npins,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (sources) nixpkgs;
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
|
||||||
|
inherit (config)
|
||||||
|
nodeName
|
||||||
|
targetSystem
|
||||||
|
httpBackend
|
||||||
|
node-name
|
||||||
|
imageDatastoreId
|
||||||
|
;
|
||||||
|
in
|
||||||
|
(pkgs.callPackage ../../../utils.nix { }).evalModel (
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
imports = [ ../../common/model.nix ];
|
||||||
|
config = {
|
||||||
|
environments.default = environment: {
|
||||||
|
resources."operator-environment".login-shell = {
|
||||||
|
wheel = true;
|
||||||
|
username = "operator";
|
||||||
|
};
|
||||||
|
implementation =
|
||||||
|
{
|
||||||
|
required-resources,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
tf-proxmox-template = {
|
||||||
|
nixos-configuration = {
|
||||||
|
imports = [
|
||||||
|
(mkNixosConfiguration environment required-resources)
|
||||||
|
./shared.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
system = targetSystem;
|
||||||
|
ssh = {
|
||||||
|
host = nodeName;
|
||||||
|
};
|
||||||
|
inherit
|
||||||
|
node-name
|
||||||
|
httpBackend
|
||||||
|
imageDatastoreId
|
||||||
|
;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
options.default =
|
||||||
|
let
|
||||||
|
env = config.environments.default;
|
||||||
|
in
|
||||||
|
lib.mkOption {
|
||||||
|
type = env.resource-mapping.output-type;
|
||||||
|
default = env.deployment {
|
||||||
|
deployment-name = "default";
|
||||||
|
configuration = config."example-configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
96
deployment/check/data-model-tf-proxmox/setups/vm.nix
Normal file
96
deployment/check/data-model-tf-proxmox/setups/vm.nix
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
system,
|
||||||
|
modulesPath,
|
||||||
|
sources ? import ../../../../npins,
|
||||||
|
...
|
||||||
|
}@args:
|
||||||
|
let
|
||||||
|
inherit (sources) nixpkgs;
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
|
||||||
|
inherit (config)
|
||||||
|
nodeName
|
||||||
|
pathToRoot
|
||||||
|
targetSystem
|
||||||
|
sshOpts
|
||||||
|
httpBackend
|
||||||
|
key-file
|
||||||
|
node-name
|
||||||
|
bridge
|
||||||
|
vlanId
|
||||||
|
templateId
|
||||||
|
imageDatastoreId
|
||||||
|
vmDatastoreId
|
||||||
|
cdDatastoreId
|
||||||
|
ipv4Gateway
|
||||||
|
ipv4Address
|
||||||
|
ipv6Gateway
|
||||||
|
ipv6Address
|
||||||
|
;
|
||||||
|
in
|
||||||
|
(pkgs.callPackage ../../../utils.nix { }).evalModel (
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
imports = [ ../../common/model.nix ];
|
||||||
|
config = {
|
||||||
|
environments.default = environment: {
|
||||||
|
resources."operator-environment".login-shell = {
|
||||||
|
wheel = true;
|
||||||
|
username = "operator";
|
||||||
|
};
|
||||||
|
implementation =
|
||||||
|
{
|
||||||
|
required-resources,
|
||||||
|
deployment-name,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
tf-proxmox-vm = {
|
||||||
|
nixos-configuration = {
|
||||||
|
imports = [
|
||||||
|
(mkNixosConfiguration environment required-resources)
|
||||||
|
./shared.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
system = targetSystem;
|
||||||
|
ssh = {
|
||||||
|
username = "root";
|
||||||
|
host = nodeName;
|
||||||
|
inherit key-file sshOpts;
|
||||||
|
};
|
||||||
|
caller = "deployment/check/data-model-tf-proxmox/setups/vm.nix";
|
||||||
|
inherit
|
||||||
|
args
|
||||||
|
deployment-name
|
||||||
|
httpBackend
|
||||||
|
node-name
|
||||||
|
bridge
|
||||||
|
vlanId
|
||||||
|
templateId
|
||||||
|
imageDatastoreId
|
||||||
|
vmDatastoreId
|
||||||
|
cdDatastoreId
|
||||||
|
ipv4Gateway
|
||||||
|
ipv4Address
|
||||||
|
ipv6Gateway
|
||||||
|
ipv6Address
|
||||||
|
;
|
||||||
|
root-path = pathToRoot;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
options.default =
|
||||||
|
let
|
||||||
|
env = config.environments.default;
|
||||||
|
in
|
||||||
|
lib.mkOption {
|
||||||
|
type = env.resource-mapping.output-type;
|
||||||
|
default = env.deployment {
|
||||||
|
deployment-name = "default";
|
||||||
|
configuration = config."example-configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
@ -2,13 +2,14 @@
|
||||||
config,
|
config,
|
||||||
system,
|
system,
|
||||||
sources ? import ../../../npins,
|
sources ? import ../../../npins,
|
||||||
|
modulesPath,
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
let
|
let
|
||||||
inherit (sources) nixpkgs;
|
inherit (sources) nixpkgs;
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
inherit (pkgs.callPackage ../common/utils.nix { }) mkNixosConfiguration;
|
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
|
||||||
inherit (config)
|
inherit (config)
|
||||||
nodeName
|
nodeName
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
@ -18,7 +19,7 @@ let
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
(pkgs.callPackage ../../utils.nix { }).evalModel (
|
(pkgs.callPackage ../../utils.nix { }).evalModel (
|
||||||
{ config, ... }:
|
{ config, modulesPath, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../common/model.nix ];
|
imports = [ ../common/model.nix ];
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -31,7 +32,12 @@ in
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
tf-host = {
|
tf-host = {
|
||||||
nixos-configuration = mkNixosConfiguration environment required-resources;
|
nixos-configuration = {
|
||||||
|
imports = [
|
||||||
|
(mkNixosConfiguration environment required-resources)
|
||||||
|
"${modulesPath}/../lib/testing/nixos-test-base.nix"
|
||||||
|
];
|
||||||
|
};
|
||||||
system = targetSystem;
|
system = targetSystem;
|
||||||
ssh = {
|
ssh = {
|
||||||
username = "root";
|
username = "root";
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,10 @@ pkgs.testers.runNixOSTest {
|
||||||
../common/nixosTest.nix
|
../common/nixosTest.nix
|
||||||
./nixosTest.nix
|
./nixosTest.nix
|
||||||
];
|
];
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = {
|
||||||
|
inherit inputs sources;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
|
};
|
||||||
inherit (import ./constants.nix)
|
inherit (import ./constants.nix)
|
||||||
targetMachines
|
targetMachines
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
sources,
|
sources,
|
||||||
|
modulesPath,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -11,7 +12,7 @@ let
|
||||||
backendPort = builtins.toString 8080;
|
backendPort = builtins.toString 8080;
|
||||||
deploy =
|
deploy =
|
||||||
(import ./data-model.nix {
|
(import ./data-model.nix {
|
||||||
inherit system;
|
inherit system modulesPath;
|
||||||
config = {
|
config = {
|
||||||
inherit nodeName pathToRoot;
|
inherit nodeName pathToRoot;
|
||||||
targetSystem = system;
|
targetSystem = system;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
runNixOSTest,
|
runNixOSTest,
|
||||||
inputs,
|
inputs,
|
||||||
sources,
|
sources,
|
||||||
|
|
@ -9,7 +10,10 @@ runNixOSTest {
|
||||||
../common/nixosTest.nix
|
../common/nixosTest.nix
|
||||||
./nixosTest.nix
|
./nixosTest.nix
|
||||||
];
|
];
|
||||||
_module.args = { inherit inputs sources; };
|
_module.args = {
|
||||||
|
inherit inputs sources;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
|
};
|
||||||
inherit (import ./constants.nix)
|
inherit (import ./constants.nix)
|
||||||
targetMachines
|
targetMachines
|
||||||
pathToRoot
|
pathToRoot
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ runNixOSTest {
|
||||||
sources
|
sources
|
||||||
pkgs
|
pkgs
|
||||||
;
|
;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
};
|
};
|
||||||
imports = [
|
imports = [
|
||||||
./proxmoxTest.nix
|
./proxmoxTest.nix
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
inputs,
|
inputs,
|
||||||
|
sources ? import ../npins,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -283,6 +284,290 @@ let
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
tf-proxmox-template = mkOption {
|
||||||
|
description = ''
|
||||||
|
A Terraform deployment to upload a virtual machine template to ProxmoX VE.
|
||||||
|
Proxmox credentials should be set using [environment variables]
|
||||||
|
(https://registry.terraform.io/providers/bpg/proxmox/latest/docs#environment-variables-summary)
|
||||||
|
with role `PVEDatastoreAdmin`.
|
||||||
|
'';
|
||||||
|
type = submodule (tf-host: {
|
||||||
|
options = {
|
||||||
|
system = mkOption {
|
||||||
|
description = "The architecture of the system to deploy to.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
inherit nixos-configuration;
|
||||||
|
ssh = host-ssh;
|
||||||
|
node-name = mkOption {
|
||||||
|
description = "the name of the ProxmoX node to use.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
httpBackend = mkOption {
|
||||||
|
description = "environment variables to configure the TF HTTP back-end, see <https://developer.hashicorp.com/terraform/language/backend/http#configuration-variables>";
|
||||||
|
type = types.attrsOf (types.either types.str types.int);
|
||||||
|
};
|
||||||
|
imageDatastoreId = mkOption {
|
||||||
|
description = "ID of the datastore of the image.";
|
||||||
|
type = types.str;
|
||||||
|
default = "local";
|
||||||
|
};
|
||||||
|
run = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
# error: The option `tf-deployment.tf-host.run' is read-only, but it's set multiple times.
|
||||||
|
# readOnly = true;
|
||||||
|
default =
|
||||||
|
let
|
||||||
|
inherit (tf-host.config)
|
||||||
|
system
|
||||||
|
ssh
|
||||||
|
httpBackend
|
||||||
|
node-name
|
||||||
|
imageDatastoreId
|
||||||
|
;
|
||||||
|
inherit (ssh)
|
||||||
|
host
|
||||||
|
;
|
||||||
|
machine = import ./nixos.nix {
|
||||||
|
inherit sources system;
|
||||||
|
configuration = tf-host.config.nixos-configuration;
|
||||||
|
};
|
||||||
|
name = "monkey";
|
||||||
|
|
||||||
|
# worse for cross-compilation, better for pre-/post-processing, needs manual `imageSize`, random failures: https://github.com/nix-community/disko/issues/550#issuecomment-2503736973
|
||||||
|
raw = "${machine.config.system.build.diskoImages}/main.raw";
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
inherit
|
||||||
|
host
|
||||||
|
;
|
||||||
|
node_name = node-name;
|
||||||
|
image_datastore_id = imageDatastoreId;
|
||||||
|
};
|
||||||
|
tf-env = pkgs.callPackage ./run/tf-env.nix {
|
||||||
|
inherit httpBackend;
|
||||||
|
tfPackage = pkgs.callPackage ./run/tf-proxmox-template/tf.nix { };
|
||||||
|
tfDirs = [
|
||||||
|
"deployment/run/tf-proxmox-template"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.trace (lib.strings.toJSON environment) pkgs.writers.writeBashBin "deploy-tf-proxmox-template.sh"
|
||||||
|
(withPackages [
|
||||||
|
pkgs.jq
|
||||||
|
pkgs.qemu
|
||||||
|
(pkgs.callPackage ./run/tf-proxmox-vm/tf.nix { })
|
||||||
|
])
|
||||||
|
''
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# nixos-generate gives the burden of building revisions, while systemd-repart handles partitioning ~~at the burden of version revisions~~
|
||||||
|
# .qcow2 is around half the size of .raw, on top of supporting backups - be it apparently at the cost of performance
|
||||||
|
qemu-img convert -f raw -O qcow2 -C "${raw}" /tmp/${name}.qcow2
|
||||||
|
|
||||||
|
ls -l ${raw} >&2
|
||||||
|
ls -l /tmp/${name}.qcow2 >&2
|
||||||
|
|
||||||
|
env ${toString (lib.mapAttrsToList (k: v: "TF_VAR_${k}=\"${toBash v}\"") environment)} \
|
||||||
|
${toString (lib.mapAttrsToList (k: v: "${k}=\"${toBash v}\"") httpBackend)} \
|
||||||
|
TF_VAR_image=/tmp/${name}.qcow2 \
|
||||||
|
tf_env=${tf-env} bash ./deployment/run/tf-proxmox-template/run.sh
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
tf-proxmox-vm = mkOption {
|
||||||
|
description = ''
|
||||||
|
A Terraform deployment to provision and update a virtual machine on ProxmoX VE.
|
||||||
|
Proxmox credentials should be set using [environment variables]
|
||||||
|
(https://registry.terraform.io/providers/bpg/proxmox/latest/docs#environment-variables-summary)
|
||||||
|
with roles `PVEVMAdmin PVEDatastoreAdmin PVESDNUser`.
|
||||||
|
'';
|
||||||
|
type = submodule (tf-host: {
|
||||||
|
options = {
|
||||||
|
system = mkOption {
|
||||||
|
description = "The architecture of the system to deploy to.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
inherit nixos-configuration;
|
||||||
|
ssh = host-ssh;
|
||||||
|
caller = mkOption {
|
||||||
|
description = "The calling module to obtain the NixOS configuration from.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
args = mkOption {
|
||||||
|
description = "The arguments with which to call the module to obtain the NixOS configuration.";
|
||||||
|
type = types.attrs;
|
||||||
|
};
|
||||||
|
deployment-name = mkOption {
|
||||||
|
description = "The name of the deployment for which to obtain the NixOS configuration.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
root-path = mkOption {
|
||||||
|
description = "The path to the root of the repository.";
|
||||||
|
type = types.path;
|
||||||
|
};
|
||||||
|
node-name = mkOption {
|
||||||
|
description = "the name of the ProxmoX node to use.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
httpBackend = mkOption {
|
||||||
|
description = "environment variables to configure the TF HTTP back-end, see <https://developer.hashicorp.com/terraform/language/backend/http#configuration-variables>";
|
||||||
|
type = types.attrsOf (types.either types.str types.int);
|
||||||
|
};
|
||||||
|
bridge = mkOption {
|
||||||
|
description = "The name of the network bridge (defaults to vmbr0).";
|
||||||
|
type = types.str;
|
||||||
|
default = "vmbr0";
|
||||||
|
};
|
||||||
|
vlanId = mkOption {
|
||||||
|
description = "The VLAN identifier.";
|
||||||
|
type = types.int;
|
||||||
|
default = 0;
|
||||||
|
};
|
||||||
|
imageDatastoreId = mkOption {
|
||||||
|
description = "ID of the datastore of the image.";
|
||||||
|
type = types.str;
|
||||||
|
default = "local";
|
||||||
|
};
|
||||||
|
templateId = mkOption {
|
||||||
|
description = "ID of the template file from which to clone the VM.";
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
example = "local:import/template.qcow2";
|
||||||
|
};
|
||||||
|
vmDatastoreId = mkOption {
|
||||||
|
description = "ID of the datastore of the VM.";
|
||||||
|
type = types.str;
|
||||||
|
default = "local";
|
||||||
|
};
|
||||||
|
cdDatastoreId = mkOption {
|
||||||
|
description = "ID of the datastore of the virtual CD-rom drive to use for cloud-init.";
|
||||||
|
type = types.str;
|
||||||
|
default = "local";
|
||||||
|
};
|
||||||
|
ipv4Gateway = mkOption {
|
||||||
|
description = "Gateway for IPv4.";
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
ipv4Address = mkOption {
|
||||||
|
description = "IPv4 address.";
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
ipv6Gateway = mkOption {
|
||||||
|
description = "Gateway for IPv6.";
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
ipv6Address = mkOption {
|
||||||
|
description = "IPv6 address.";
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
run = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
# error: The option `tf-deployment.tf-host.run' is read-only, but it's set multiple times.
|
||||||
|
# readOnly = true;
|
||||||
|
default =
|
||||||
|
let
|
||||||
|
inherit (tf-host.config)
|
||||||
|
system
|
||||||
|
ssh
|
||||||
|
caller
|
||||||
|
args
|
||||||
|
deployment-name
|
||||||
|
httpBackend
|
||||||
|
root-path
|
||||||
|
node-name
|
||||||
|
bridge
|
||||||
|
vlanId
|
||||||
|
imageDatastoreId
|
||||||
|
templateId
|
||||||
|
vmDatastoreId
|
||||||
|
cdDatastoreId
|
||||||
|
ipv4Gateway
|
||||||
|
ipv4Address
|
||||||
|
ipv6Gateway
|
||||||
|
ipv6Address
|
||||||
|
;
|
||||||
|
inherit (ssh)
|
||||||
|
host
|
||||||
|
username
|
||||||
|
key-file
|
||||||
|
sshOpts
|
||||||
|
;
|
||||||
|
deployment-type = "tf-proxmox-vm";
|
||||||
|
nixos_conf = writeConfig {
|
||||||
|
inherit
|
||||||
|
system
|
||||||
|
caller
|
||||||
|
args
|
||||||
|
deployment-name
|
||||||
|
root-path
|
||||||
|
deployment-type
|
||||||
|
;
|
||||||
|
};
|
||||||
|
environment = {
|
||||||
|
key_file = key-file;
|
||||||
|
ssh_opts = sshOpts;
|
||||||
|
inherit
|
||||||
|
host
|
||||||
|
nixos_conf
|
||||||
|
bridge
|
||||||
|
;
|
||||||
|
node_name = node-name;
|
||||||
|
ssh_user = username;
|
||||||
|
vlan_id = vlanId;
|
||||||
|
image_datastore_id = imageDatastoreId;
|
||||||
|
template_id = templateId;
|
||||||
|
vm_datastore_id = vmDatastoreId;
|
||||||
|
cd_datastore_id = cdDatastoreId;
|
||||||
|
ipv4_gateway = ipv4Gateway;
|
||||||
|
ipv4_address = ipv4Address;
|
||||||
|
ipv6_gateway = ipv6Gateway;
|
||||||
|
ipv6_address = ipv6Address;
|
||||||
|
};
|
||||||
|
tf-env = pkgs.callPackage ./run/tf-env.nix {
|
||||||
|
inherit httpBackend;
|
||||||
|
tfPackage = pkgs.callPackage ./run/tf-proxmox-vm/tf.nix { };
|
||||||
|
tfDirs = [
|
||||||
|
"deployment/run/tf-single-host"
|
||||||
|
"deployment/run/tf-proxmox-vm"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
vm_name = "test14";
|
||||||
|
in
|
||||||
|
lib.trace (lib.strings.toJSON environment) pkgs.writers.writeBashBin "deploy-tf-proxmox-vm.sh"
|
||||||
|
(withPackages [
|
||||||
|
pkgs.jq
|
||||||
|
pkgs.qemu
|
||||||
|
(pkgs.callPackage ./run/tf-proxmox-vm/tf.nix { })
|
||||||
|
])
|
||||||
|
''
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# TODO after install: $nix_host_keys
|
||||||
|
# cp $tmpdir/${vm_name}_host_key /mnt/etc/ssh/ssh_host_ed25519_key
|
||||||
|
# chmod 600 /mnt/etc/ssh/ssh_host_ed25519_key
|
||||||
|
# cp $tmpdir/${vm_name}_host_key.pub /mnt/etc/ssh/ssh_host_ed25519_key.pub
|
||||||
|
# chmod 644 /mnt/etc/ssh/ssh_host_ed25519_key.pub
|
||||||
|
|
||||||
|
env ${
|
||||||
|
toString (
|
||||||
|
lib.mapAttrsToList (k: v: "TF_VAR_${k}=\"${toBash v}\"") (
|
||||||
|
lib.filterAttrs (_: v: v != null) environment
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} \
|
||||||
|
${toString (lib.mapAttrsToList (k: v: "${k}=\"${toBash v}\"") httpBackend)} \
|
||||||
|
tf_env=${tf-env} bash ./deployment/run/tf-proxmox-vm/run.sh
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,32 +14,36 @@
|
||||||
|
|
||||||
deployment-basic = import ./check/basic {
|
deployment-basic = import ./check/basic {
|
||||||
inherit (pkgs.testers) runNixOSTest;
|
inherit (pkgs.testers) runNixOSTest;
|
||||||
inherit inputs sources;
|
inherit pkgs inputs sources;
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment-cli = import ./check/cli {
|
deployment-cli = import ./check/cli {
|
||||||
inherit (pkgs.testers) runNixOSTest;
|
inherit (pkgs.testers) runNixOSTest;
|
||||||
inherit inputs sources;
|
inherit pkgs inputs sources;
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment-panel = import ./check/panel {
|
deployment-panel = import ./check/panel {
|
||||||
inherit (pkgs.testers) runNixOSTest;
|
inherit (pkgs.testers) runNixOSTest;
|
||||||
inherit inputs sources;
|
inherit pkgs inputs sources;
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment-model-ssh = import ./check/data-model-ssh {
|
deployment-model-ssh = import ./check/data-model-ssh {
|
||||||
inherit (pkgs.testers) runNixOSTest;
|
inherit (pkgs.testers) runNixOSTest;
|
||||||
inherit inputs sources;
|
inherit pkgs inputs sources;
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment-model-nixops4 = import ./check/data-model-nixops4 {
|
deployment-model-nixops4 = import ./check/data-model-nixops4 {
|
||||||
inherit (pkgs.testers) runNixOSTest;
|
inherit (pkgs.testers) runNixOSTest;
|
||||||
inherit inputs sources;
|
inherit pkgs inputs sources;
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment-model-tf = import ./check/data-model-tf {
|
deployment-model-tf = import ./check/data-model-tf {
|
||||||
inherit inputs sources system;
|
inherit inputs sources system;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
deployment-model-tf-proxmox = import ./check/data-model-tf-proxmox {
|
||||||
|
inherit inputs sources system;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
configuration,
|
configuration,
|
||||||
system,
|
system,
|
||||||
sources ? import ../npins,
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
sources = import ../npins;
|
||||||
eval = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" {
|
eval = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,4 @@ NIX_SSHOPTS="${sshOptsAsterisk[*]}" nix-copy-closure --to "$destination" "$outPa
|
||||||
# shellcheck disable=SC2029
|
# shellcheck disable=SC2029
|
||||||
ssh "${sshOptsAt[@]}" "$destination" "nix-env --profile /nix/var/nix/profiles/system --set $outPath"
|
ssh "${sshOptsAt[@]}" "$destination" "nix-env --profile /nix/var/nix/profiles/system --set $outPath"
|
||||||
# shellcheck disable=SC2029
|
# shellcheck disable=SC2029
|
||||||
ssh -o "ConnectTimeout=5" -o "ServerAliveInterval=1" "${sshOptsAt[@]}" "$destination" "nohup env $outPath/bin/switch-to-configuration switch &" 2>&1
|
ssh -o "ConnectTimeout=5" -o "ServerAliveInterval=1" "${sshOptsAt[@]}" "$destination" "nohup env NIXOS_INSTALL_BOOTLOADER=0 $outPath/bin/switch-to-configuration switch &" 2>&1
|
||||||
|
|
|
||||||
66
deployment/run/tf-proxmox-template/main.tf
Normal file
66
deployment/run/tf-proxmox-template/main.tf
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
proxmox = {
|
||||||
|
source = "bpg/proxmox"
|
||||||
|
version = "= 0.81.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
backend "http" {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
dump_name = "qemu-nixos-fediversity-${var.category}.qcow2"
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://registry.terraform.io/providers/bpg/proxmox/latest/docs
|
||||||
|
provider "proxmox" {
|
||||||
|
endpoint = "https://${var.host}:8006/"
|
||||||
|
|
||||||
|
# used for upload
|
||||||
|
ssh {
|
||||||
|
agent = true
|
||||||
|
username = "root"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# hash of our code directory, used to trigger re-deploy
|
||||||
|
# FIXME calculate separately to reduce false positives
|
||||||
|
data "external" "hash" {
|
||||||
|
program = ["sh", "-c", "echo \"{\\\"hash\\\":\\\"$(nix-hash ../../..)\\\"}\""]
|
||||||
|
}
|
||||||
|
|
||||||
|
# FIXME (un)stream
|
||||||
|
# FIXME handle known-hosts in TF state
|
||||||
|
# FIXME move to host
|
||||||
|
# FIXME switch to base image shared between jobs as upload seems a bottleneck? e.g. by:
|
||||||
|
# - recursive TF
|
||||||
|
# - hash in name over overwrite
|
||||||
|
# won't notice file changes: https://github.com/bpg/terraform-provider-proxmox/issues/677
|
||||||
|
resource "proxmox_virtual_environment_file" "upload" {
|
||||||
|
depends_on = [
|
||||||
|
data.external.hash,
|
||||||
|
]
|
||||||
|
content_type = "import"
|
||||||
|
# https://192.168.51.81:8006/#v1:0:=storage%2Fnode051%2Flocal:4::=contentIso:::::
|
||||||
|
# PVE -> Datacenter -> Storage -> local -> Edit -> General -> Content -> check Import + Disk Images -> OK
|
||||||
|
# that UI action also adds it in `/etc/pve/storage.cfg`
|
||||||
|
datastore_id = var.image_datastore_id
|
||||||
|
node_name = var.node_name
|
||||||
|
overwrite = true
|
||||||
|
timeout_upload = 500
|
||||||
|
|
||||||
|
source_file {
|
||||||
|
path = var.image
|
||||||
|
file_name = local.dump_name
|
||||||
|
# FIXME compute and pass hash (so identical builds don't trigger drift)
|
||||||
|
# checksum = "sha256"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output "id" {
|
||||||
|
value = proxmox_virtual_environment_file.upload.id
|
||||||
|
}
|
||||||
|
output "path" {
|
||||||
|
value = proxmox_virtual_environment_file.upload.source_file[0].file_name
|
||||||
|
}
|
||||||
7
deployment/run/tf-proxmox-template/run.sh
Normal file
7
deployment/run/tf-proxmox-template/run.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#! /usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
declare tf_env
|
||||||
|
|
||||||
|
cd "${tf_env}/deployment/run/tf-proxmox-template"
|
||||||
|
tofu apply --auto-approve -input=false -parallelism=1 >&2
|
||||||
|
tofu output -json
|
||||||
48
deployment/run/tf-proxmox-template/tf.nix
Normal file
48
deployment/run/tf-proxmox-template/tf.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
# FIXME: use overlays so this gets imported just once?
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
|
# FIXME centralize overlays
|
||||||
|
# XXX using recent revision for https://github.com/NixOS/nixpkgs/pull/447849
|
||||||
|
let
|
||||||
|
sources = import ../../../npins;
|
||||||
|
mkProvider =
|
||||||
|
args:
|
||||||
|
pkgs.terraform-providers.mkProvider (
|
||||||
|
{ mkProviderFetcher = { repo, ... }: sources.${repo}; } // args
|
||||||
|
);
|
||||||
|
in
|
||||||
|
(
|
||||||
|
(pkgs.callPackage "${sources.nixpkgs-unstable}/pkgs/by-name/op/opentofu/package.nix" { })
|
||||||
|
.overrideAttrs
|
||||||
|
(old: rec {
|
||||||
|
patches = (old.patches or [ ]) ++ [
|
||||||
|
# TF with back-end poses a problem for nix: initialization involves both
|
||||||
|
# mutation (nix: only inside build) and a network call (nix: not inside build)
|
||||||
|
../../check/data-model-tf/02-opentofu-sandboxed-init.patch
|
||||||
|
];
|
||||||
|
# versions > 1.9.0 need go 1.24+
|
||||||
|
version = "1.9.0";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "opentofu";
|
||||||
|
repo = "opentofu";
|
||||||
|
tag = "v${version}";
|
||||||
|
hash = "sha256-e0ZzbQdex0DD7Bj9WpcVI5roh0cMbJuNr5nsSVaOSu4=";
|
||||||
|
};
|
||||||
|
vendorHash = "sha256-fMTbLSeW+pw6GK8/JLZzG2ER90ss2g1FSDX5+f292do=";
|
||||||
|
})
|
||||||
|
).withPlugins
|
||||||
|
(p: [
|
||||||
|
p.external
|
||||||
|
(mkProvider {
|
||||||
|
owner = "bpg";
|
||||||
|
repo = "terraform-provider-proxmox";
|
||||||
|
# 0.82+ need go 1.25
|
||||||
|
rev = "v0.81.0";
|
||||||
|
spdx = "MPL-2.0";
|
||||||
|
hash = null;
|
||||||
|
vendorHash = "sha256-cpei22LkKqohlE76CQcIL5d7p+BjNcD6UQ8dl0WXUOc=";
|
||||||
|
homepage = "https://registry.terraform.io/providers/bpg/proxmox";
|
||||||
|
provider-source-address = "registry.opentofu.org/bpg/proxmox";
|
||||||
|
})
|
||||||
|
])
|
||||||
26
deployment/run/tf-proxmox-template/variables.tf
Normal file
26
deployment/run/tf-proxmox-template/variables.tf
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
variable "host" {
|
||||||
|
description = "the host of the ProxmoX Virtual Environment."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "node_name" {
|
||||||
|
description = "the name of the ProxmoX node to use."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "image" {
|
||||||
|
description = "Back-up file to upload."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "image_datastore_id" {
|
||||||
|
description = "ID of the datastore of the image."
|
||||||
|
type = string
|
||||||
|
default = "local"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "category" {
|
||||||
|
type = string
|
||||||
|
description = "Category to be used in naming the base image."
|
||||||
|
default = "test"
|
||||||
|
}
|
||||||
31
deployment/run/tf-proxmox-vm/await-ssh.sh
Normal file
31
deployment/run/tf-proxmox-vm/await-ssh.sh
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
#! /usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
declare username host key_file ssh_opts
|
||||||
|
readarray -t ssh_opts < <(echo "$ssh_opts" | jq -r '.[]')
|
||||||
|
|
||||||
|
sshOpts=(
|
||||||
|
-o BatchMode=yes \
|
||||||
|
-o StrictHostKeyChecking=no \
|
||||||
|
-o ConnectTimeout=5 \
|
||||||
|
-o ServerAliveInterval=5 \
|
||||||
|
)
|
||||||
|
if [[ -n "${key_file}" ]]; then
|
||||||
|
sshOpts+=(
|
||||||
|
-i "${key_file}"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
for ssh_opt in "${ssh_opts[@]}"; do
|
||||||
|
sshOpts+=(
|
||||||
|
-o "${ssh_opt}"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $(seq 1 30); do
|
||||||
|
if ssh "${sshOpts[@]}" "${username}@${host}" "true"; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Waiting for SSH (attempt #$i)..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
echo "SSH never came up!" >&2
|
||||||
|
exit 1
|
||||||
145
deployment/run/tf-proxmox-vm/main.tf
Normal file
145
deployment/run/tf-proxmox-vm/main.tf
Normal file
|
|
@ -0,0 +1,145 @@
|
||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
proxmox = {
|
||||||
|
source = "bpg/proxmox"
|
||||||
|
version = "= 0.81.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
backend "http" {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://registry.terraform.io/providers/bpg/proxmox/latest/docs
|
||||||
|
provider "proxmox" {
|
||||||
|
endpoint = "https://${var.host}:8006/"
|
||||||
|
|
||||||
|
# used only for files and creating custom disks
|
||||||
|
ssh {
|
||||||
|
agent = true
|
||||||
|
# uncomment and configure if using api_token instead of password
|
||||||
|
username = "root"
|
||||||
|
# node {
|
||||||
|
# name = "${var.node_name}"
|
||||||
|
# address = "${var.host}"
|
||||||
|
# # port = 22
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# hash of our code directory, used to trigger re-deploy
|
||||||
|
# FIXME calculate separately to reduce false positives
|
||||||
|
data "external" "hash" {
|
||||||
|
program = ["sh", "-c", "echo \"{\\\"hash\\\":\\\"$(nix-hash ../../..)\\\"}\""]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "proxmox_virtual_environment_vm" "nix_vm" {
|
||||||
|
lifecycle {
|
||||||
|
# wait, would this not disseminate any changes to this property,
|
||||||
|
# or just defer syncing when only this changed?
|
||||||
|
ignore_changes = [
|
||||||
|
disk["import_from"],
|
||||||
|
initialization,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
node_name = var.node_name
|
||||||
|
pool_id = var.pool_id
|
||||||
|
description = var.description
|
||||||
|
started = true
|
||||||
|
|
||||||
|
# https://wiki.nixos.org/wiki/Virt-manager#Guest_Agent
|
||||||
|
agent {
|
||||||
|
enabled = true
|
||||||
|
timeout = "2m"
|
||||||
|
trim = true
|
||||||
|
}
|
||||||
|
|
||||||
|
cpu {
|
||||||
|
type = "x86-64-v2-AES"
|
||||||
|
cores = var.cores
|
||||||
|
sockets = var.sockets
|
||||||
|
numa = true
|
||||||
|
}
|
||||||
|
|
||||||
|
memory {
|
||||||
|
dedicated = var.memory
|
||||||
|
}
|
||||||
|
|
||||||
|
disk {
|
||||||
|
datastore_id = var.vm_datastore_id
|
||||||
|
file_format = "qcow2"
|
||||||
|
interface = "scsi0"
|
||||||
|
discard = "on"
|
||||||
|
iothread = true
|
||||||
|
size = var.disk_size
|
||||||
|
ssd = true
|
||||||
|
backup = false
|
||||||
|
cache = "none"
|
||||||
|
import_from = var.template_id
|
||||||
|
}
|
||||||
|
|
||||||
|
efi_disk {
|
||||||
|
datastore_id = var.vm_datastore_id
|
||||||
|
file_format = "qcow2"
|
||||||
|
type = "4m"
|
||||||
|
}
|
||||||
|
|
||||||
|
network_device {
|
||||||
|
model = "virtio"
|
||||||
|
bridge = var.bridge
|
||||||
|
vlan_id = var.vlan_id
|
||||||
|
}
|
||||||
|
|
||||||
|
operating_system {
|
||||||
|
type = "l26"
|
||||||
|
}
|
||||||
|
|
||||||
|
scsi_hardware = "virtio-scsi-single"
|
||||||
|
bios = "ovmf"
|
||||||
|
|
||||||
|
initialization {
|
||||||
|
datastore_id = var.cd_datastore_id
|
||||||
|
interface = "sata2"
|
||||||
|
ip_config {
|
||||||
|
ipv4 {
|
||||||
|
gateway = var.ipv4_gateway
|
||||||
|
address = var.ipv4_address
|
||||||
|
}
|
||||||
|
ipv6 {
|
||||||
|
gateway = var.ipv6_gateway
|
||||||
|
address = var.ipv6_address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "null_resource" "await_ssh" {
|
||||||
|
depends_on = [
|
||||||
|
proxmox_virtual_environment_vm.nix_vm
|
||||||
|
]
|
||||||
|
provisioner "local-exec" {
|
||||||
|
command = "env username='root' host='${proxmox_virtual_environment_vm.nix_vm.ipv4_addresses[1][0]}' key_file=${var.key_file} ssh_opts='${var.ssh_opts}' bash ./await-ssh.sh"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module "nixos-rebuild" {
|
||||||
|
depends_on = [
|
||||||
|
data.external.hash,
|
||||||
|
null_resource.await_ssh,
|
||||||
|
]
|
||||||
|
source = "../tf-single-host"
|
||||||
|
nixos_conf = var.nixos_conf
|
||||||
|
username = "root"
|
||||||
|
host = proxmox_virtual_environment_vm.nix_vm.ipv4_addresses[1][0]
|
||||||
|
key_file = var.key_file
|
||||||
|
ssh_opts = var.ssh_opts
|
||||||
|
}
|
||||||
|
|
||||||
|
output "id" {
|
||||||
|
value = proxmox_virtual_environment_vm.nix_vm.vm_id
|
||||||
|
}
|
||||||
|
output "ipv4" {
|
||||||
|
value = proxmox_virtual_environment_vm.nix_vm.ipv4_addresses[1]
|
||||||
|
}
|
||||||
|
output "ipv6" {
|
||||||
|
value = [ for elem in proxmox_virtual_environment_vm.nix_vm.ipv6_addresses[1] : "${elem}%${proxmox_virtual_environment_vm.nix_vm.network_interface_names[1]}" ]
|
||||||
|
}
|
||||||
8
deployment/run/tf-proxmox-vm/run.sh
Normal file
8
deployment/run/tf-proxmox-vm/run.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#! /usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
declare tf_env
|
||||||
|
|
||||||
|
cd "${tf_env}/deployment/run/tf-proxmox-vm"
|
||||||
|
# parallelism=1: limit OOM risk
|
||||||
|
tofu apply --auto-approve -input=false -parallelism=1 >&2
|
||||||
|
tofu output -json
|
||||||
49
deployment/run/tf-proxmox-vm/tf.nix
Normal file
49
deployment/run/tf-proxmox-vm/tf.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
# FIXME: use overlays so this gets imported just once?
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
|
# FIXME centralize overlays
|
||||||
|
# XXX using recent revision for https://github.com/NixOS/nixpkgs/pull/447849
|
||||||
|
let
|
||||||
|
sources = import ../../../npins;
|
||||||
|
mkProvider =
|
||||||
|
args:
|
||||||
|
pkgs.terraform-providers.mkProvider (
|
||||||
|
{ mkProviderFetcher = { repo, ... }: sources.${repo}; } // args
|
||||||
|
);
|
||||||
|
in
|
||||||
|
(
|
||||||
|
(pkgs.callPackage "${sources.nixpkgs-unstable}/pkgs/by-name/op/opentofu/package.nix" { })
|
||||||
|
.overrideAttrs
|
||||||
|
(old: rec {
|
||||||
|
patches = (old.patches or [ ]) ++ [
|
||||||
|
# TF with back-end poses a problem for nix: initialization involves both
|
||||||
|
# mutation (nix: only inside build) and a network call (nix: not inside build)
|
||||||
|
../../check/data-model-tf/02-opentofu-sandboxed-init.patch
|
||||||
|
];
|
||||||
|
# versions > 1.9.0 need go 1.24+
|
||||||
|
version = "1.9.0";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "opentofu";
|
||||||
|
repo = "opentofu";
|
||||||
|
tag = "v${version}";
|
||||||
|
hash = "sha256-e0ZzbQdex0DD7Bj9WpcVI5roh0cMbJuNr5nsSVaOSu4=";
|
||||||
|
};
|
||||||
|
vendorHash = "sha256-fMTbLSeW+pw6GK8/JLZzG2ER90ss2g1FSDX5+f292do=";
|
||||||
|
})
|
||||||
|
).withPlugins
|
||||||
|
(p: [
|
||||||
|
p.external
|
||||||
|
p.null
|
||||||
|
(mkProvider {
|
||||||
|
owner = "bpg";
|
||||||
|
repo = "terraform-provider-proxmox";
|
||||||
|
# 0.82+ need go 1.25
|
||||||
|
rev = "v0.81.0";
|
||||||
|
spdx = "MPL-2.0";
|
||||||
|
hash = null;
|
||||||
|
vendorHash = "sha256-cpei22LkKqohlE76CQcIL5d7p+BjNcD6UQ8dl0WXUOc=";
|
||||||
|
homepage = "https://registry.terraform.io/providers/bpg/proxmox";
|
||||||
|
provider-source-address = "registry.opentofu.org/bpg/proxmox";
|
||||||
|
})
|
||||||
|
])
|
||||||
119
deployment/run/tf-proxmox-vm/variables.tf
Normal file
119
deployment/run/tf-proxmox-vm/variables.tf
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
variable "nixos_conf" {
|
||||||
|
description = "The path to the NixOS configuration to deploy."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ssh_user" {
|
||||||
|
description = "the SSH user to use"
|
||||||
|
type = string
|
||||||
|
default = "root"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "host" {
|
||||||
|
description = "the host of the ProxmoX Virtual Environment."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "node_name" {
|
||||||
|
description = "the name of the ProxmoX node to use."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "key_file" {
|
||||||
|
description = "path to the user's SSH private key"
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ssh_opts" {
|
||||||
|
description = "Extra SSH options (`-o`) to use."
|
||||||
|
type = string
|
||||||
|
default = "[]"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "bridge" {
|
||||||
|
description = "The name of the network bridge (defaults to vmbr0)."
|
||||||
|
type = string
|
||||||
|
default = "vmbr0"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "vlan_id" {
|
||||||
|
description = "The VLAN identifier."
|
||||||
|
type = number
|
||||||
|
default = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "template_id" {
|
||||||
|
description = "ID of the template file from which to clone the VM."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "vm_datastore_id" {
|
||||||
|
description = "ID of the datastore of the VM."
|
||||||
|
type = string
|
||||||
|
default = "local"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "cd_datastore_id" {
|
||||||
|
description = "ID of the datastore of the virtual CD-rom drive to use for cloud-init."
|
||||||
|
type = string
|
||||||
|
default = "local"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ipv4_gateway" {
|
||||||
|
description = "Gateway for IPv4."
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ipv4_address" {
|
||||||
|
description = "IPv4 address."
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ipv6_gateway" {
|
||||||
|
description = "Gateway for IPv6."
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ipv6_address" {
|
||||||
|
description = "IPv6 address."
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "description" {
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "sockets" {
|
||||||
|
type = number
|
||||||
|
description = "The number of sockets of the VM."
|
||||||
|
default = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "cores" {
|
||||||
|
type = number
|
||||||
|
description = "The number of cores of the VM."
|
||||||
|
default = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "memory" {
|
||||||
|
type = number
|
||||||
|
description = "The amount of memory of the VM in MiB."
|
||||||
|
default = 2048
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "disk_size" {
|
||||||
|
type = number
|
||||||
|
description = "The amount of disk of the VM in GiB."
|
||||||
|
default = 32
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "pool_id" {
|
||||||
|
type = string
|
||||||
|
description = "The identifier for a pool to assign the virtual machine to."
|
||||||
|
default = "Fediversity"
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
(lib.evalModules {
|
(lib.evalModules {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit pkgs inputs;
|
inherit pkgs inputs;
|
||||||
|
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./data-model.nix
|
./data-model.nix
|
||||||
|
|
|
||||||
|
|
@ -30,16 +30,17 @@
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
|
|
||||||
partitions = {
|
partitions = {
|
||||||
MBR = {
|
mbr = {
|
||||||
priority = 0;
|
priority = 0;
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02";
|
type = "EF02";
|
||||||
};
|
};
|
||||||
|
|
||||||
ESP = {
|
esp = {
|
||||||
priority = 1;
|
priority = 1;
|
||||||
size = "500M";
|
size = "500M";
|
||||||
type = "EF00";
|
type = "EF00";
|
||||||
|
label = "boot";
|
||||||
content = {
|
content = {
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "vfat";
|
format = "vfat";
|
||||||
|
|
|
||||||
|
|
@ -202,9 +202,22 @@
|
||||||
},
|
},
|
||||||
"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": {
|
||||||
|
"type": "Git",
|
||||||
|
"repository": {
|
||||||
|
"type": "GitHub",
|
||||||
|
"owner": "bpg",
|
||||||
|
"repo": "terraform-provider-proxmox"
|
||||||
|
},
|
||||||
|
"branch": "main",
|
||||||
|
"submodules": false,
|
||||||
|
"revision": "891066821bf7993a5006b12a44c5b36dbdb852d8",
|
||||||
|
"url": "https://github.com/bpg/terraform-provider-proxmox/archive/891066821bf7993a5006b12a44c5b36dbdb852d8.tar.gz",
|
||||||
|
"hash": "0nh1b1mgkycjib2hfzgmq142kgklnnhk4rci4339pfgqfi1z841a"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": 5
|
"version": 5
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue