Compare commits

..

11 commits

Author SHA1 Message Date
eb26d7c607
test attic cache from ci 2025-07-04 19:24:32 +02:00
828eb2387f
allow consuming attic cache from ci runner 2025-07-04 19:23:41 +02:00
dbfe69a6dc
enquote attic env values for use in source attic.env 2025-07-04 19:22:59 +02:00
e0887ce975
add generator dependency 2025-07-04 15:47:47 +02:00
7b63266baf
moar extraDependencies 2025-07-04 15:47:47 +02:00
f3fbc592c4
[wip] handling env file (still fails)
rm unused dep nix-templating

fix imports
2025-07-04 15:47:47 +02:00
3260f9fc03
use templating fork 2025-07-04 15:47:47 +02:00
57b620b9eb
add tests, fix some things
upgrade memory to resolve oom
2025-07-04 15:47:47 +02:00
7d19bafc85
move from dev to operator
revert

add qemu import
2025-07-04 15:47:47 +02:00
e66a28290a
WIP: add attic cache, see #92
flesh out attic

TODO keys nginx-port testing

fix key

fix key
2025-07-04 15:47:47 +02:00
379c612957
reinstate acme settings needed by applications 2025-07-04 15:47:46 +02:00
8 changed files with 74 additions and 5 deletions

View file

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

View file

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

View file

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

View file

@ -1,8 +1,20 @@
{ pkgs, config, ... }:
{
lib,
pkgs,
config,
sources,
...
}:
{
_class = "nixos";
imports = with sources; [
(import "${home-manager}/nixos")
"${vars}/options.nix"
"${vars}/backends/on-machine.nix"
];
services.gitea-actions-runner = {
package = pkgs.forgejo-actions-runner;
@ -44,4 +56,39 @@
## For the Docker mode of the runner.
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;
};
};
}

BIN
secrets/attic-ci-token.age Normal file

Binary file not shown.

View file

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

View file

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

View file

@ -66,4 +66,14 @@ 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";
};
};
}