-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
55 lines (52 loc) · 1.53 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
{
inputs.dream2nix.url = "github:nix-community/dream2nix";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
outputs =
{ self
, dream2nix
, nixpkgs
, pre-commit-hooks
} @ inputs:
let
# nixpkgs = dream2nix.inputs.nixpkgs;
l = nixpkgs.lib // builtins;
systems = [ "x86_64-linux" ];
forAllSystems = f:
l.genAttrs systems (
system:
f system (nixpkgs.legacyPackages.${system})
);
d2n-flake = inputs.dream2nix.lib.makeFlakeOutputs {
inherit systems;
config.projectRoot = ./.;
source = ./.;
projects = ./projects.toml;
};
in
dream2nix.lib.dlib.mergeFlakes [
d2n-flake
{
devShells = forAllSystems (system: pkgs: (
l.optionalAttrs (d2n-flake ? devShells.${system}.default.overrideAttrs) {
default = d2n-flake.devShells.${system}.default.overrideAttrs (old: {
inherit (self.checks.${system}.pre-commit-check) shellHook;
buildInputs = old.buildInputs ++ [
# Add additional packages for the devShell here.
pkgs.yarn
pkgs.pre-commit
];
});
}
));
}
{
checks = forAllSystems (system: pkgs: ({
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = import ./pre-commit-hooks.nix { inherit pkgs; };
};
}));
}
];
}