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 = ./.; root = ./.;
nativeBuildInputs = with pkgs; [ pkg-config ]; nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl systemd ]; buildInputs = with pkgs; [ openssl systemd ];
postInstall = ''
mkdir -p $out/share/buzzrelay
cp -r static $out/share/buzzrelay/
'';
checkInputs = [ pkgs.rustPackages.clippy ]; checkInputs = [ pkgs.rustPackages.clippy ];
doCheck = true; doCheck = true;
cargoTestCommands = x: cargoTestCommands = x:

View file

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