-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
118 lines (101 loc) · 2.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
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
{
description = "hydra-auction";
inputs = {
cardano-hydra.url = "github:input-output-hk/hydra/9f1027e0fdff6765f5233f19c4639fdaa3558bfa";
nixpkgs.follows = "cardano-hydra/nixpkgs";
haskell-nix.follows = "cardano-hydra/haskellNix";
iohk-nix.follows = "cardano-hydra/iohk-nix";
flake-utils.follows = "cardano-hydra/flake-utils";
cardano-node.follows = "cardano-hydra/cardano-node";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
pre-commit-hooks-nix = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
hci-effects = {
url = "github:hercules-ci/hercules-ci-effects";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
};
outputs = inputs:
let
flakeModules = {
haskell = ./nix/haskell;
chap = ./nix/chap;
utils = ./nix/utils;
};
in
inputs.flake-parts.lib.mkFlake { inherit inputs; } ({ self, ... }: {
imports = [
inputs.pre-commit-hooks-nix.flakeModule
inputs.hci-effects.flakeModule
./hydra-auction
] ++ (builtins.attrValues flakeModules);
# `nix flake show --impure` hack
systems =
if builtins.hasAttr "currentSystem" builtins
then [ builtins.currentSystem ]
else inputs.nixpkgs.lib.systems.flakeExposed;
herculesCI.ciSystems = [ "x86_64-linux" ];
hercules-ci.flake-update = {
enable = true;
updateBranch = "hci/update-flake-lock";
createPullRequest = true;
autoMergeMethod = null;
when = {
minute = 45;
hour = 12;
dayOfWeek = "Sun";
};
};
flake.flakeModules = flakeModules;
perSystem =
{ config
, pkgs
, lib
, self'
, system
, ...
}: {
_module.args.pkgs = import self.inputs.nixpkgs {
inherit system;
config.allowBroken = true;
};
pre-commit.settings = {
hooks = {
deadnix.enable = true;
nixpkgs-fmt.enable = true;
typos.enable = true;
fourmolu.enable = true;
};
tools = {
fourmolu = lib.mkForce (pkgs.callPackage ./nix/fourmolu {
mkHaskellPackage = config.libHaskell.mkPackage;
});
};
settings = {
deadnix.edit = true;
};
excludes = [
".materialized"
];
};
devShells = {
default = pkgs.mkShell {
shellHook = config.pre-commit.installationScript;
nativeBuildInputs = [
pkgs.fd
];
inputsFrom = [
self'.devShells.hydra-auction
];
};
};
};
});
}