summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/flake.nix b/flake.nix
index 0d0bc3f9..9f4b7b45 100644
--- a/flake.nix
+++ b/flake.nix
@@ -67,17 +67,25 @@
packages = forAllSystems (
system:
let
- inherit (self.packages.${system}) hakurei-static caddy-hakurei-static;
+ inherit (self.packages.${system}) static caddy;
pkgs = nixpkgsFor.${system};
in
{
- default = caddy-hakurei-static;
- hakurei-static = pkgs.callPackage ./package.nix { };
- caddy-hakurei-static = pkgs.writeShellScriptBin "caddy-hakurei-static" ''
+ default = caddy;
+ static = pkgs.callPackage ./package.nix { };
+ dist = pkgs.runCommand "hakurei-static-${static.version}.tar.zst" { } ''
+ PATH="${pkgs.zstd}/bin:$PATH" \
+ ${pkgs.gnutar}/bin/tar \
+ -C '${static}' \
+ --zstd \
+ -cf \
+ "$out" .
+ '';
+ caddy = pkgs.writeShellScriptBin "caddy-hakurei-static" ''
exec ${pkgs.caddy}/bin/caddy \
file-server \
-a -l ":49151" \
- -r ${hakurei-static}
+ -r ${static}
'';
}
);