-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
123 lines (112 loc) · 2.99 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
119
120
121
122
123
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:chvp/devshell";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = inputs @ {
nixpkgs,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.devshell.flakeModule
inputs.pre-commit-hooks.flakeModule
];
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
perSystem = {
config,
pkgs,
system,
...
}: {
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = import ./overlays.nix;
config = {};
};
packages = import ./default.nix {
inherit pkgs;
inherit system;
};
pre-commit.settings.hooks = {
alejandra.enable = true;
deadnix.enable = true;
statix.enable = true;
};
devshells.default = {
packages = [
];
commands = [
{
package = pkgs.alejandra;
help = "Format nix code";
}
{
package = pkgs.statix;
help = "Lint nix code";
}
{
package = pkgs.deadnix;
help = "Find unused expressions in nix code";
}
{
package = pkgs.nix-tree;
help = "Interactively browse dependency graphs of Nix derivations";
}
{
package = pkgs.nvd;
help = "Diff two nix toplevels and show which packages were upgraded";
}
{
package = pkgs.nix-diff;
help = "Explain why two Nix derivations differ";
}
{
package = pkgs.nix-output-monitor;
help = "Nix Output Monitor (a drop-in alternative for `nix` which shows a build graph)";
}
{
package = pkgs.nix-update;
help = "Nix utils for update packages";
}
];
devshell.startup.pre-commit.text = config.pre-commit.installationScript;
env = [
];
};
# `nix fmt`
formatter = pkgs.alejandra;
};
};
# flake-utils.lib.eachDefaultSystem (system: let
# pkgs = import nixpkgs {
# inherit system;
# overlays = import ./overlays.nix;
# };
# in rec {
# packages = import ./default.nix {
# inherit pkgs;
# inherit system;
# };
# devShells = {
# default = pkgs.mkShell rec {
# buildInputs = with pkgs; [
# python3
# python3Packages.pip
# nix-update
# ];
# };
# };
# });
}