From 526a1eaf1716df0377b535dd6117d1e58817b872 Mon Sep 17 00:00:00 2001 From: Peter Lehmann Date: Sun, 19 May 2024 15:31:08 +0200 Subject: [PATCH] Decommision cache --- flake.nix | 10 ---- nodes/cache/attic.nix | 76 -------------------------- nodes/cache/default.nix | 10 ---- nodes/cache/disko.nix | 34 ------------ nodes/cache/hardware-configuration.nix | 18 ------ nodes/cache/networking.nix | 58 -------------------- 6 files changed, 206 deletions(-) delete mode 100644 nodes/cache/attic.nix delete mode 100644 nodes/cache/default.nix delete mode 100644 nodes/cache/disko.nix delete mode 100644 nodes/cache/hardware-configuration.nix delete mode 100644 nodes/cache/networking.nix diff --git a/flake.nix b/flake.nix index 0108a24..a05ef43 100644 --- a/flake.nix +++ b/flake.nix @@ -95,16 +95,6 @@ nix-topology.nixosModules.default ]; }; - cache = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs outputs; }; - system = "x86_64-linux"; - extraModules = [ inputs.colmena.nixosModules.deploymentOptions ]; - modules = [ - ./nodes/cache - self.nixosModules.common - nix-topology.nixosModules.default - ]; - }; ymir = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs; }; system = "x86_64-linux"; diff --git a/nodes/cache/attic.nix b/nodes/cache/attic.nix deleted file mode 100644 index e941734..0000000 --- a/nodes/cache/attic.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ inputs -, config -, ... -}: -{ - imports = [ inputs.attic.nixosModules.atticd ]; - - - sops.secrets."atticd/env" = { - sopsFile = "${inputs.self}/secrets/cache.yaml"; - }; - - security.acme = { - defaults.email = "acme@xnee.net"; - acceptTerms = true; - certs."cache.xnee.net" = { }; - }; - - networking.firewall.allowedTCPPorts = [ 80 443 ]; - - services = { - atticd = { - enable = true; - credentialsFile = config.sops.secrets."atticd/env".path; - - settings = { - listen = "127.0.0.1:8080"; - - storage = { - type = "s3"; - endpoint = "https://s3.wasabisys.com"; - region = "eu-central-2"; - bucket = "cache-xnee-net"; - }; - - # 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 - }; - }; - }; - - nginx = { - enable = true; - recommendedTlsSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - virtualHosts."cache.xnee.net" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://${config.services.atticd.settings.listen}"; - extraConfig = "client_max_body_size 10G;"; - }; - }; - }; - }; -} diff --git a/nodes/cache/default.nix b/nodes/cache/default.nix deleted file mode 100644 index 1829a1d..0000000 --- a/nodes/cache/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - imports = [ - ./disko.nix - ./hardware-configuration.nix - ./networking.nix - ./attic.nix - ]; - - -} diff --git a/nodes/cache/disko.nix b/nodes/cache/disko.nix deleted file mode 100644 index 7f79e24..0000000 --- a/nodes/cache/disko.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - disko.devices = { - disk = { - sda = { - device = "/dev/sda"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - ESP = { - label = "EFI"; - type = "EF00"; - size = "500M"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - label = "NIXOS"; - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/nodes/cache/hardware-configuration.nix b/nodes/cache/hardware-configuration.nix deleted file mode 100644 index dbb76d4..0000000 --- a/nodes/cache/hardware-configuration.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, pkgs, modulesPath, ... }: -{ - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; - - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/nodes/cache/networking.nix b/nodes/cache/networking.nix deleted file mode 100644 index 70561f8..0000000 --- a/nodes/cache/networking.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ lib -, config -, ... -}: -let - inherit (config.lib.topology) mkConnectionRev; - IPv4 = "128.140.9.158"; - IPv6 = "2a01:4f8:c2c:17c9::1"; -in -{ - topology.self.interfaces.eth0 = { - network = "Internet"; - physicalConnections = [ (mkConnectionRev "Internet" "*") ]; - }; - networking = { - domains = { - enable = true; - subDomains."${config.networking.fqdn}" = { }; - baseDomains."${config.networking.domain}" = { - a.data = IPv4; - aaaa.data = IPv6; - }; - }; - useNetworkd = true; - useDHCP = false; - hostName = "cache"; - usePredictableInterfaceNames = lib.mkDefault false; - domain = "xnee.net"; - nameservers = [ - #HETZNER - "2a01:4ff:ff00::add:2" - "2a01:4ff:ff00::add:1" - ]; - dhcpcd.enable = false; - }; - systemd.network = { - enable = true; - networks."10-wan" = { - networkConfig.DHCP = "no"; - matchConfig.Name = "eth0"; - address = [ - "${IPv4}/32" - "${IPv6}/64" - ]; - routes = [ - { routeConfig.Gateway = "fe80::1"; } - { routeConfig = { Destination = "172.31.1.1"; }; } - { - routeConfig = { - Gateway = "172.31.1.1"; - GatewayOnLink = true; - }; - } - ]; - linkConfig.RequiredForOnline = "routable"; - }; - }; -}