-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
79 lines (74 loc) · 1.99 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
69
70
71
72
73
74
75
76
77
78
79
{
description = "Jonathan Lorimer's personal website";
inputs = {
# Nix Inputs
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = {
self,
nixpkgs,
}: let
forAllSystems = function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
] (system:
function rec {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
supportedGHCVersion = "96";
compilerVersion = "ghc${supportedGHCVersion}";
hsPkgs = pkgs.haskell.packages.${compilerVersion}.override {
overrides = hfinal: hprev: {
jonathanlorimerdev = hfinal.callCabal2nix "jonathanlorimerdev" ./. {};
};
};
});
in {
# nix fmt
formatter = forAllSystems ({pkgs, ...}: pkgs.alejandra);
# nix develop
devShell = forAllSystems (
{
hsPkgs,
pkgs,
...
}:
hsPkgs.shellFor {
packages = p: [
p.jonathanlorimerdev
];
buildInputs = with pkgs;
[
hsPkgs.haskell-language-server
haskellPackages.cabal-install
haskellPackages.ghcid
haskellPackages.fourmolu
haskellPackages.cabal-fmt
nodePackages.serve
dig
mprocs
watchexec
]
++ pkgs.lib.attrsets.attrValues (import ./scripts {
inherit pkgs;
ghcid = haskellPackages.ghcid;
cabal-install = haskellPackages.cabal-install;
});
}
);
# nix build
packages = forAllSystems ({hsPkgs, ...}: rec {
jonathanlorimerdev = hsPkgs.jonathanlorimerdev;
default = jonathanlorimerdev;
});
# nix run
apps = forAllSystems ({system, ...}: rec {
build-site = {
type = "app";
program = "${self.packages.${system}.jonathanlorimerdev}/bin/build-site";
};
default = build-site;
});
};
}