-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
48 lines (42 loc) · 1015 Bytes
/
shell.nix
File metadata and controls
48 lines (42 loc) · 1015 Bytes
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
{
pkgs ? import <nixpkgs> {},
doot,
}:
pkgs.mkShell {
packages = with pkgs; [
nixpkgs-fmt
sops
age
ssh-to-age
python3
yq-go
argc
doot
act
];
shellHook =
#bash
''
STATE_FILE="$PWD/.devshell/.initialized"
FIRST_RUN=false
if [ ! -f "$STATE_FILE" ]; then
FIRST_RUN=true
mkdir -p "$PWD/.devshell"
touch "$STATE_FILE"
fi
DOOT_CMD="doot"
if [ ! -d "$PWD/.direnv" ] && [ -z "$DIRENV_DIR" ]; then
ln -sf ${doot}/bin/doot ./doot
DOOT_CMD="./doot"
fi
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
RESET="\033[0m"
if [ "$FIRST_RUN" = true ]; then
echo -e "$GREEN🚀 '$DOOT_CMD' command is ready. Run '$DOOT_CMD' for usage.$RESET"
if [ "$FIRST_RUN" = true ] && [ "$DOOT_CMD" = "./doot" ]; then
echo -e "$YELLOW💡 Hint: For best experience, use nix-direnv → https://github.com/nix-community/nix-direnv$RESET"
fi
fi
'';
}