bash, direnv

This commit is contained in:
2026-02-03 23:14:35 +01:00
parent c2b6197b82
commit 48027eb89b
7 changed files with 132 additions and 1 deletions

10
modules/bash.nix Normal file
View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.bash = {
promptInit = ''PS1="$(${pkgs.ncurses}/bin/tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(${pkgs.ncurses}/bin/tput sgr0) "'';
interactiveShellInit = ''
set -o vi
'';
completion.enable = true;
};
}

42
modules/direnv.nix Normal file
View File

@@ -0,0 +1,42 @@
{ pkgs, ... }:
let
nixify = pkgs.writers.writeDashBin "nixify" ''
set -efuC
if [ ! -e ./.envrc ]; then
echo use_nix > .envrc
direnv allow
fi
if [ ! -e shell.nix ]; then
cat > shell.nix <<'EOF'
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
packages = [];
}
EOF
''${EDITOR:-vim} shell.nix
fi
'';
in
{
environment.systemPackages = [
pkgs.direnv
nixify
];
home-manager.users.me.programs.direnv = {
enable = true;
stdlib = builtins.readFile "${
pkgs.fetchFromGitHub {
owner = "Mic92";
repo = "dotfiles";
rev = "a0a9b7e358fa70a85cd468f8ca1fbb02ae0a91df";
sha256 = "1y9h5s1lf59sczsm0ksq2x1yhl98ba9lwk5yil3q53rg7n4574pg";
}
}/home/.direnvrc";
};
programs.zsh.interactiveShellInit = ''
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
'';
}

View File

@@ -1,5 +1,18 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
environment.variables.TERMINAL = lib.getExe pkgs.alacritty;
programs.ydotool.enable = true;
environment.systemPackages = [
pkgs.dragon-drop
pkgs.wmctrl
pkgs.wl-clipboard
pkgs.libnotify
pkgs.wdisplays
pkgs.nsxiv
];
programs.niri = {
enable = true;
package = pkgs.niri-kmein;

View File

@@ -11,4 +11,12 @@
"flakes"
];
};
programs.nix-index.enable = true;
environment.systemPackages = [
pkgs.nil
pkgs.nixfmt
pkgs.nix-prefetch-git
];
}

View File

@@ -31,6 +31,18 @@ in
pkgs.gdu
pkgs.rmlint
pkgs.binutils # for objdump, strings, etc.
pkgs.gnumake # for make
pkgs.tokei # for code statistics
pkgs.man-pages
pkgs.man-pages-posix
pkgs.dos2unix
pkgs.whois
pkgs.dnsutils
pkgs.aria2
pkgs.jq
pkgs.yq
pkgs.bc
@@ -38,6 +50,8 @@ in
pkgs.vimv
pkgs.pciutils # for lspci
pkgs.tmux
]
++ lib.optionals (!isDarwin) [
pkgs.usbutils # for lsusb
@@ -102,6 +116,9 @@ in
ls = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso";
ll = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso -l";
la = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all -l";
o = "${pkgs.xdg-open}/bin/xdg-open";
ns = "nix-shell --run zsh";
}
// (
if isDarwin then
@@ -117,4 +134,41 @@ in
uj = "${pkgs.systemd}/bin/journalctl --user";
}
);
programs.tmux = {
enable = true;
keyMode = "vi";
clock24 = true;
terminal = "screen-256color";
baseIndex = 1;
aggressiveResize = true;
escapeTime = 50;
historyLimit = 7000;
shortcut = "b";
extraConfig = ''
set -g mouse on
unbind *
bind * list-clients
# naVIgate
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use C-h and C-l to cycle through panes
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
setw -g monitor-activity on
set -g visual-activity on
set -g status-interval 2
set -g status-left-length 32
set -g status-right-length 150
set -g status-position bottom
'';
};
}

View File

@@ -21,6 +21,8 @@ in
FZF_ALT_C_COMMAND = "${lib.getExe pkgs.fd}/bin/fd --type d";
};
users.defaultUserShell = pkgs.zsh;
programs.zsh =
let
zsh-completions = pkgs.fetchFromGitHub {