-
Notifications
You must be signed in to change notification settings - Fork 2
/
shell.nix
executable file
·50 lines (48 loc) · 1.22 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
# Shell for bootstrapping flake-enabled nix and other tooling
# You can enter it through 'nix develop' or (legacy) 'nix-shell'
{
pkgs ?
# If pkgs is not defined, instantiate nixpkgs from locked commit
let
lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
nixpkgs = fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
};
in
import nixpkgs {},
checks,
...
}: {
default = pkgs.mkShell {
NIX_CONFIG = "use-xdg-base-directories = true\nextra-experimental-features = nix-command flakes";
PKCS = "${pkgs.opensc}/lib/opensc-pkcs11.so";
buildInputs = checks.${pkgs.system}.pre-commit-check.enabledPackages;
nativeBuildInputs = with pkgs; [
# Nix toolkit
nix
nix-output-monitor
nix-inspect
deadnix
statix
home-manager
# Encryption tools
vim # Needed for agenix
age
age-plugin-yubikey
agenix
gnupg
openssh
# Git setup
git
just
git-credential-oauth
git-crypt
pre-commit
];
shellHook = ''
${checks.${pkgs.system}.pre-commit-check.shellHook}
export EDITOR=vim
'';
};
}