fuuko/nar-serve: Use NixOS module
Since it does not provide a `package` option, it has to be overriden with an overlay.
This commit is contained in:
parent
44cc17db53
commit
e0efa77520
|
@ -59,43 +59,18 @@ in
|
||||||
(lib.splitString "\n" config.services.nginx.commonHttpConfig))}
|
(lib.splitString "\n" config.services.nginx.commonHttpConfig))}
|
||||||
add_header Access-Control-Allow-Origin https://hydra.sbruder.de;
|
add_header Access-Control-Allow-Origin https://hydra.sbruder.de;
|
||||||
'';
|
'';
|
||||||
"/nix/store/".proxyPass = "http://localhost:${config.systemd.services.nar-serve.environment.PORT}";
|
"/nix/store/".proxyPass = "http://localhost:${toString config.services.nar-serve.port}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.nginx.serviceConfig.ReadWritePaths = lib.singleton binaryCachePath;
|
systemd.services.nginx.serviceConfig.ReadWritePaths = lib.singleton binaryCachePath;
|
||||||
|
|
||||||
# TODO 21.05: Replace with upstream module
|
services.nar-serve = {
|
||||||
systemd.services.nar-serve =
|
enable = true;
|
||||||
let
|
cacheURL = "file://${binaryCachePath}";
|
||||||
# TODO: remove once new version is released and in nixpkgs
|
};
|
||||||
nar-serve = pkgs.nar-serve.overrideAttrs (o: o // {
|
|
||||||
version = "unstable-2021-04-08";
|
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
# nar-serve logs multiple lines on every request
|
||||||
owner = "numtide";
|
systemd.services.nar-serve.serviceConfig.StandardOutput = "null";
|
||||||
repo = "nar-serve";
|
|
||||||
rev = "4243b0efa41910dfa4be8b9936ae460699d3f8f0";
|
|
||||||
sha256 = "0mjs3yilf5rixm67wk4h4jji54dsc0w3vfxd561pvfbxplbmgh3c";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
after = [ "network.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
PORT = "8383";
|
|
||||||
NAR_CACHE_URL = "file://${binaryCachePath}";
|
|
||||||
};
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Restart = "always";
|
|
||||||
RestartSec = "5s";
|
|
||||||
ExecStart = "${nar-serve}/bin/nar-serve";
|
|
||||||
DynamicUser = true;
|
|
||||||
StandardOutput = "null"; # nar-server logs multiple lines on every request
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,4 +48,16 @@ in
|
||||||
doCheck = prev.stdenv.isi686;
|
doCheck = prev.stdenv.isi686;
|
||||||
checkTarget = "run_self_test";
|
checkTarget = "run_self_test";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
# TODO: remove once new version (> 0.3.0) is released and in nixpkgs
|
||||||
|
nar-serve = prev.nar-serve.overrideAttrs (o: o // {
|
||||||
|
version = "unstable-2021-04-08";
|
||||||
|
|
||||||
|
src = prev.fetchFromGitHub {
|
||||||
|
owner = "numtide";
|
||||||
|
repo = "nar-serve";
|
||||||
|
rev = "4243b0efa41910dfa4be8b9936ae460699d3f8f0";
|
||||||
|
sha256 = "0mjs3yilf5rixm67wk4h4jji54dsc0w3vfxd561pvfbxplbmgh3c";
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue