From 93e5922ac4841dc6b860bd96b7ff3cc8d4da4705 Mon Sep 17 00:00:00 2001 From: James Eversole Date: Mon, 26 Jun 2023 13:26:53 -0500 Subject: [PATCH] Install and enable atticd cache server --- flake.nix | 30 +++++++++++++++++++++++++++--- secrets.nix | 11 +++++++++-- secrets/attic_token.age | Bin 0 -> 582 bytes 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 secrets/attic_token.age diff --git a/flake.nix b/flake.nix index 2264488..648a79b 100644 --- a/flake.nix +++ b/flake.nix @@ -6,9 +6,13 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.darwin.follows = ""; }; + attic = { + url = "github:zhaofengli/attic"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, agenix, ... }@attrs: + outputs = { self, nixpkgs, agenix, attic, ... }@attrs: let containerDef = import ./containers.nix; serviceContainers = containerDef.containers; @@ -36,7 +40,11 @@ modules = [ ({ modulesPath, ... }: { - imports = [ agenix.nixosModules.default ./hardware-configuration.nix ]; + imports = [ + agenix.nixosModules.default + attic.nixosModules.atticd + ./hardware-configuration.nix + ]; nix = { buildMachines = [ ]; @@ -68,6 +76,21 @@ enable = true; }; + atticd = { + enable = true; + credentialsFile = + self.nixosConfigurations.eve-psr-nix0.config.age.secrets.attic_token.path; + settings = { + listen = "0.0.0.0:8040"; + chunking = { + nar-size-threshold = 64 * 1024; # 64 KiB + min-size = 16 * 1024; # 16 KiB + avg-size = 64 * 1024; # 64 KiB + max-size = 256 * 1024; # 256 KiB + }; + }; + }; + hydra = { enable = true; hydraURL = "https://hydra.matri.cx"; @@ -98,7 +121,7 @@ users = { sezycei = { isNormalUser = true; - passwordFile = config.age.secrets.sezycei.path; + passwordFile = self.nixosConfigurations.eve-psr-nix0.config.age.secrets.sezycei.path; extraGroups = [ "wheel" ]; packages = with pkgs; [ byobu @@ -114,6 +137,7 @@ age = { secrets = { + attic_token.file = ./secrets/attic_token.age; keys.file = ./secrets/keys.age; sezycei.file = ./secrets/sezycei.age; }; diff --git a/secrets.nix b/secrets.nix index 240b67e..6374f72 100644 --- a/secrets.nix +++ b/secrets.nix @@ -4,6 +4,13 @@ let all = [ james eve-psr-nix0 ]; in { - "secrets/keys.age".publicKeys = all; - "secrets/sezycei.age".publicKeys = all; + "secrets/attic_token.age" = { + publicKeys = all; + }; + "secrets/keys.age" = { + publicKeys = all; + }; + "secrets/sezycei.age" = { + publicKeys = all; + }; } diff --git a/secrets/attic_token.age b/secrets/attic_token.age new file mode 100644 index 0000000000000000000000000000000000000000..904916a5f11775408267346932f4566b4d90edcf GIT binary patch literal 582 zcmZ9_L2J`s007YKCg~1iAcBXPi-?ApHf`DzVVbN-+H`5xv`Nz{xHd_@tliQ!Nz*2} zi^@Q82bG~Blg%LrDuO5Vu*(n`p60>9+)Z~FlN|=KArr)_?+?5R&{5q~EwANFHqG-* z3t(;tLPucRHc(x|2_h7SwOlO7cHu&vQB;j(va(nJbxR0)qpeZBW7Ryza4|eQ1=ul* zG6Y}FL9w9hA+jL(lou`YNmp_NP0>)JmMfW7+%7s;kT>!#R$g|MA#}99tO<4E-89_+BOE*`G^S-~HaX@J8FBAI{!5_hI2^jd-=3x#c7` IC!R5X0S