-
Notifications
You must be signed in to change notification settings - Fork 5
/
shell.nix
68 lines (61 loc) · 1.57 KB
/
shell.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
# Shell for bootstrapping flake-enabled nix and home-manager
# You can enter it through 'nix develop' or (legacy) 'nix-shell'
{ pkgs ? (import ./nixpkgs.nix) { }, nix-pre-commit, system }:
let
# Precomit configuration
config = {
repos = [
{
repo = "local";
hooks = [
{
id = "reorder-python-imports";
entry = "${pkgs.python310Packages.reorder-python-imports}/bin/reorder-python-imports";
language = "system";
types = [ "python" ];
}
{
id = "black";
entry = "${pkgs.python310Packages.black}/bin/black";
language = "system";
types = [ "python" ];
"args" = [
"--line-length=79"
];
}
{
id = "flake8";
entry = "${pkgs.python310Packages.flake8}/bin/flake8";
language = "system";
types = [ "python" ];
}
];
}
];
};
in
{
default = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [
nix
git
home-manager
borgbackup
vim
sops
gnupg
age
python3.pkgs.invoke
python3.pkgs.deploykit
python3.pkgs.xmltodict
wireguard-tools
openssl_3_0.bin
plantuml
] ++ lib.optional (stdenv.isLinux) mkpasswd;
shellHook = (nix-pre-commit.lib.${system}.mkConfig {
inherit pkgs config;
}).shellHook;
};
}