-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
executable file
·76 lines (65 loc) · 1.53 KB
/
Copy pathshell.nix
File metadata and controls
executable file
·76 lines (65 loc) · 1.53 KB
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
{ pkgs ? import <nixpkgs> {
overlays = [
(import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
];
}
}:
let
rustToolchain = pkgs.rust-bin.stable."1.91.0".default;
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
perl
perlPackages.locallib
perlPackages.Appcpanminus
perlPackages.LWPProtocolHttps
perlPackages.IOSocketSSL
perlPackages.MozillaCA
cacert
caddy
mariadb
# Native deps for XML::Parser
expat
pkg-config
# Native deps for LWP::UserAgent and friends
openssl
zlib
which
emacs-nox
fish
tmux
fishPlugins.nvm
virtualenv
gitFull
ansible
curl
docker
docker-compose
go
wget
packer
imagemagick
libusb1
rustToolchain
(php.withExtensions ({ enabled, all }: enabled ++ [
all.xdebug
all.imagick
all.mailparse
]))
];
shellHook = ''
if [ -z "$TMUX" ]; then
SESSION_NAME=default
FISH=$(command -v fish)
# Get the absolute path to the repo root (where .config lives)
# Try git first, then fall back to resolving from current directory
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || realpath . 2>/dev/null || pwd)"
CONFIG_HOME="$REPO_ROOT/.config"
if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
exec tmux attach-session -t "$SESSION_NAME"
else
exec tmux new-session -s "$SESSION_NAME" "XDG_CONFIG_HOME=\"$CONFIG_HOME\" exec $FISH"
fi
fi
'';
}