forked from fediversity/fediversity
Compare commits
11 commits
0da4c76336
...
eb26d7c607
| Author | SHA1 | Date | |
|---|---|---|---|
| eb26d7c607 | |||
| 828eb2387f | |||
| dbfe69a6dc | |||
| e0887ce975 | |||
| 7b63266baf | |||
| f3fbc592c4 | |||
| 3260f9fc03 | |||
| 57b620b9eb | |||
| 7d19bafc85 | |||
| e66a28290a | |||
| 379c612957 |
8 changed files with 74 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ in
|
|||
pkgs.httpie
|
||||
pkgs.jq
|
||||
pkgs.nix-unit
|
||||
pkgs.attic-client
|
||||
test-loop
|
||||
nixops4.packages.${system}.default
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
BIN
secrets/attic-ci-token.age
Normal file
Binary file not shown.
|
|
@ -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 ];
|
||||
|
|
|
|||
|
|
@ -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})"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue