about summary refs log tree commit diff
path: root/flake.nix
blob: c568975de7fca6429d5a597a0015a2511e2f4ec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  description = "sefidel-web devshell";
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { inherit system; };
      in
      {
        packages.sefidel-web = pkgs.stdenv.mkDerivation rec {
          pname = "sefidel-web";
          version = self.shortRev or "dirty";

          src = ./.;
          nativeBuildInputs = [ pkgs.zola ];
          buildPhase = "zola build";
          installPhase = "cp -r public $out";
        };

        defaultPackage = self.packages.${system}.sefidel-web;

        devShell = pkgs.mkShell {
          nativeBuildInputs = with pkgs; [
            zola
          ];
          buildInputs = [ ];
        };
      });
}