Added Nix run target
This commit is contained in:
@@ -21,10 +21,10 @@ apt install csvkit jq zip # for Debian/Ubuntu/...
|
||||
Just run:
|
||||
|
||||
```bash
|
||||
nix build
|
||||
nix run "git+https://git.zumepro.cz/tul/tultemplategen"
|
||||
```
|
||||
|
||||
This will pull all the necessary dependencies, build the newest version from upstream, pack it and symlink it as `result`.
|
||||
This will start a local instance of the generator on `localhost:8080`.
|
||||
|
||||
## Hosting the generator yourself
|
||||
|
||||
|
||||
16
flake.nix
16
flake.nix
@@ -8,9 +8,7 @@
|
||||
outputs = { nixpkgs, utils, tultemplate2, ... }: (utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
packages.default = pkgs.stdenv.mkDerivation {
|
||||
tultemplategen = pkgs.stdenv.mkDerivation {
|
||||
name = "tultemplategen";
|
||||
src = ./.;
|
||||
packageRootDir = "tul-thesis";
|
||||
@@ -29,6 +27,18 @@
|
||||
cp -R src lib assets index.html template.zip $out
|
||||
'';
|
||||
};
|
||||
server = with pkgs; (writeShellScriptBin "tultemplategen-server" ''
|
||||
cd ${tultemplategen}
|
||||
${python3}/bin/python -m http.server --bind localhost 8080
|
||||
'');
|
||||
in
|
||||
{
|
||||
packages.default = tultemplategen;
|
||||
apps.default = {
|
||||
type = "app";
|
||||
program = "${server}/bin/tultemplategen-server";
|
||||
meta.description = "Tultemplategen Server";
|
||||
};
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user