bash, direnv
This commit is contained in:
@@ -29,7 +29,9 @@
|
|||||||
git = modules/git.nix;
|
git = modules/git.nix;
|
||||||
udiskie = modules/udiskie.nix;
|
udiskie = modules/udiskie.nix;
|
||||||
niri = modules/niri;
|
niri = modules/niri;
|
||||||
|
bash = modules/bash.nix;
|
||||||
nix = modules/nix.nix;
|
nix = modules/nix.nix;
|
||||||
|
direnv = modules/direnv.nix;
|
||||||
|
|
||||||
tools = modules/tool.nix;
|
tools = modules/tool.nix;
|
||||||
};
|
};
|
||||||
|
|||||||
10
modules/bash.nix
Normal file
10
modules/bash.nix
Normal 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
42
modules/direnv.nix
Normal 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)"
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -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 = {
|
programs.niri = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.niri-kmein;
|
package = pkgs.niri-kmein;
|
||||||
|
|||||||
@@ -11,4 +11,12 @@
|
|||||||
"flakes"
|
"flakes"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.nix-index.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.nil
|
||||||
|
pkgs.nixfmt
|
||||||
|
pkgs.nix-prefetch-git
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,18 @@ in
|
|||||||
pkgs.gdu
|
pkgs.gdu
|
||||||
pkgs.rmlint
|
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.jq
|
||||||
pkgs.yq
|
pkgs.yq
|
||||||
pkgs.bc
|
pkgs.bc
|
||||||
@@ -38,6 +50,8 @@ in
|
|||||||
pkgs.vimv
|
pkgs.vimv
|
||||||
|
|
||||||
pkgs.pciutils # for lspci
|
pkgs.pciutils # for lspci
|
||||||
|
|
||||||
|
pkgs.tmux
|
||||||
]
|
]
|
||||||
++ lib.optionals (!isDarwin) [
|
++ lib.optionals (!isDarwin) [
|
||||||
pkgs.usbutils # for lsusb
|
pkgs.usbutils # for lsusb
|
||||||
@@ -102,6 +116,9 @@ in
|
|||||||
ls = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso";
|
ls = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso";
|
||||||
ll = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso -l";
|
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";
|
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
|
if isDarwin then
|
||||||
@@ -117,4 +134,41 @@ in
|
|||||||
uj = "${pkgs.systemd}/bin/journalctl --user";
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ in
|
|||||||
FZF_ALT_C_COMMAND = "${lib.getExe pkgs.fd}/bin/fd --type d";
|
FZF_ALT_C_COMMAND = "${lib.getExe pkgs.fd}/bin/fd --type d";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
|
||||||
programs.zsh =
|
programs.zsh =
|
||||||
let
|
let
|
||||||
zsh-completions = pkgs.fetchFromGitHub {
|
zsh-completions = pkgs.fetchFromGitHub {
|
||||||
|
|||||||
Reference in New Issue
Block a user