flake.nix: Add app for convenient testing with `nix run`

pull/12/head
Tristan Daniël Maat 2022-09-29 03:24:41 +01:00
parent 8b83eb74f1
commit 38c2999291
Signed by: tlater
GPG Key ID: 49670FD774E43268
1 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,16 @@
templates = flakeOutputs.templates.packages.${system}.default;
};
apps.${system}.default = let
inherit (self.packages.${system}) server templates;
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
in {
type = "app";
program = builtins.toString (writeShellScript "tlaternet-webserver" ''
${server}/bin/tlaternet-webserver --template-directory ${templates}
'');
};
devShells.${system} = {
templates = flakeOutputs.templates.devShells.${system}.default.overrideAttrs (old: {
buildInputs = with nixpkgs.legacyPackages.${system};