diff options
| author | seth <[email protected]> | 2024-08-23 08:44:19 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-10-02 06:52:12 -0400 |
| commit | bd46bfd1728b513a09193e916c73acae37a7b846 (patch) | |
| tree | f4b62602a2845d992d3f028c39d8ea449c787820 /nix/package.nix | |
| parent | 4ea69fd2e3a84bb6db88ead2d2ac5fd4bde13a11 (diff) | |
nix: simplify flake
Diffstat (limited to 'nix/package.nix')
| -rw-r--r-- | nix/package.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 0000000..63f4290 --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,53 @@ +{ + lib, + stdenvNoCC, + writeShellApplication, + miniserve, + zola, + + nix-filter, + self, +}: + +let + website = stdenvNoCC.mkDerivation { + pname = "getchoo-website"; + version = builtins.substring 0 8 self.lastModifiedDate or "dirty"; + + src = nix-filter.lib { + root = self; + include = [ + "config.toml" + "content" + "static" + "templates" + ]; + }; + + nativeBuildInputs = [ zola ]; + + dontConfigure = true; + dontFixup = true; + + buildPhase = "zola build"; + installPhase = "mv public $out"; + + passthru = { + serve = writeShellApplication { + name = "serve"; + runtimeInputs = [ miniserve ]; + + text = '' + miniserve ${website}/ + ''; + }; + }; + + meta = { + homepage = "https://github.com/getchoo/website"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ getchoo ]; + }; + }; +in +website |
