Compare commits

...

4 commits

Author SHA1 Message Date
e4541d4ecc flake: bump inputs
Some checks failed
ci/woodpecker/push/check Pipeline failed
2023-08-19 14:41:10 +02:00
6d9d835e1c modules: services: nix-cache: use harmonia 2023-08-19 14:41:10 +02:00
19d2916e1c hosts: nixos: porthos: secrets: rename 'nix-cache'
To go with the module rename.
2023-08-19 14:41:10 +02:00
ab59054518 modules: services: rename 'nix-cache'
I'm about to modify the module to use a different cache implementation,
so this name is more appropriate.
2023-08-19 14:41:10 +02:00
6 changed files with 28 additions and 32 deletions

24
flake.lock generated
View file

@ -131,11 +131,11 @@
]
},
"locked": {
"lastModified": 1691856649,
"narHash": "sha256-1/KYCwNyOPpUoyno9Yj3zMHITQaW+wPzVlJFPOPPCo4=",
"lastModified": 1692260837,
"narHash": "sha256-2FpkX1zl+7ni7djK7NeE1ZGupRUwZgjW+RPCSBgDf4k=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "406d34d919e9e8b831b531782cf5ef6995188566",
"rev": "6a94c1a59737783c282c4031555a289c28b961e4",
"type": "github"
},
"original": {
@ -147,11 +147,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1691654369,
"narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=",
"lastModified": 1692356644,
"narHash": "sha256-AYkPFT+CbCVSBmh0WwIzPpwhEJ4Yy3A7JZvUkGJIg5o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e",
"rev": "8ecc900b2f695d74dea35a92f8a9f9b32c8ea33d",
"type": "github"
},
"original": {
@ -163,11 +163,11 @@
},
"nur": {
"locked": {
"lastModified": 1691871985,
"narHash": "sha256-xSuUcMfHQO/GlZsGXHcJpi/22XsrRmw99usQx53bdCw=",
"lastModified": 1692437027,
"narHash": "sha256-gWtVFoPw7HhbKGLp7vupVbCNAvNMQS5+2PujOt2QbRk=",
"owner": "nix-community",
"repo": "NUR",
"rev": "107240729dc0fdd4afa1728aaa03d1df0d70a2e8",
"rev": "b47c7b8d313f9739a7fbb572413c959a362c244a",
"type": "github"
},
"original": {
@ -192,11 +192,11 @@
]
},
"locked": {
"lastModified": 1691747570,
"narHash": "sha256-J3fnIwJtHVQ0tK2JMBv4oAmII+1mCdXdpeCxtIsrL2A=",
"lastModified": 1692274144,
"narHash": "sha256-BxTQuRUANQ81u8DJznQyPmRsg63t4Yc+0kcyq6OLz8s=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "c5ac3aa3324bd8aebe8622a3fc92eeb3975d317a",
"rev": "7e3517c03d46159fdbf8c0e5c97f82d5d4b0c8fa",
"type": "github"
},
"original": {

View file

@ -52,7 +52,7 @@ in
publicKeys = all;
};
"nix-serve/cache-key.age".publicKeys = all;
"nix-cache/cache-key.age".publicKeys = all;
"paperless/password.age".publicKeys = all;
"paperless/secret-key.age".publicKeys = all;

View file

@ -93,9 +93,9 @@ in
enable = true;
passwordFile = secrets."nextcloud/password".path;
};
nix-serve = {
nix-cache = {
enable = true;
secretKeyFile = secrets."nix-serve/cache-key".path;
secretKeyFile = secrets."nix-cache/cache-key".path;
};
nginx = {
enable = true;

View file

@ -20,7 +20,7 @@
./navidrome
./nextcloud
./nginx
./nix-serve
./nix-cache
./paperless
./pirate
./podgrab

View file

@ -1,11 +1,11 @@
# Binary cache through nix-serve
{ config, lib, pkgs, ... }:
# Binary cache
{ config, lib, ... }:
let
cfg = config.my.services.nix-serve;
cfg = config.my.services.nix-cache;
in
{
options.my.services.nix-serve = with lib; {
enable = mkEnableOption "nix-serve binary cache";
options.my.services.nix-cache = with lib; {
enable = mkEnableOption "nix binary cache";
port = mkOption {
type = types.port;
@ -16,7 +16,7 @@ in
secretKeyFile = mkOption {
type = types.str;
example = "/run/secrets/nix-serve";
example = "/run/secrets/nix-cache";
description = "Secret signing key for the cache";
};
@ -32,19 +32,15 @@ in
};
config = lib.mkIf cfg.enable {
services.nix-serve = {
services.harmonia = {
enable = true;
bindAddress = "127.0.0.1";
settings = {
bind = "127.0.0.1:${toString cfg.port}";
inherit (cfg) priority;
};
inherit (cfg)
port
secretKeyFile
;
package = pkgs.nix-serve-ng;
extraParams = "--priority=${toString cfg.priority}";
signKeyPath = cfg.secretKeyFile;
};
my.services.nginx.virtualHosts = [