deploy attic

This commit is contained in:
Vivian 2023-06-02 17:16:36 +02:00
parent ac8abf75f1
commit 6b1e3fefd8
9 changed files with 408 additions and 282 deletions

View file

@ -0,0 +1,80 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ pkgs, config, ... }:
let vs = config.vault-secrets.secrets;
in {
imports = [ ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [ ];
vault-secrets.secrets.attic = {
services = [ "atticd" ];
};
services.atticd = {
enable = true;
credentialsFile = "${vs.attic}/environment";
settings = {
listen = "[::]:8080";
allowed-hosts = [ "attic.xirion.net" ];
api-endpoint = "https://attic.xirion.net/";
require-proof-of-possession = false;
garbage-collection = {
interval = "12 hours";
default-retention-period = "1 month";
};
compression = {
type = "zstd";
level = 8;
};
storage = {
type = "s3";
region = "hades";
bucket = "attic";
endpoint = "http://garage.hades:3900";
};
# Data chunking
#
# Warning: If you change any of the values here, it will be
# difficult to reuse existing chunks for newly-uploaded NARs
# since the cutpoints will be different. As a result, the
# deduplication ratio will suffer for a while after the change.
chunking = {
# The minimum NAR size to trigger chunking
#
# If 0, chunking is disabled entirely for newly-uploaded NARs.
# If 1, all NARs are chunked.
nar-size-threshold = 64 * 1024; # 64 KiB
# The preferred minimum size of a chunk, in bytes
min-size = 16 * 1024; # 16 KiB
# The preferred average size of a chunk, in bytes
avg-size = 64 * 1024; # 64 KiB
# The preferred maximum size of a chunk, in bytes
max-size = 256 * 1024; # 256 KiB
};
};
};
networking.firewall.allowedTCPPorts = [ 8080 ];
}

View file

@ -139,17 +139,17 @@
mac = "12:fa:24:02:65:e6";
nix = false;
};
# "docker-registry-proxy" = {
# ip = "192.168.0.128";
# mac = "0e:11:65:62:66:9f";
# };
"attic" = {
ip = "192.168.0.128";
mac = "9E:AF:E9:FE:D4:D9";
};
"hassio" = {
ip = "192.168.0.129";
mac = "e6:80:32:fb:00:75";
nix = false;
};
# "docker-registry" = {
# ip = "192.168.0.130";
# ip = "192.168.0.130"attic, ;
# mac = "5e:0e:a6:cf:64:70";
# };
"minecraft" = {

View file

@ -1,42 +0,0 @@
{ config, ... }:
let vs = config.vault-secrets.secrets;
in {
system.stateVersion = "22.05";
networking.interfaces.eth0.useDHCP = true;
# the registry port and metrics port
networking.firewall.allowedTCPPorts =
[ config.services.dockerRegistry.port 5001 ];
vault-secrets.secrets.docker-registry = { };
# Sets the minio user and password
systemd.services.docker-registry.serviceConfig.EnvironmentFile =
"${vs.docker-registry}/environment";
services.dockerRegistry = {
enable = true;
enableDelete = true;
enableGarbageCollect = true;
listenAddress = "0.0.0.0";
storagePath = null; # We want to store in s3
garbageCollectDates = "weekly";
extraConfig = {
# S3 Storages
storage.s3 = {
regionendpoint = "https://o.xirion.net";
bucket = "docker-registry-proxy";
region = "us-east-1"; # Fake but needed
};
# The actual proxy
proxy.remoteurl = "https://registry-1.docker.io";
# Enable prom under :5001/metrics
http.debug.addr = "0.0.0.0:5001";
http.debug.prometheus.enabled = true;
};
};
}

View file

@ -1,49 +0,0 @@
{ config, ... }:
let vs = config.vault-secrets.secrets;
in {
system.stateVersion = "22.05";
networking.interfaces.eth0.useDHCP = true;
# the registry port and metrics port
networking.firewall.allowedTCPPorts =
[ config.services.dockerRegistry.port 5001 ];
vault-secrets.secrets.docker-registry = { };
# Sets the minio user and password
systemd.services.docker-registry.serviceConfig.EnvironmentFile =
"${vs.docker-registry}/environment";
services.dockerRegistry = {
enable = true;
enableDelete = true;
enableGarbageCollect = true;
listenAddress = "0.0.0.0";
storagePath = null; # We want to store in s3
garbageCollectDates = "weekly";
extraConfig = {
# S3 Storages
storage.s3 = {
regionendpoint = "https://o.xirion.net";
bucket = "docker-registry";
region = "us-east-1"; # Fake but needed
};
# Enable prom under :5001/metrics
http.debug.addr = "0.0.0.0:5001";
http.debug.prometheus.enabled = true;
# Webhooks
notifications.endpoints = [{
name = "keel";
url = "http://10.10.10.17:9300/v1/webhooks/registry";
timeout = "500ms";
treshold = 5;
backoff = "1s";
}];
};
};
}

View file

@ -1,10 +0,0 @@
_: {
system.stateVersion = "21.05";
networking.interfaces.eth0.useDHCP = true;
services.jackett = {
enable = true;
dataDir = "/var/lib/jackett/";
openFirewall = true;
};
}

View file

@ -63,6 +63,7 @@ in {
virtualHosts."pass.xirion.net" = proxy "http://bitwarden_rs";
virtualHosts."repo.xirion.net" = proxy "http://archlinux";
virtualHosts."thelounge.xirion.net" = proxy "http://thelounge:9000";
virtualHosts."attic.xirion.net" = proxy "http://attic.hades:8080";
virtualHosts."tautulli.xirion.net" = proxy "http://tautulli.hades:8080";
virtualHosts."peepeepoopoo.xirion.net" = proxy "http://tautulli.hades:8080"; # Deprecated but Ricardo has it bookmarked already!