From 8c76fba2ad8934c682d72250976868189c696dd4 Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Sat, 10 Aug 2024 22:58:05 +0200 Subject: [PATCH] Add template directory to package derivation output --- nix/module.nix | 1 + nix/package.nix | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/nix/module.nix b/nix/module.nix index 970235e..da328bf 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -100,6 +100,7 @@ in User = cfg.user; Group = cfg.group; Restart = "always"; + WorkingDirectory = "${cfg.package}/web-app"; }; script = '' diff --git a/nix/package.nix b/nix/package.nix index c5b8354..871801e 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -32,12 +32,23 @@ let cp -r db/migrations/* $out/rest-api/db/migrations ''; }; + + templates = stdenv.mkDerivation { + inherit pname version; + name = "archtika-templates"; + src = ../templates; + installPhase = '' + mkdir -p $out/templates + cp -r * $out/templates + ''; + }; in symlinkJoin { name = pname; paths = [ web api + templates ]; meta = with lib; {