Refactoring, replace mcfly with fzf

This commit is contained in:
Arnie 2025-01-21 00:38:42 +01:00
parent a3e48a82ae
commit 7c993c502a
4 changed files with 188 additions and 146 deletions

View File

@ -4,6 +4,7 @@
pkgs,
...
}:
# TODO: implement plasma configuration
# TODO: Plasma does not see home manager installed packages
let
username = "becky";
@ -63,13 +64,13 @@ in
home.stateVersion = "24.11";
home.packages = with pkgs; [
nixd
android-tools
android-udev-rules
# TODO: Move from system to nix
# awscli2
# k9s
# kubectl
# Terminal image viewer
viu
tcpdump
];
xdg.configFile = lib.mkMerge [
@ -92,11 +93,6 @@ in
programs.vim.plugins = [ pkgs.ghostty.vim ];
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.git = {
enable = true;
userName = "Arnie";
@ -140,33 +136,6 @@ in
# };
# };
programs.htop = {
enable = true;
};
programs.jq = {
enable = true;
};
programs.k9s = {
enable = true;
settings = {
k9s = {
refreshRate = 2;
ui = {
logoless = true;
headless = true;
};
logger = {
tail = 1000;
sinceSeconds = 60 * 30;
fullScreen = true;
showtime = true;
};
};
};
};
programs.lsd = {
enable = true;
enableAliases = true;
@ -186,32 +155,67 @@ in
};
};
programs.mcfly = {
enable = true;
enableZshIntegration = true;
keyScheme = "vim";
# TODO: Test
fuzzySearchFactor = 1;
settings = {
colors = {
menubar = {
bg = "black";
fg = "red";
};
darkmode = {
prompt = "cyan";
timing = "yellow";
};
};
};
};
programs.pay-respects = {
enable = true;
enableZshIntegration = true;
};
# https://github.com/nix-community/plasma-manager
# https://nix-community.github.io/plasma-manager/options.xhtml
#https://github.com/HeitorAugustoLN/nix-config/tree/main/home/heitor/features/desktop/plasma
# ~/.config/kglobalshortcutsrc
programs.plasma = {
enable = true;
# killall kglobalaccel5; kglobalaccel5 &; disown
shortcuts = {
"org.kde.konsole.desktop" = {
_launch = "none";
};
"com.mitchellh.ghostty.desktop" = {
_launch = "Ctrl+Alt+T";
};
kded5 = {
display = [
"none"
"none"
"Switch Display"
];
};
ksmserver = {
"Lock Session" = "Meta+Ctrl+Q";
};
kwin = {
"Window Maximize" = "Meta+Ctrl+Alt+M";
"Window Quick Tile Bottom" = "Meta+Ctrl+Alt+Down";
"Window Quick Tile Left" = "Meta+Ctrl+Alt+Left";
"Window Quick Tile Right" = "Meta+Ctrl+Alt+Right";
"Window Quick Tile Top" = "Meta+Ctrl+Alt+Up";
"Walk Through Windows" = "Meta+Tab";
"Walk Through Windows (Reverse)" = "Meta+Shift+Tab";
"Walk Through Windows of Current Application" = "Meta+`";
"Walk Through Windows of Current Application (Reverse)" = "Meta+Shift+`";
"Window Close" = "Meta+W";
"Overview" = "Ctrl+Meta+Tab";
"Switch One Desktop to the Right" = "none";
"Switch One Desktop to the Left" = "none";
};
plasmashell = {
"next activity" = "Meta+Ctrl+Right";
"previous activity" = "Meta+Ctrl+Left";
};
};
};
# TODO: Configure
# programs.ssh = {
# enable = true;
@ -262,8 +266,8 @@ in
autoload -U +X bashcompinit && bashcompinit
source <(kubectl completion zsh)
complete -C '/usr/local/bin/aws_completer' aws
source <(${pkgs.kubectl}/bin/kubectl completion zsh)
complete -C '${pkgs.awscli2}/bin/aws_completer' aws
# Manual ghostty injection
if [[ -n $GHOSTTY_RESOURCES_DIR ]]; then
@ -298,6 +302,54 @@ in
Install.WantedBy = [ "timers.target" ];
};
# Total hack, not what HM is for
# Manually remove files if deleted here
home.activation.nfsRoute = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
/usr/bin/sudo ${pkgs.coreutils}/bin/ln -fs ${
pkgs.writeTextFile {
name = "nfs-route";
text = ''
# NFS
200 nfsroute
'';
}
} /etc/iproute2/rt_tables.d/20-nfs.conf
/usr/bin/sudo ${pkgs.coreutils}/bin/ln -fs ${pkgs.writeShellScript "nfs-route" ''
if [ "$IFACE" = "enp4s0" ]; then
if [ "$(ip route list table nfsroute exact 10.125.248.55 | grep enp4s0 | wc -l)" == "0" ]; then
ip route add 10.125.248.55 via 10.124.248.248 dev enp4s0 table nfsroute
fi
if [ "$(ip route list table nfsroute exact 10.125.248.33 | grep enp4s0 | wc -l)" == "0" ]; then
ip route add 10.125.248.33 via 10.124.248.248 dev enp4s0 table nfsroute
fi
if [ "$(ip rule list from 10.124.248.5 | ${pkgs.gnugrep}/bin/grep nfsroute | ${pkgs.coreutils}/bin/wc -l)" == "0" ]; then
ip rule add from 10.124.248.5 lookup nfsroute
fi
fi
''} /etc/network/if-up.d/nfs-route
/usr/bin/sudo ${pkgs.coreutils}/bin/mkdir -p /etc/network/if-post-down.d
/usr/bin/sudo ${pkgs.coreutils}/bin/ln -fs ${pkgs.writeShellScript "nfs-route" ''
if [ "$IFACE" = "enp4s0" ]; then
if [ "$(ip route list table nfsroute exact 10.125.248.55 | grep enp4s0 | wc -l)" != "0" ]; then
ip route del 10.125.248.55 via 10.124.248.248 dev enp4s0 table nfsroute
fi
if [ "$(ip route list table nfsroute exact 10.125.248.33 | grep enp4s0 | wc -l)" != "0" ]; then
ip route del 10.125.248.33 via 10.124.248.248 dev enp4s0 table nfsroute
fi
if [ "$(ip rule list from 10.124.248.5 | ${pkgs.gnugrep}/bin/grep nfsroute | ${pkgs.coreutils}/bin/wc -l)" != "0" ]; then
ip rule del from 10.124.248.5 lookup nfsroute
fi
fi
''} /etc/network/if-post-down.d/nfs-route
'';
home.sessionVariables = {
EDITOR = "vim";
GO111MODULE = "on";

View File

@ -10,6 +10,18 @@ let
isLinux = pkgs.stdenv.hostPlatform.isLinux;
in
{
imports = [
(import ./nix-init-scripts.nix {
inherit lib pkgs;
})
];
home.packages = with pkgs; [
awscli2
kubectl
nixd
viu
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
@ -18,6 +30,71 @@ in
enable = true;
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.htop = {
enable = true;
};
programs.k9s = {
enable = true;
settings = {
k9s = {
refreshRate = 2;
ui = {
logoless = true;
headless = true;
skin = "darkerbg";
};
logger = {
tail = 1000;
sinceSeconds = 60 * 30;
fullScreen = true;
showtime = true;
};
};
};
skins = {
darkerbg = {
k9s = {
body = {
bgColor = "#333";
};
frame = {
title = {
bgColor = "#333";
};
};
views = {
table = {
bgColor = "#333";
header = {
bgColor = "#333";
};
};
logs = {
bgColor = "#333";
};
};
};
};
};
};
programs.jq = {
enable = true;
};
programs.vim = {
enable = true;
settings = {

View File

@ -15,9 +15,6 @@ in
(import ./veracode/aws-cli.nix {
inherit homedir lib pkgs;
})
(import ./nix-init-scripts.nix {
inherit lib pkgs;
})
];
home.username = username;
@ -27,11 +24,7 @@ in
home.stateVersion = "24.11";
home.packages = with pkgs; [
awscli2
hammerspoon
k9s
kubectl
nixd
pstree
watch
colima
@ -54,11 +47,6 @@ in
};
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.git = {
enable = true;
userName = "Lukas Cech";
@ -83,61 +71,6 @@ in
};
};
programs.htop = {
enable = true;
};
programs.jq = {
enable = true;
};
programs.k9s = {
enable = true;
settings = {
k9s = {
refreshRate = 2;
ui = {
logoless = true;
headless = true;
skin = "darkerbg";
};
logger = {
tail = 1000;
sinceSeconds = 60 * 30;
fullScreen = true;
showtime = true;
};
};
};
skins = {
darkerbg = {
k9s = {
body = {
bgColor = "#333";
};
frame = {
title = {
bgColor = "#333";
};
};
views = {
table = {
bgColor = "#333";
header = {
bgColor = "#333";
};
};
logs = {
bgColor = "#333";
};
};
};
};
};
};
programs.lsd = {
enable = true;
enableAliases = true;
@ -157,27 +90,6 @@ in
};
};
programs.mcfly = {
enable = true;
enableZshIntegration = true;
keyScheme = "vim";
# TODO: Test
fuzzySearchFactor = 1;
settings = {
colors = {
menubar = {
bg = "black";
fg = "red";
};
darkmode = {
prompt = "cyan";
timing = "yellow";
};
};
};
};
programs.pay-respects = {
enable = true;
enableZshIntegration = true;

View File

@ -54,6 +54,7 @@ in
{
programs.zsh.shellAliases = {
git-nix-clone = lib.mkDefault "${pkgs.writeShellScript "git-nix-clone" git-nix-clone}";
nix-prepare = lib.mkDefault "${pkgs.writeShellScript "nix-prepare" nix-prepare}";
};
}