-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
77 lines (72 loc) · 2.32 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
{
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";
cyanprint.url = "github:AtomiCloud/sulfone.iridium";
# registry
nixpkgs.url = "nixpkgs/d816b5ab44187a2dd84806630ce77a733724f95f";
nixpkgs-2305.url = "nixpkgs/nixos-23.05";
nixpkgs-sep-04-23.url = "nixpkgs/d816b5ab44187a2dd84806630ce77a733724f95f";
nixpkgs-nov-08-23.url = "nixpkgs/85f1ba3e51676fa8cc604a3d863d729026a6b8eb";
atomipkgs.url = "github:kirinnee/test-nix-repo/v22.2.0";
atomipkgs_classic.url = "github:kirinnee/test-nix-repo/classic";
};
outputs =
{ self
# utils
, flake-utils
, treefmt-nix
, pre-commit-hooks
, cyanprint
# registries
, atomipkgs
, atomipkgs_classic
, nixpkgs
, nixpkgs-2305
, nixpkgs-sep-04-23
, nixpkgs-nov-08-23
} @inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs-2305 = nixpkgs-2305.legacyPackages.${system};
pkgs-sep-04-23 = nixpkgs-sep-04-23.legacyPackages.${system};
pkgs-nov-08-23 = nixpkgs-nov-08-23.legacyPackages.${system};
atomi = atomipkgs.packages.${system};
atomi_classic = atomipkgs_classic.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 atomi_classic pkgs-2305 pkgs-sep-04-23 pkgs-nov-08-23;
} // { cyanprint = cyanprint.packages.${system}.default; };
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;
}
);
}