nix: install static

This commit is contained in:
Astro 2022-12-23 18:21:05 +01:00
parent def1e2bf3c
commit f010e84c94
2 changed files with 7 additions and 1 deletions

View file

@ -20,6 +20,10 @@
root = ./.;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl systemd ];
postInstall = ''
mkdir -p $out/share/buzzrelay
cp -r static $out/share/buzzrelay/
'';
checkInputs = [ pkgs.rustPackages.clippy ];
doCheck = true;
cargoTestCommands = x:

View file

@ -40,6 +40,7 @@
pub_key_file = cfg.pubKeyFile;
db = "host=/var/run/postgresql user=${cfg.user} dbname=${cfg.database}";
});
inherit (self.packages.${pkgs.system}) buzzrelay;
in
lib.mkIf cfg.enable {
users.users.${cfg.user} = {
@ -64,7 +65,8 @@
after = [ "network-online.target" ];
serviceConfig = {
Type = "notify";
ExecStart = "${self.packages.${pkgs.system}.buzzrelay}/bin/buzzrelay ${lib.escapeShellArg configFile}";
WorkingDirectory = "${buzzrelay}/share/buzzrelay";
ExecStart = "${buzzrelay}/bin/buzzrelay ${lib.escapeShellArg configFile}";
User = cfg.user;
Group = cfg.group;
ProtectSystem = "full";