-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
151 lines (150 loc) · 5.34 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
description = "intray";
nixConfig = {
extra-substituters = "https://intray.cachix.org";
extra-trusted-public-keys = "intray.cachix.org-1:qD7I/NQLia2iy6cbzZvFuvn09iuL4AkTmHvjxrQlccQ=";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-24.05";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
haskell-dependency-graph-nix.url = "github:NorfairKing/haskell-dependency-graph-nix";
haskell-dependency-graph-nix.inputs.nixpkgs.follows = "nixpkgs";
haskell-dependency-graph-nix.inputs.pre-commit-hooks.follows = "pre-commit-hooks";
weeder-nix.url = "github:NorfairKing/weeder-nix";
weeder-nix.flake = false;
validity.url = "github:NorfairKing/validity";
validity.flake = false;
autodocodec.url = "github:NorfairKing/autodocodec";
autodocodec.flake = false;
safe-coloured-text.url = "github:NorfairKing/safe-coloured-text";
safe-coloured-text.flake = false;
fast-myers-diff.url = "github:NorfairKing/fast-myers-diff";
fast-myers-diff.flake = false;
sydtest.url = "github:NorfairKing/sydtest";
sydtest.flake = false;
opt-env-conf.url = "github:NorfairKing/opt-env-conf";
opt-env-conf.flake = false;
mergeless.url = "github:NorfairKing/mergeless";
mergeless.flake = false;
dekking.url = "github:NorfairKing/dekking";
dekking.flake = false;
};
outputs =
{ self
, nixpkgs
, pre-commit-hooks
, haskell-dependency-graph-nix
, weeder-nix
, validity
, safe-coloured-text
, sydtest
, opt-env-conf
, fast-myers-diff
, autodocodec
, mergeless
, dekking
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
self.overlays.${system}
(import (autodocodec + "/nix/overlay.nix"))
(import (safe-coloured-text + "/nix/overlay.nix"))
(import (sydtest + "/nix/overlay.nix"))
(import (opt-env-conf + "/nix/overlay.nix"))
(import (fast-myers-diff + "/nix/overlay.nix"))
(import (mergeless + "/nix/overlay.nix"))
(import (validity + "/nix/overlay.nix"))
(import (dekking + "/nix/overlay.nix"))
(import (weeder-nix + "/nix/overlay.nix"))
];
};
pkgsMusl = pkgs.pkgsMusl;
in
{
overlays.${system} = import ./nix/overlay.nix;
packages.${system} = {
default = self.packages.${system}.dynamic;
# static = pkgsMusl.intrayRelease;
dynamic = pkgs.intrayRelease;
};
apps.${system}.default = { type = "app"; program = "${pkgs.intrayReleasePackages.intray-cli}/bin/intray"; };
lib.${system}.intrayNotification = pkgs.intrayNotification;
checks.${system} = {
release = self.packages.${system}.default;
# static = self.packages.${system}.static;
dynamic = self.packages.${system}.dynamic;
coverage-report = pkgs.dekking.makeCoverageReport {
name = "test-coverage-report";
packages = [
"intray-cli"
"intray-api"
"intray-cli-data"
"intray-client"
];
coverage = [
"intray-api-gen"
];
};
dependency-graph = haskell-dependency-graph-nix.lib.${system}.makeDependencyGraph {
packages = builtins.attrNames pkgs.haskellPackages.intrayPackages;
inherit (pkgs) haskellPackages;
};
weeder-check = pkgs.weeder-nix.makeWeederCheck {
weederToml = ./weeder.toml;
packages = builtins.attrNames pkgs.haskellPackages.intrayPackages;
};
pre-commit = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
cabal2nix.enable = true;
deadnix.enable = true;
deadnix.excludes = [ ".*/default.nix" ];
hlint.enable = true;
hpack.enable = true;
nixpkgs-fmt.enable = true;
nixpkgs-fmt.excludes = [ ".*/default.nix" ];
ormolu.enable = true;
};
};
};
devShells.${system}.default = pkgs.haskellPackages.shellFor {
name = "intray-shell";
packages = p: builtins.attrValues p.intrayPackages;
withHoogle = true;
doBenchmark = true;
buildInputs = with pkgs; [
zlib
cabal-install
] ++ self.checks.${system}.pre-commit.enabledPackages;
shellHook = self.checks.${system}.pre-commit.shellHook;
};
nixosModules.${system} = {
serviceNotifications = import ./nix/service-notifications.nix { inherit (pkgs.intrayRelease) notification; };
};
homeManagerModules.${system} = {
default = self.homeManagerModules.${system}.dynamic;
static = import ./nix/home-manager-module.nix {
inherit (pkgsMusl.intrayReleasePackages) intray-cli;
inherit (pkgsMusl.haskellPackages) opt-env-conf;
};
dynamic = import ./nix/home-manager-module.nix {
inherit (pkgs.intrayReleasePackages) intray-cli;
inherit (pkgs.haskellPackages) opt-env-conf;
};
};
nix-ci = {
auto-update = {
enable = true;
base = "development";
};
cachix = {
name = "intray";
public-key = "intray.cachix.org-1:qD7I/NQLia2iy6cbzZvFuvn09iuL4AkTmHvjxrQlccQ=";
};
};
};
}