-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
64 lines (62 loc) · 1.98 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
{
nixConfig = {
extra-substituters = "https://cache.ners.ch/haskell";
extra-trusted-public-keys = "haskell:WskuxROW5pPy83rt3ZXnff09gvnu80yovdeKDw5Gi3o=";
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
haskell-flake.url = "github:srid/haskell-flake";
ema = {
url = "github:srid/ema";
inputs = {
emanote.follows = "emanote";
flake-parts.follows = "flake-parts";
flake-root.follows = "flake-root";
haskell-flake.follows = "haskell-flake";
nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
emanote = {
url = "github:srid/emanote";
inputs = {
ema.follows = "ema";
flake-parts.follows = "flake-parts";
flake-root.follows = "flake-root";
haskell-flake.follows = "haskell-flake";
nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
flake-root.url = "github:srid/flake-root";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs = inputs:
let
inherit (inputs.nixpkgs) lib;
foreach = xs: f: with lib; foldr recursiveUpdate { } (
if isList xs then map f xs
else if isAttrs xs then mapAttrsToList f xs
else throw "foreach: expected list or attrset but got ${builtins.typeOf xs}"
);
emanote-overlay = _: prev: {
emanote = inputs.emanote.packages.${prev.system}.default;
};
in
foreach inputs.nixpkgs.legacyPackages (system: pkgs':
let pkgs = pkgs'.extend emanote-overlay; in
{
legacyPackages.${system} = pkgs;
packages.${system}.default = pkgs.callPackage ./default.nix { };
devShells.${system}.default = pkgs.callPackage ./shell.nix { };
formatter.${system} = pkgs.nixpkgs-fmt;
}
);
}