From f010e84c94d69346d5b8db791335c0b1ca7cac46 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 23 Dec 2022 18:21:05 +0100 Subject: [PATCH] nix: install static --- flake.nix | 4 ++++ nixos-module.nix | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index b9c0a6a..0fdd21c 100644 --- a/flake.nix +++ b/flake.nix @@ -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: diff --git a/nixos-module.nix b/nixos-module.nix index 60f9d9a..60d2e4e 100644 --- a/nixos-module.nix +++ b/nixos-module.nix @@ -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";