-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
65 lines (55 loc) · 2.04 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
hercules-ci-effects.inputs.nixpkgs.follows = "nixpkgs";
hercules-ci-effects.inputs.flake-parts.follows = "flake-parts";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ withSystem, ... }: {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.haskell-flake.flakeModule
inputs.git-hooks-nix.flakeModule
inputs.hercules-ci-effects.flakeModule
];
perSystem = { config, self', pkgs, ... }: {
checks.nixos = pkgs.testers.runNixOSTest {
imports = [ ./example-nixos/test.nix ];
defaults = { pkgs, ... }: {
imports = [ ./example-nixos/warp-systemd-example.nix ];
services.warp-systemd-example.package = withSystem pkgs.stdenv.hostPlatform.system ({ config, ... }:
config.packages.default
);
};
};
haskellProjects."project" = {
# all defaults
};
devShells.default = config.devShells.project.overrideAttrs (o: {
shellHook = ''
${o.shellHook}
${config.pre-commit.installationScript}
echo "Welcome to the dev shell!"
'';
nativeBuildInputs = o.nativeBuildInputs ++ [ pkgs.haskellPackages.releaser ];
});
packages.default = config.packages.project-warp-systemd;
pre-commit.settings.hooks = {
nixpkgs-fmt.enable = true;
ormolu.enable = true;
};
};
herculesCI.ciSystems = [ "x86_64-linux" "aarch64-darwin" ];
hercules-ci.flake-update = {
enable = true;
when = {
dayOfMonth = [ 3 ];
};
};
});
}