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

This commit is contained in:
Tristan Daniël Maat 2022-09-29 03:24:41 +01:00
parent 8b83eb74f1
commit 38c2999291
Signed by: tlater
GPG key ID: 49670FD774E43268

View file

@ -27,6 +27,16 @@
templates = flakeOutputs.templates.packages.${system}.default; 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} = { devShells.${system} = {
templates = flakeOutputs.templates.devShells.${system}.default.overrideAttrs (old: { templates = flakeOutputs.templates.devShells.${system}.default.overrideAttrs (old: {
buildInputs = with nixpkgs.legacyPackages.${system}; buildInputs = with nixpkgs.legacyPackages.${system};