Set up nix binary cache
This commit is contained in:
parent
48b50f6301
commit
7a6cd668db
3 changed files with 35 additions and 2 deletions
|
@ -40,6 +40,10 @@ in
|
||||||
};
|
};
|
||||||
nix-common = {
|
nix-common = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
disable-cache = true;
|
||||||
|
};
|
||||||
|
nix-serve = {
|
||||||
|
enable = true;
|
||||||
};
|
};
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
|
|
@ -29,12 +29,12 @@ in
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
"https://marcus7070.cachix.org"
|
"https://marcus7070.cachix.org"
|
||||||
];
|
] ++ lib.optionals (! cfg.disable-cache) [ "http://loki.datarift.nl" ];
|
||||||
|
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
"marcus7070.cachix.org-1:JawxHSgnYsgNYJmNqZwvLjI4NcOwrcEZDToWlT3WwXw="
|
"marcus7070.cachix.org-1:JawxHSgnYsgNYJmNqZwvLjI4NcOwrcEZDToWlT3WwXw="
|
||||||
];
|
] ++ lib.optionals (! cfg.disable-cache) [ "loki.datarift.nl:Mk+g9h52oCWtCi6b6KxRkntrD+HZVhwNT8muUQtgKoA=" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
gc = {
|
gc = {
|
||||||
|
|
29
modules/nix-serve/default.nix
Normal file
29
modules/nix-serve/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ pkgs, config, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.eboskma.nix-serve;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.eboskma.nix-serve = { enable = mkEnableOption "nix-serve"; };
|
||||||
|
|
||||||
|
config = mkIf (cfg.enable) {
|
||||||
|
services.nix-serve = {
|
||||||
|
enable = true;
|
||||||
|
secretKeyFile = "/var/cache-priv-key.pem";
|
||||||
|
bindAddress = "127.0.0.1";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
virtualHosts = {
|
||||||
|
"loki.datarift.nl" = {
|
||||||
|
serverAliases = [ "loki" ];
|
||||||
|
locations."/".proxyPass = "http://localhost:${toString config.services.nix-serve.port}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue