about summary refs log tree commit diff
path: root/flake.nix
blob: 495811642573f0adc5ef522d8287a583434129e2 (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
{
  description = "Yet another photo gallery generator.";

  outputs = { self, nixpkgs }: {

    packages.x86_64-linux.gal =
    with import nixpkgs { system = "x86_64-linux"; };
    stdenv.mkDerivation {
      pname = "gal";
      version = "0.2";

      src = self;

      installPhase = ''
        mkdir -p $out/bin $out/share/gal
        cp gal $out/bin
        cp style.css $out/share/gal

        sed -i 's:convert:${imagemagick}/bin/convert:g' $out/bin/gal
        sed -i 's:cwebp:${libwebp}/bin/cwebp:g' $out/bin/gal
        sed -i "s:cp style.css:cp $out/share/gal/style.css:g" $out/bin/gal
      '';
    };

    defaultPackage.x86_64-linux = self.packages.x86_64-linux.gal;

  };
}