feat(etna): add attic

This commit is contained in:
uku 2024-04-01 23:13:29 +02:00
parent 8c1ee688b6
commit 3dd4526878
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
7 changed files with 114 additions and 6 deletions

View file

@ -51,6 +51,36 @@
"type": "github" "type": "github"
} }
}, },
"attic": {
"inputs": {
"crane": [
"crane"
],
"flake-compat": [],
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1711742460,
"narHash": "sha256-0O4v6e4a1toxXZ2gf5INhg4WPE5C5T+SVvsBt+45Mcc=",
"owner": "zhaofengli",
"repo": "attic",
"rev": "4dbdbee45728d8ce5788db6461aaaa89d98081f0",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "attic",
"type": "github"
}
},
"catppuccin": { "catppuccin": {
"locked": { "locked": {
"lastModified": 1710663401, "lastModified": 1710663401,
@ -69,16 +99,15 @@
"crane": { "crane": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"lanzaboote",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1711299236, "lastModified": 1711681752,
"narHash": "sha256-6/JsyozOMKN8LUGqWMopKTSiK8N79T8Q+hcxu2KkTXg=", "narHash": "sha256-LEg6/dmEFxx6Ygti5DO9MOhGNpyB7zdxdWtzv/FCTXk=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "880573f80d09e18a11713f402b9e6172a085449f", "rev": "ada0fb4dcce4561acb1eb17c59b7306d9d4a95f3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -174,7 +203,9 @@
}, },
"lanzaboote": { "lanzaboote": {
"inputs": { "inputs": {
"crane": "crane", "crane": [
"crane"
],
"flake-compat": [], "flake-compat": [],
"flake-parts": [ "flake-parts": [
"flake-parts" "flake-parts"
@ -245,7 +276,9 @@
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"api-rs": "api-rs", "api-rs": "api-rs",
"attic": "attic",
"catppuccin": "catppuccin", "catppuccin": "catppuccin",
"crane": "crane",
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",

View file

@ -38,6 +38,11 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin.url = "github:Stonks3141/ctp-nix"; catppuccin.url = "github:Stonks3141/ctp-nix";
lanzaboote = { lanzaboote = {
@ -45,6 +50,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts"; inputs.flake-parts.follows = "flake-parts";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
inputs.crane.follows = "crane";
inputs.pre-commit-hooks-nix.follows = ""; inputs.pre-commit-hooks-nix.follows = "";
inputs.flake-compat.follows = ""; inputs.flake-compat.follows = "";
}; };
@ -64,6 +70,15 @@
inputs.flake-compat.follows = ""; inputs.flake-compat.follows = "";
}; };
attic = {
url = "github:zhaofengli/attic";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs"; # trolley emojo
inputs.flake-utils.follows = "flake-utils";
inputs.crane.follows = "crane";
inputs.flake-compat.follows = "";
};
vscode-extensions = { vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions"; url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

13
secrets/etna/atticEnv.age Normal file
View file

@ -0,0 +1,13 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3RVNXS0JUMERheGlMbnVQ
OGZuZmxZZWUyaWNPSGJINUhZK1BBT0ZIZ1FFCmh1MkVwRlNhbThVd0ZJZHVnWTJZ
NXVGUTlWdENpa2dLT09NOHptcG1pQVkKLT4gWDI1NTE5IHF6YVNYTG5Bei91SWFN
WVFoNmZwb2djbmRWUVpYMmRDRHcwSDBUSU9VMkEKRnF1ZWFRK0ZXODlxT2d0cmlS
dm52bFVNMTlseU1BcjFNNEpJRFQwa21BcwotPiBYMjU1MTkgNkFoWU9zZFh3THdG
akkwVG8vS0pOSXhma1RJNE55cUd2Z2RzK2lZczBWSQpYTUJwRi95M1BYK1ljNHdM
SGMzaVJDUVhwd1NlZm1BcHBUdW5md3J1dzFzCi0tLSBZTFdKdXBhdUFkc3RHaVZp
RERMLzdQdlFNY1VsOEV0RHZxWkdZdTc3ckRJCuxCX+OeUcJc4In8bxG+03Xd6OtF
w7oOJMZWH9rxu9x1NhGO6+pDnokiqci6B2dhWHbhHERQmOLrOkzx56qjHQkUlu8I
Gpb4zFV4c6YEQaieg/TJsIdiQ79htJhNY0dw+I7ZGAMt+6euwrApT1prve7R5oUb
/xgdhNqW9SHhsDvjCrRGyIWjLcBmk6ZOt11FbMc3com5vLgCbcKuKl562q0=
-----END AGE ENCRYPTED FILE-----

View file

@ -19,4 +19,5 @@ in {
"etna/ukubotRsEnv.age".publicKeys = main ++ [etna]; "etna/ukubotRsEnv.age".publicKeys = main ++ [etna];
"etna/ngrokEnv.age".publicKeys = main ++ [etna]; "etna/ngrokEnv.age".publicKeys = main ++ [etna];
"etna/minecraftEnv.age".publicKeys = main ++ [etna]; "etna/minecraftEnv.age".publicKeys = main ++ [etna];
"etna/atticEnv.age".publicKeys = main ++ [etna];
} }

View file

@ -63,6 +63,7 @@ in {
modules = modules =
nixos nixos
++ (with inputs; [ ++ (with inputs; [
attic.nixosModules.atticd
api-rs.nixosModules.default api-rs.nixosModules.default
ukubot-rs.nixosModules.default ukubot-rs.nixosModules.default
self.nixosModules.reposilite self.nixosModules.reposilite

View file

@ -12,6 +12,12 @@
group = "cloudflared"; group = "cloudflared";
}; };
atticEnv = {
file = "${path}/atticEnv.age";
owner = "atticd";
group = "atticd";
};
apiRsEnv.file = "${path}/apiRsEnv.age"; apiRsEnv.file = "${path}/apiRsEnv.age";
ukubotRsEnv.file = "${path}/ukubotRsEnv.age"; ukubotRsEnv.file = "${path}/ukubotRsEnv.age";
ngrokEnv.file = "${path}/ngrokEnv.age"; ngrokEnv.file = "${path}/ngrokEnv.age";
@ -82,6 +88,35 @@
}; };
}; };
atticd = {
enable = true;
credentialsFile = config.age.secrets.atticEnv.path;
settings = {
listen = "[::]:6000";
api-endpoint = "https://attic.uku3lig.net/";
storage = {
type = "local";
path = "/data/attic";
};
chunking = {
nar-size-threshold = 65536; # 64 KiB
min-size = 16384; # 16 KiB
avg-size = 65536; # 64 KiB
max-size = 262144; # 256 KiB
};
compression.type = "zstd";
garbage-collection = {
interval = "1 day";
default-retention-period = "6 weeks";
};
};
};
cloudflared = { cloudflared = {
enable = true; enable = true;
tunnels."57f51ad7-25a0-45f3-b113-0b6ae0b2c3e5" = { tunnels."57f51ad7-25a0-45f3-b113-0b6ae0b2c3e5" = {
@ -91,6 +126,7 @@
"api.uku3lig.net" = "http://localhost:5000"; "api.uku3lig.net" = "http://localhost:5000";
"bw.uku3lig.net" = "http://localhost:8222"; "bw.uku3lig.net" = "http://localhost:8222";
"maven.uku3lig.net" = "http://localhost:8080"; "maven.uku3lig.net" = "http://localhost:8080";
"attic.uku3lig.net" = "http://localhost:6000";
"m.uku.moe" = "http://localhost:80"; "m.uku.moe" = "http://localhost:80";
}; };

View file

@ -1,4 +1,13 @@
{config, ...}: { {
config,
pkgs,
attic,
...
}: {
environment.systemPackages = [
attic.packages.${pkgs.system}.attic
];
wsl = { wsl = {
enable = true; enable = true;
defaultUser = "leo"; defaultUser = "leo";