mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-09 19:03:36 +02:00
feat: update for shells
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
_: {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
bashrcExtra = ''
|
||||
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
k = "kubectl";
|
||||
|
||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./nushell
|
||||
./shells
|
||||
./tmux
|
||||
./zellij
|
||||
|
||||
./bash.nix
|
||||
./bat.nix
|
||||
./btop.nix
|
||||
./core.nix
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{config, ...}: {
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
configFile.source = ./config.nu;
|
||||
|
||||
# home-manager will merge the cotent in `environmentVariables` with the `envFile.source`
|
||||
# but basically, I set all environment variables via the shell-independent way, so I don't need to use those two options
|
||||
#
|
||||
# envFile.source = ./env.nu;
|
||||
# environmentVariables = { FOO="bar"; };
|
||||
|
||||
shellAliases = {
|
||||
k = "kubectl";
|
||||
|
||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||
};
|
||||
};
|
||||
}
|
||||
25
home/base/server/shells/default.nix
Normal file
25
home/base/server/shells/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
let
|
||||
shellAliases = {
|
||||
k = "kubectl";
|
||||
|
||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||
};
|
||||
in {
|
||||
# only works in bash/zsh, not nushell
|
||||
home.shellAliases = shellAliases;
|
||||
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
configFile.source = ./config.nu;
|
||||
shellAliases = shellAliases;
|
||||
};
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
bashrcExtra = ''
|
||||
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
../base/desktop
|
||||
|
||||
./proxychains
|
||||
|
||||
./core.nix
|
||||
./rime-squirrel.nix
|
||||
./shell.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
|
||||
10
home/darwin/shell.nix
Normal file
10
home/darwin/shell.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
_: {
|
||||
# add homebrew into PATH
|
||||
|
||||
programs.bash.bashrcExtra = ''
|
||||
export PATH="/opt/homebrew/bin:$PATH"
|
||||
'';
|
||||
programs.zsh.envExtra = ''
|
||||
export PATH="/opt/homebrew/bin:$PATH"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user