-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
56 lines (53 loc) · 1.91 KB
/
flake.nix
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
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Guilherme blog";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
cubical-src = {
url = github:guilhermehas/cubical/no-unicode;
flake = false;
};
stdlib-src = {
url = github:agda/agda-stdlib;
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, cubical-src, stdlib-src }:
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
let
overlays = [
(final: prev:
let src-debug = prev.fetchFromGitHub {
owner = "guilhermehas";
repo = "guilherme-blog";
rev = "3df5ec5562de8cb751a1dd2c6c132d48d42faa21";
sha256 = "07c4zn6kmgc0ivl9hw9s81msnrph2jrmc79xvdnwmmll7wrr365k";
};
my-src = ./.;
in rec {
agdaNewPackages = {
cubical = prev.agdaPackages.cubical.overrideAttrs (_: {src = cubical-src;});
standard-library = prev.agdaPackages.standard-library.overrideAttrs (_: {src = stdlib-src;});
};
blogToolProject = prev.haskellPackages.callPackage ./cabal.nix {};
agda-all = prev.agda.withPackages (with agdaNewPackages; p: [ cubical standard-library ]);
blogProject = with prev; stdenv.mkDerivation {
name = "guilherme-blog";
src = my-src;
LC_ALL = "en_US.UTF-8";
buildInputs = with final; [ agda-all blogToolProject ];
buildPhase = ''site build'';
installPhase = ''cp -r _site $out'';
};
})
];
pkgs = import nixpkgs { inherit system overlays; };
builds = pkgs: with pkgs; { inherit blogToolProject agda-all blogProject agdaPackagesNew; };
builds' = pkgs: with pkgs; [ blogToolProject agda-all ];
in rec {
packages = builds pkgs;
devShell = pkgs.mkShell {
buildInputs = builds' pkgs;
};
defaultPackage = pkgs.blogProject;
});
}