Compare commits

..

7 commits

Author SHA1 Message Date
0da4c76336
add generator dependency 2025-07-04 13:23:02 +02:00
653d8b7cf8
moar extraDependencies 2025-07-03 17:35:39 +02:00
f3d3c95540
[wip] handling env file (still fails)
rm unused dep nix-templating

fix imports
2025-07-03 17:35:39 +02:00
375180748d
use templating fork 2025-07-03 17:35:39 +02:00
f1dbec8e60
add tests, fix some things
upgrade memory to resolve oom
2025-07-03 17:35:39 +02:00
c4a8e70253
move from dev to operator
revert

add qemu import
2025-07-03 17:35:39 +02:00
221c61955f
WIP: add attic cache, see #92
flesh out attic

TODO keys nginx-port testing

fix key

fix key
2025-07-03 17:35:39 +02:00
8 changed files with 5 additions and 74 deletions

View file

@ -25,9 +25,7 @@ jobs:
runs-on: native runs-on: native
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: build_path=$(nix-build services -A tests.peertube) - run: nix-build services -A tests.peertube
- run: echo $build_path
- run: attic push demo $build_path
check-panel: check-panel:
runs-on: native runs-on: native

View file

@ -64,7 +64,6 @@ in
pkgs.httpie pkgs.httpie
pkgs.jq pkgs.jq
pkgs.nix-unit pkgs.nix-unit
pkgs.attic-client
test-loop test-loop
nixops4.packages.${system}.default nixops4.packages.${system}.default
]; ];

View file

@ -24,14 +24,6 @@ in
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';
nix.settings = {
substituters = [
"https://attic.fediversity.net/demo"
];
trusted-public-keys = [
"demo:N3CAZ049SeBVqBM+OnhLMrxWJ9altbD/aoJtHrY19KM="
];
};
boot.loader = { boot.loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;

View file

@ -1,20 +1,8 @@
{ { pkgs, config, ... }:
lib,
pkgs,
config,
sources,
...
}:
{ {
_class = "nixos"; _class = "nixos";
imports = with sources; [
(import "${home-manager}/nixos")
"${vars}/options.nix"
"${vars}/backends/on-machine.nix"
];
services.gitea-actions-runner = { services.gitea-actions-runner = {
package = pkgs.forgejo-actions-runner; package = pkgs.forgejo-actions-runner;
@ -56,39 +44,4 @@
## For the Docker mode of the runner. ## For the Docker mode of the runner.
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
vars.settings.on-machine.enable = true;
vars.generators."templates" = rec {
dependencies = [ "attic" ];
runtimeInputs = [
pkgs.coreutils
pkgs.gnused
];
script = lib.concatStringsSep "\n" (
lib.mapAttrsToList (template: _: ''
cp "$templates/${template}" "$out/${template}"
echo "filling placeholders in template ${template}..."
sed -i "s/${placeholder}/$(cat "${config.age.secrets.wiki-password.path}")/g" "$out/${template}"
'') files
);
files."attic.toml" = {
secret = true;
template = pkgs.writeText "attic.toml" ''
default-server = "fediversity"
[servers.fediversity]
endpoint = "http://localhost:8080"
token = "${config.vars.generators.attic.files.token.placeholder}"
'';
};
};
home-manager = {
users.gitea-runner.home = {
stateVersion = "25.05";
file.".config/attic/config.toml".source =
config.vars.generators."templates".files."attic.toml".path;
};
};
} }

Binary file not shown.

View file

@ -24,7 +24,6 @@ concatMapAttrs
## are able to decrypt them. ## are able to decrypt them.
{ {
attic-ci-token = [ forgejo-ci ];
forgejo-database-password = [ vm02116 ]; forgejo-database-password = [ vm02116 ];
forgejo-email-password = [ vm02116 ]; forgejo-email-password = [ vm02116 ];
forgejo-runner-token = [ forgejo-ci ]; forgejo-runner-token = [ forgejo-ci ];

View file

@ -103,9 +103,9 @@ in
files."attic.env" = { files."attic.env" = {
secret = true; secret = true;
template = pkgs.writeText "attic.env" '' template = pkgs.writeText "attic.env" ''
ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64="${config.vars.generators.attic.files.token.placeholder}" ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64=${config.vars.generators.attic.files.token.placeholder}
AWS_ACCESS_KEY_ID="$(cat ${config.fediversity.attic.s3AccessKeyFile})" AWS_ACCESS_KEY_ID=$(cat ${config.fediversity.attic.s3AccessKeyFile})
AWS_SECRET_ACCESS_KEY="$(cat ${config.fediversity.attic.s3SecretKeyFile})" AWS_SECRET_ACCESS_KEY=$(cat ${config.fediversity.attic.s3SecretKeyFile})
''; '';
}; };
}; };

View file

@ -66,14 +66,4 @@ in
}; };
}; };
}; };
config = {
## FIXME: This should clearly go somewhere else; and we should have a
## `staging` vs. `production` setting somewhere.
security.acme = {
acceptTerms = true;
defaults.email = "something@fediversity.net";
# defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
};
};
} }