-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
67 lines (63 loc) · 1.82 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
{
inputs = {
# util
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
# registry
nixpkgs.url = "nixpkgs/d816b5ab44187a2dd84806630ce77a733724f95f";
nixpkgs-2305.url = "nixpkgs/nixos-23.05";
nixpkgs-feb-23-24.url = "nixpkgs/0e74ca98a74bc7270d28838369593635a5db3260";
atomipkgs.url = "github:kirinnee/test-nix-repo/v27.0.0";
};
outputs =
{ self
# utils
, flake-utils
, treefmt-nix
, pre-commit-hooks
# registries
, atomipkgs
, nixpkgs
, nixpkgs-2305
, nixpkgs-feb-23-24
} @inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs-2305 = nixpkgs-2305.legacyPackages.${system};
pkgs-feb-23-24 = nixpkgs-feb-23-24.legacyPackages.${system};
atomi = atomipkgs.packages.${system};
pre-commit-lib = pre-commit-hooks.lib.${system};
in
let
out = rec {
pre-commit = import ./nix/pre-commit.nix {
inherit pre-commit-lib formatter packages;
};
formatter = import ./nix/fmt.nix {
inherit treefmt-nix pkgs;
};
packages = import ./nix/packages.nix {
inherit pkgs atomi pkgs-2305 pkgs-feb-23-24;
};
env = import ./nix/env.nix {
inherit pkgs packages;
};
devShells = import ./nix/shells.nix {
inherit pkgs env packages;
shellHook = checks.pre-commit-check.shellHook;
};
checks = {
pre-commit-check = pre-commit;
format = formatter;
};
};
in
with out;
{
inherit checks formatter packages devShells;
}
);
}