summaryrefslogtreecommitdiffstats
path: root/flake.nix
blob: 6217cecb08580fd629b5013e1cba2cd6553403a3 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
{
  description = "adbjesus.com website";

  inputs = {
    nixpkgs = {
      url = "github:nixos/nixpkgs/nixos-23.05";
    };
  };

  outputs = { self, nixpkgs }:
    let
      systems = [ "x86_64-linux" ];
    in rec {
      packages = nixpkgs.lib.genAttrs systems (system: {
        adbjesus_dot_com = nixpkgs.legacyPackages.${system}.stdenv.mkDerivation {
          name = "adbjesus.com";
          src = ./.;

          buildInputs = with nixpkgs.legacyPackages.${system}; [
            zola
          ];

          buildPhase = ''
            zola build
          '';

          installPhase = ''
            mkdir -p $out
            cp -Tr public $out/public
          '';
        };

        default = self.packages.${system}.adbjesus_dot_com;
      });

      devShells = nixpkgs.lib.genAttrs systems (system: {
        default = nixpkgs.legacyPackages.${system}.mkShell {
          inputsFrom = [ self.packages.${system}.adbjesus_dot_com ];
        };
      });
    };
}