-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
109 lines (103 loc) · 2.62 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
description = "NixOS module for an xmonad session";
nixConfig = {
extra-substituters = "https://mrcjkb.cachix.org";
extra-trusted-public-keys = "mrcjkb.cachix.org-1:KhpstvH5GfsuEFOSyGjSTjng8oDecEds7rbrI96tjA4=";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
zen-browser.url = "github:mrcjkb/zen-browser-flake";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs @ {
self,
nixpkgs,
pre-commit-hooks,
flake-utils,
...
}: let
supportedSystems = [
"aarch64-linux"
"x86_64-linux"
];
overlay = import ./nix/overlay.nix {};
in
flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
overlay
];
};
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
alejandra = {
enable = true;
excludes = [
"xmobar-app/default.nix"
"xmonadrc/default.nix"
];
};
cabal2nix.enable = true;
editorconfig-checker.enable = true;
markdownlint.enable = true;
fourmolu.enable = true;
# hpack.enable = true;
hlint.enable = true;
};
};
shell = pkgs.haskellPackages.shellFor {
name = "xmonadrc-devShell";
packages = p:
with p; [
xmonadrc
xmobar-app
];
withHoogle = true;
buildInputs =
(with pkgs; [
haskell-language-server
cabal-install
zlib
])
++ (with pkgs.haskellPackages; [
implicit-hie
])
++ self.checks.${system}.pre-commit-check.enabledPackages;
shellHook = ''
${self.checks.${system}.pre-commit-check.shellHook}
gen-hie --cabal > hie.yaml
'';
};
in {
devShells = {
default = shell;
};
packages = rec {
default = xmobar-app;
xmobar-app = pkgs.haskellPackages.xmobar-app;
};
checks = {
inherit pre-commit-check;
};
})
// {
nixosModules.default = {pkgs, ...}: {
imports = [
./nix/xmonad-session
];
nixpkgs.overlays = [
overlay
];
environment.systemPackages = [
inputs.zen-browser.packages."${pkgs.system}".default
];
};
overlays.default = overlay;
};
}