Compare commits

...

5 Commits

Author SHA1 Message Date
Joey Hafner
e66a0d48a9 Add enableSmartCommit
Some checks are pending
SSH and echo to file / ssh (push) Waiting to run
2024-10-16 21:41:14 -07:00
Joey Hafner
725e5a26a1 Add thunar file manager, remove dolphin 2024-10-16 21:39:57 -07:00
Joey Hafner
2ac5ee8d7c Add bottles 2024-10-16 21:39:35 -07:00
Joey Hafner
2002a3e803 Add rofi-rbw keybind 2024-10-16 21:38:58 -07:00
Joey Hafner
158c9cb9d7 Switch from fzf-bw to rofi-bw 2024-10-16 21:37:21 -07:00
6 changed files with 29 additions and 52 deletions

View File

@ -1,54 +1,30 @@
{ pkgs, pkgs-unstable, ... }:
{
home.packages = with pkgs; [
bitwarden-cli
jq
wl-clipboard
tmux
( writeShellApplication {
name = "fzf-bw"; # { bwJson }: { itemPreviewJson }
runtimeInputs = [
wl-clipboard
( writeShellApplication {
name = "fzf-bw-getUser"; # { itemJson }: { itemUsername }
runtimeInputs = [ jq ];
text = ''echo "$1" | jq -r '.user' '';
} )
( writeShellApplication {
name = "fzf-bw-getPass"; # { itemJson }: { itemPassword }
runtimeInputs = [ jq ];
text = ''echo "$1" | jq -r '.password' '';
} )
( writeShellApplication {
name = "fzf-bw-getItem"; # { itemUuid, bwJson }: { itemJson }
runtimeInputs = [ jq ];
text = ''echo "$2" | jq -c --arg id "$1" '.[] | select(.id==$id) | {"user": "\(.login.username)", "password": "\(.login.password)", "name": "\(.name)"}' '';
} )
( writeShellApplication {
name = "fzf-bw-selector"; # { bwJson }: { itemUuid }
runtimeInputs = [ jq pkgs-unstable.fzf ];
text = ''export json="$1"; echo "$json" | jq -r '.[].id' | fzf --preview='fzf-bw-getItem {} "$json" | jq -C' --disabled '';
excludeShellChecks = [ "SC2016" ];
} )
( writeShellApplication {
name = "fzf-bw-selector-tmux"; # { bwJson }: { itemUuid }
runtimeInputs = [ jq pkgs-unstable.fzf ];
text = ''export json="$1"; echo "$json" | jq -r '.[].id' | fzf --tmux center,70% --preview='fzf-bw-getItem {} "$json" | jq -C' '';
excludeShellChecks = [ "SC2016" ];
} )
] ;
excludeShellChecks = [ "SC2016" ];
# Todo: Gracefully handle Ctrl+C canceling, offer method to directly print or copy a password, implement fzf-tmux.
# Roadmap: sops integration to decrypt passwords as late as possible, window-manager hotkey for quicker use in graphical applications.
text = ''export json="$1"; itemJson="$(fzf-bw-getItem "$(fzf-bw-selector "$json")" "$json")"; echo -n "Username: (copied to clipboard)"; fzf-bw-getUser "$itemJson" | wl-copy; read -r; echo "Password: (copied to clipboard)"; fzf-bw-getPass "$itemJson" | wl-copy; exit 0'';
} )
rofi-rbw-wayland
rbw
pinentry-rofi
pinentry-all
];
programs.zsh.loginExtra = ''
export $(bw unlock --passwordfile /home/joey/.bwtoken | grep export | sed 's/^\$\s//' | cut -d' ' -f2) 2>/dev/null
function bwf { search="$1"; fzf-bw "$(bw list items --search "$search")" }
function bwf-popup { search="$1"; kitty --title fzf-bw --override remember_window_size=no --override initial_window_width=960 --override initial_window_height=300 fzf-bw "$(bw list items --search $search)" }
'';
home.file = {
rbw-config = {
target = ".config/rbw/config.json";
text = ''
{
"email": "jafner425@gmail.com",
"sso_id": null,
"base_url": "https://bitwarden.jafner.tools",
"identity_url": null,
"ui_url": null,
"notifications_url": null,
"lock_timeout": 3600,
"sync_interval": 3600,
"pinentry": "pinentry-curses",
"client_cert_path": null
}
'';
};
};
}
# function { inputs }: { outputs }

View File

@ -19,6 +19,7 @@
"git.autofetch" = true;
"git.confirmSync" = false;
"editor.fontFamily" = lib.mkForce "'Symbols Nerd Font Mono', 'PowerlineSymbols', 'DejaVu Sans Mono'";
"git.enableSmartCommit" = true;
};
userTasks = {
version = "2.0.0";

View File

@ -1,6 +1,5 @@
{ pkgs, ... }:
{
wayland.windowManager.hyprland = {
enable = true;
plugins = [];
@ -17,8 +16,8 @@
"$screenshot" = "grimblast copy area";
# Scripted actions
"$commandRebuildNix" = "$terminal sudo nixos-rebuild switch --flake ~/Jafner.net/nix";
"$commandRebuildHomeManager" = "$terminal home-manager switch -b bak --flake ~/Jafner.net/nix";
"$commandRebuildNix" = "$terminal sudo nixos-rebuild switch --flake ~/Jafner.net/nix && read";
"$commandRebuildHomeManager" = "$terminal home-manager switch -b bak --flake ~/Jafner.net/nix && read";
exec-once = [
"$terminal"
@ -115,6 +114,7 @@
"$mainMod CTRL, Z, exec, $browser"
"$mainMod CTRL ALT, N, exec, $commandRebuildNix"
"$mainMod CTRL ALT, H, exec, $commandRebuildHomeManager"
"$mainMod CTRL, P, exec, rofi-rbw"
"$mainMod, left, movefocus, l"
"$mainMod, right, movefocus, r"
"$mainMod, up, movefocus, u"

View File

@ -4,5 +4,5 @@
nixpkgs.config.allowUnfree = true;
hardware.opengl.driSupport32Bit = true;
programs.steam.enable = true;
environment.systemPackages = [ pkgs.steam ];
environment.systemPackages = [ pkgs.steam pkgs.bottles-unwrapped ];
}

View File

@ -5,7 +5,7 @@
swww
wofi
polkit-kde-agent
dolphin
xfce.thunar
];
programs.hyprland = {
enable = true;