flake.nix: Add update script

This commit is contained in:
Tristan Daniël Maat 2023-01-19 07:59:58 +00:00
parent 5c537df885
commit d142e98788
Signed by: tlater
GPG key ID: 49670FD774E43268
3 changed files with 86 additions and 8 deletions

View file

@ -27,14 +27,27 @@
templates = flakeOutputs.packages.${system}.tlaternet;
};
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}
'');
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}
'');
};
update = let
update-script = nixpkgs.legacyPackages.${system}.callPackage ./nix/update.nix {
cargo = flakeOutputs.rust-toolchain.cargo;
npm = nixpkgs.legacyPackages.${system}.nodePackages_latest.npm;
npm-check-updates = self.packages.${system}.templates.dependencies.npm-check-updates;
};
in {
type = "app";
program = "${update-script}/bin/update";
};
};
nixosModules.default = import ./nix/module.nix {inherit self system;};