move from dev to operator

revert

add qemu import
This commit is contained in:
Kiara Grouwstra 2025-06-19 15:01:43 +02:00
parent f2546ef1a7
commit b0543ebfd8
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
8 changed files with 59 additions and 11 deletions

View file

@ -3,6 +3,7 @@
"mastodon": { "enable": false }, "mastodon": { "enable": false },
"peertube": { "enable": false }, "peertube": { "enable": false },
"pixelfed": { "enable": false }, "pixelfed": { "enable": false },
"attic": { "enable": false },
"initialUser": { "initialUser": {
"displayName": "Testy McTestface", "displayName": "Testy McTestface",
"username": "test", "username": "test",

View file

@ -24,6 +24,7 @@
mastodonConfigurationResource, mastodonConfigurationResource,
peertubeConfigurationResource, peertubeConfigurationResource,
pixelfedConfigurationResource, pixelfedConfigurationResource,
atticConfigurationResource,
}: }:
## From the hosting provider's perspective, the function is meant to be ## From the hosting provider's perspective, the function is meant to be
@ -55,6 +56,7 @@ let
mastodon = nonNull panelConfigNullable.mastodon { enable = false; }; mastodon = nonNull panelConfigNullable.mastodon { enable = false; };
peertube = nonNull panelConfigNullable.peertube { enable = false; }; peertube = nonNull panelConfigNullable.peertube { enable = false; };
pixelfed = nonNull panelConfigNullable.pixelfed { enable = false; }; pixelfed = nonNull panelConfigNullable.pixelfed { enable = false; };
attic = nonNull panelConfigNullable.attic { enable = false; };
}; };
in in
@ -107,6 +109,13 @@ in
s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GKb5615457d44214411e673b7b"; s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GKb5615457d44214411e673b7b";
s3SecretKeyFile = pkgs.writeText "s3SecretKey" "5be6799a88ca9b9d813d1a806b64f15efa49482dbe15339ddfaf7f19cf434987"; s3SecretKeyFile = pkgs.writeText "s3SecretKey" "5be6799a88ca9b9d813d1a806b64f15efa49482dbe15339ddfaf7f19cf434987";
}; };
atticS3KeyConfig =
{ pkgs, ... }:
{
# REVIEW: how were these generated above? how do i add one?
s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GKaaaaaaaaaaaaaaaaaaaaaaaa";
s3SecretKeyFile = pkgs.writeText "s3SecretKey" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
};
makeConfigurationResource = resourceModule: config: { makeConfigurationResource = resourceModule: config: {
type = providers.local.exec; type = providers.local.exec;
@ -140,13 +149,14 @@ in
{ {
garage-configuration = makeConfigurationResource garageConfigurationResource ( garage-configuration = makeConfigurationResource garageConfigurationResource (
{ pkgs, ... }: { pkgs, ... }:
mkIf (cfg.mastodon.enable || cfg.peertube.enable || cfg.pixelfed.enable) { mkIf (cfg.mastodon.enable || cfg.peertube.enable || cfg.pixelfed.enable || cfg.attic.enable) {
fediversity = { fediversity = {
inherit (cfg) domain; inherit (cfg) domain;
garage.enable = true; garage.enable = true;
pixelfed = pixelfedS3KeyConfig { inherit pkgs; }; pixelfed = pixelfedS3KeyConfig { inherit pkgs; };
mastodon = mastodonS3KeyConfig { inherit pkgs; }; mastodon = mastodonS3KeyConfig { inherit pkgs; };
peertube = peertubeS3KeyConfig { inherit pkgs; }; peertube = peertubeS3KeyConfig { inherit pkgs; };
attic = atticS3KeyConfig { inherit pkgs; };
}; };
} }
); );
@ -213,6 +223,25 @@ in
}; };
} }
); );
attic-configuration = makeConfigurationResource atticConfigurationResource (
{ pkgs, ... }:
mkIf cfg.attic.enable {
fediversity = {
inherit (cfg) domain;
temp.initialUser = {
inherit (cfg.initialUser) username email displayName;
# FIXME: disgusting, but nvm, this is going to be replaced by
# proper central authentication at some point
passwordFile = pkgs.writeText "password" cfg.initialUser.password;
};
attic = atticS3KeyConfig { inherit pkgs; } // {
enable = true;
};
};
}
);
}; };
}; };
} }

View file

@ -71,6 +71,19 @@ in
}); });
default = null; default = null;
}; };
attic = mkOption {
description = ''
Configuration for the Attic service
'';
type =
with types;
nullOr (submodule {
options = {
enable = lib.mkEnableOption "Attic";
};
});
default = null;
};
initialUser = mkOption { initialUser = mkOption {
description = '' description = ''
Some services require an initial user to access them. Some services require an initial user to access them.

View file

@ -107,6 +107,10 @@ let
vmName = "test04"; vmName = "test04";
isTestVm = true; isTestVm = true;
}; };
atticConfigurationResource = makeResourceModule {
vmName = "test12";
isTestVm = true;
};
}; };
nixops4ResourceNixosMockOptions = { nixops4ResourceNixosMockOptions = {

View file

@ -16,11 +16,4 @@
gateway = "2a00:51c0:13:1305::1"; gateway = "2a00:51c0:13:1305::1";
}; };
}; };
nixos.module = {
imports = [
../../../infra/common/proxmox-qemu-vm.nix
../../../services/fediversity/attic
];
};
} }

View file

@ -18,4 +18,11 @@
gateway = "2a00:51c0:13:1305::1"; gateway = "2a00:51c0:13:1305::1";
}; };
}; };
nixos.module = {
imports = [
../../../infra/common/proxmox-qemu-vm.nix
../../../services/fediversity/attic
];
};
} }

View file

@ -9,11 +9,11 @@ let
sources = import ../../../npins; sources = import ../../../npins;
inherit inherit
(import "${sources.nix-templating}/lib.nix" { (import "${sources.nix-templating}/lib.nix" {
inherit pkgs lib; inherit pkgs;
nix_templater = pkgs.callPackage "${sources.nix-templating}/pkgs/nix_templater" { }; nix_templater = pkgs.callPackage "${sources.nix-templating}/pkgs/nix_templater" { };
}) })
fileContents fileContents
template template_text
; ;
in in
{ {
@ -103,7 +103,7 @@ in
mode = "monolithic"; mode = "monolithic";
environmentFile = "${ environmentFile = "${
template { template_text {
name = "attic.env"; name = "attic.env";
outPath = "./attic.env"; outPath = "./attic.env";
text = '' text = ''

View file

@ -13,6 +13,7 @@ in
./mastodon ./mastodon
./pixelfed ./pixelfed
./peertube ./peertube
./attic
]; ];
options = { options = {