mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Merge pull request #291 from genebean/per_os_shell_config
Broke shell config bits out to OS-specific files
This commit is contained in:
commit
a990d9d83c
4 changed files with 29 additions and 20 deletions
|
|
@ -87,6 +87,7 @@
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
users.${user}.imports = [
|
users.${user}.imports = [
|
||||||
./modules/home-manager
|
./modules/home-manager
|
||||||
|
./modules/home-manager/darwin.nix
|
||||||
];
|
];
|
||||||
extraSpecialArgs = { inherit genebean-omp-themes; };
|
extraSpecialArgs = { inherit genebean-omp-themes; };
|
||||||
};
|
};
|
||||||
|
|
|
||||||
21
modules/home-manager/darwin.nix
Normal file
21
modules/home-manager/darwin.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ pkgs, genebean-omp-themes, ... }: {
|
||||||
|
# dawrwin-specific shell config
|
||||||
|
programs.zsh = {
|
||||||
|
initExtra = ''
|
||||||
|
function otpon() {
|
||||||
|
osascript -e 'tell application "yubiswitch" to KeyOn'
|
||||||
|
}
|
||||||
|
function otpoff() {
|
||||||
|
osascript -e 'tell application "yubiswitch" to KeyOff'
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
oh-my-zsh.plugins = [ "macos" ];
|
||||||
|
shellAliases = {
|
||||||
|
currentwifi = "networksetup -getairportnetwork en0 |cut -d ':' -f2- | cut -d ' ' -f2-";
|
||||||
|
nixup = "darwin-rebuild switch --flake ~/repos/dots";
|
||||||
|
uwgconnect = "networksetup -setairportnetwork en0 SecureWest";
|
||||||
|
uwgforget = "networksetup -removepreferredwirelessnetwork en0 SecureWest";
|
||||||
|
ykey = "pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -164,25 +164,6 @@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export GPG_TTY=$(tty)
|
export GPG_TTY=$(tty)
|
||||||
|
|
||||||
if [[ `uname` == 'Linux' ]]; then
|
|
||||||
alias uwgconnect='nmcli dev wifi connect SecureWest password'
|
|
||||||
alias uwgforget='nmcli connection delete SecureWest'
|
|
||||||
alias ykey='sudo systemctl restart pcscd && sudo pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L'
|
|
||||||
else
|
|
||||||
alias currentwifi='networksetup -getairportnetwork en0 |cut -d ":" -f2- | cut -d " " -f2-'
|
|
||||||
alias uwgconnect='networksetup -setairportnetwork en0 SecureWest'
|
|
||||||
alias uwgforget='networksetup -removepreferredwirelessnetwork en0 SecureWest'
|
|
||||||
alias ykey='pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L'
|
|
||||||
fi
|
|
||||||
if [[ `uname` != 'Linux' ]]; then
|
|
||||||
function otpon() {
|
|
||||||
osascript -e 'tell application "yubiswitch" to KeyOn'
|
|
||||||
}
|
|
||||||
function otpoff() {
|
|
||||||
osascript -e 'tell application "yubiswitch" to KeyOff'
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -193,7 +174,6 @@
|
||||||
"github"
|
"github"
|
||||||
"history"
|
"history"
|
||||||
"kubectl"
|
"kubectl"
|
||||||
"macos"
|
|
||||||
"pip"
|
"pip"
|
||||||
"terraform"
|
"terraform"
|
||||||
"vagrant"
|
"vagrant"
|
||||||
|
|
@ -204,6 +184,7 @@
|
||||||
beo = "bundle exec onceover run spec --trace --force";
|
beo = "bundle exec onceover run spec --trace --force";
|
||||||
biv = "bundle install --path=vendor/bundle";
|
biv = "bundle install --path=vendor/bundle";
|
||||||
ce = "code-exploration";
|
ce = "code-exploration";
|
||||||
|
dots = "cd ~/repos/dots";
|
||||||
gbc = ''
|
gbc = ''
|
||||||
git branch --merged | command grep -vE "^(\*|\s*(main|master|develop|production)\s*$)" | command xargs -n 1 git branch -d
|
git branch --merged | command grep -vE "^(\*|\s*(main|master|develop|production)\s*$)" | command xargs -n 1 git branch -d
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
# Linux-specific aliases
|
||||||
|
zsh.shellAliases = {
|
||||||
|
uwgconnect = "nmcli dev wifi connect SecureWest password";
|
||||||
|
uwgforget = "nmcli connection delete SecureWest";
|
||||||
|
ykey = "sudo systemctl restart pcscd && sudo pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L";
|
||||||
|
};
|
||||||
# Using file in ./files/waybar/ to configure waybar
|
# Using file in ./files/waybar/ to configure waybar
|
||||||
waybar.enable = true;
|
waybar.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue