-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
68 lines (65 loc) · 2.19 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
57
58
59
60
61
62
63
64
65
66
67
68
{
description = "IOG Prelude";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.stdEnv.lib;
localEmacs = (pkgs.emacs.pkgs.withPackages (epkgs: (with epkgs.melpaStablePackages; [
epkgs.agda2-mode
])));
agda-stdlib = pkgs.agdaPackages.standard-library.overrideAttrs (oldAtts: rec {
version = "2.0";
src = pkgs.fetchFromGitHub {
repo = "agda-stdlib";
owner = "agda";
rev = "v${version}";
sha256 = "sha256-TjGvY3eqpF+DDwatT7A78flyPcTkcLHQ1xcg+MKgCoE=";
};
preConfigure = ''
runhaskell GenerateEverything.hs
rm EverythingSafe.agda
'';
});
localAgda = pkgs.agda.withPackages (ps: [
agda-stdlib
]);
iog-prelude = pkgs.agdaPackages.mkDerivation {
pname = "iog-prelude";
version = "0.1";
meta = { };
src = pkgs.fetchFromGitHub {
repo = "iog-agda-prelude";
owner = "functionally";
rev = "2b780014456447bfe2a936be04a0e06f3f1ebba8";
sha256 = "sha256-z3Or2gPin7fZzVkIhEkRVu8+KFxjNfKh6Ik5sM7qqks=";
};
preConfigure = ''
echo "module Everything where" > Everything.agda
find src -type f | sed -e '/Dec\.agda$/d;s@^src/\(.*\)\.agda$@open import \1@;s@/@.@g' >> Everything.agda
'';
buildInputs = [ agda-stdlib ];
};
in
{
packages.default = iog-prelude;
defaultPackage = iog-prelude;
devShell = pkgs.mkShell {
buildInputs = [
pkgs.nixpkgs-fmt
localAgda
localEmacs
pkgs.mononoki
];
};
}
);
nixConfig = {
bash-prompt = "\\n\\[\\033[1;32m\\][iog-prelude:\\w]\\$\\[\\033[0m\\] ";
};
}