-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
82 lines (69 loc) · 1.93 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
80
81
82
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
# systems = nixpkgs.lib.systems.flakeExposed;
systems = ["x86_64-linux"];
imports = [
inputs.haskell-flake.flakeModule
inputs.treefmt-nix.flakeModule
];
perSystem = {
self',
pkgs,
config,
...
}: {
haskellProjects.default = {
packages = {};
settings = {};
devShell.hlsCheck.enable = false;
autoWire = ["packages" "checks"];
};
packages.pages = pkgs.stdenv.mkDerivation {
name = "pages";
LOCALE_ARCHIVE =
pkgs.lib.optionalString
(pkgs.buildPlatform.libc == "glibc")
"${pkgs.glibcLocales}/lib/locale/locale-archive";
src = ./.;
buildPhase = ''
export LANG="en_US.UTF-8";
${self'.packages.daan-rs}/bin/daan-rs build
'';
installPhase = ''
mkdir -p $out
cp -r _site $out/dist
'';
};
treefmt.config = {
projectRootFile = "flake.nix";
programs.ormolu.enable = true;
programs.alejandra.enable = true;
programs.cabal-fmt.enable = true;
programs.hlint.enable = true;
};
devShells.default = pkgs.mkShell {
name = "default";
inputsFrom = [
config.haskellProjects.default.outputs.devShell
config.treefmt.build.devShell
];
nativeBuildInputs = with pkgs; [
just
];
};
};
};
}