From 94ffc74abdbdad7b5b3a6a21156929ba7aad049a Mon Sep 17 00:00:00 2001 From: Sergei Bulavintsev Date: Wed, 31 Jan 2024 17:38:41 +0300 Subject: [PATCH] fix(nix): use pinentry-gnome for rbw --- .../nixos/desktop/addons/gtk/default.nix | 7 ++ .../nixos/desktop/addons/rofi/default.nix | 2 +- nix/modules/nixos/suites/desktop/default.nix | 2 + .../nixos/system/security/gpg/default.nix | 1 - .../nixos/system/security/gpg/tmux.conf | 101 ------------------ .../nixos/system/security/rbw/default.nix | 35 ++++++ 6 files changed, 45 insertions(+), 103 deletions(-) delete mode 100644 nix/modules/nixos/system/security/gpg/tmux.conf create mode 100644 nix/modules/nixos/system/security/rbw/default.nix diff --git a/nix/modules/nixos/desktop/addons/gtk/default.nix b/nix/modules/nixos/desktop/addons/gtk/default.nix index 60f4f91..abf3f2c 100644 --- a/nix/modules/nixos/desktop/addons/gtk/default.nix +++ b/nix/modules/nixos/desktop/addons/gtk/default.nix @@ -12,6 +12,13 @@ in { options.custom.desktop.addons.gtk = with types; { enable = mkBoolOpt false "Whether to customize GTK and apply themes."; + environment.systemPackages = with pkgs; [ + adwaita-qt + adwaita-qt6 + gnome.adwaita-icon-theme + gnome.gnome-tweaks + ]; + home.config = mkIf cfg.enable { gtk = { enable = true; diff --git a/nix/modules/nixos/desktop/addons/rofi/default.nix b/nix/modules/nixos/desktop/addons/rofi/default.nix index cf87aa2..bee7a2b 100644 --- a/nix/modules/nixos/desktop/addons/rofi/default.nix +++ b/nix/modules/nixos/desktop/addons/rofi/default.nix @@ -15,7 +15,7 @@ in { }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [rbw rofi-rbw wtype]; + environment.systemPackages = with pkgs; [rofi-rbw wtype]; home.programs.rofi = { enable = true; plugins = with pkgs; [ diff --git a/nix/modules/nixos/suites/desktop/default.nix b/nix/modules/nixos/suites/desktop/default.nix index 50646cf..1ba08e9 100644 --- a/nix/modules/nixos/suites/desktop/default.nix +++ b/nix/modules/nixos/suites/desktop/default.nix @@ -14,6 +14,7 @@ in { }; config = mkIf cfg.enable { + system.security.rbw.enable = true; custom = { desktop = { hyprland = enabled; @@ -25,6 +26,7 @@ in { telegram = enabled; vlc = enabled; zathura = enabled; + pcmanfm = enabled; }; }; }; diff --git a/nix/modules/nixos/system/security/gpg/default.nix b/nix/modules/nixos/system/security/gpg/default.nix index 66673b2..2975d8c 100644 --- a/nix/modules/nixos/system/security/gpg/default.nix +++ b/nix/modules/nixos/system/security/gpg/default.nix @@ -47,7 +47,6 @@ in { environment.systemPackages = with pkgs; [ gnupg pinentry-curses - pinentry-qt ]; programs = { diff --git a/nix/modules/nixos/system/security/gpg/tmux.conf b/nix/modules/nixos/system/security/gpg/tmux.conf deleted file mode 100644 index daeb00b..0000000 --- a/nix/modules/nixos/system/security/gpg/tmux.conf +++ /dev/null @@ -1,101 +0,0 @@ -##################################################### -# THEME -##################################################### -# Status tuning -set -g status on -set -g status-bg black -set -g status-fg white -set -g window-status-current-style fg=white,bg=black,bold -set -g status-interval 1 -set-option -g focus-events on -set -g default-shell /run/current-system/sw/bin/fish - -# Set window title string -# # #H Hostname of local host -# # #I Current window index -# # #P Current pane index -# # #S Session name -# # #T Current window title -# # #W Current window name -# # # A literal ‘#’ - -# Set up left status -set -g status-left-length 50 -set -g status-left '#[fg=red,bg=black][#h]#[fg=white,bold] W#I:P#P |#[default]' - -# Set up right status -set -g status-right-length 60 -set -g status-right "| #(/usr/bin/env bash $HOME/dotfiles/tmux/plugins/kube-tmux/kube.tmux 250 magenta cyan) #[fg=white]| #[fg=red] [%R]" -# set -g status-right '| #[fg=red]#(whoami) - [%R] ' -# set -g status-right '| #[fg=red] [%R] ' - -# Set up automatic pane rename -set-option -g automatic-rename-format '#(id -u)@#h #{?#{==:#{pane_current_command},#{b:SHELL}},#{b:pane_current_path}/,#{pane_current_command}}' - -# Highlight active window -set-window-option -g window-status-current-style bg=green,fg=black - -# Aauto renumber windows on close -setw -g renumber-windows on - -# Try to improve TERM colorscheme -# set -g default-terminal "screen-256color" -#set-option -ga terminal-overrides ',screen-256color:Tc' - -# tmux display things in 256 colors -#set -g default-terminal "tmux-256color-italic" -#set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m' -# set -g default-terminal "xterm-24bit" -# set -g terminal-overrides ',xterm-24bit:Tc' -# set -g default-terminal 'xterm-256color' -# set -sa terminal-overrides ',xterm-256color:Tc' -set-option -g default-terminal "screen-256color" -set-option -ga terminal-overrides "screen-256color:Tc" - -set -as terminal-features ',screen-256color:clipboard' -#set -s copy-command 'pbcopy' -set -g allow-passthrough on -set -g set-clipboard on -# enable terminal compability -#set-option -ga terminal-overrides ",tmux-256color-italic:Tc,xterm-256color-italic:T" - -# Highlight windows where something changed with white -setw -g monitor-activity on - -# Automatically set window title -set-window-option -g automatic-rename on -set-window-option -g allow-rename on - -# Start indexing windows from 1 -set -g base-index 1 -set -g pane-base-index 1 -##################################################### -# KEYS -##################################################### -# Use VI key bindings in the status line -set -g status-keys vi -# Use VI key bindings in copy and choice modes -setw -g mode-keys vi -# Use +[,v for begin copy, y copy and +P to paste current buffer -unbind P -bind P paste-buffer -# Keybinding for tmux >=2.6 -bind-key -T copy-mode-vi 'v' send-keys -X begin-selection -bind-key -T copy-mode-vi 'y' send-keys -X copy-selection - -# Vim style pane selection -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R - -# No delay for escape key press -set -sg escape-time 0 -# Set history size -set -g history-limit 50000 -# # Reload tmux config using r -bind r source-file ~/.tmux.conf \; display "Reloaded!" - -# Toggle synchronization -bind e setw synchronize-panes on -bind E setw synchronize-panes off diff --git a/nix/modules/nixos/system/security/rbw/default.nix b/nix/modules/nixos/system/security/rbw/default.nix new file mode 100644 index 0000000..e7dd37e --- /dev/null +++ b/nix/modules/nixos/system/security/rbw/default.nix @@ -0,0 +1,35 @@ +{ + options, + config, + pkgs, + lib, + inputs, + ... +}: +with lib; +with lib.custom; let + cfg = config.system.security.rbw; +in { + options.system.security.rbw = with types; { + enable = mkBoolOpt false "Whether or not to enable rbw."; + lockTimeout = mkOpt int 28800 "The amount of time to wait before continuing with shell init."; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + rbw + pinentry-gnome + ]; + + home.programs = { + rbw = { + enable = true; + settings = { + lock_timeout = cfg.lockTimeout; + pinentry = "gnome3"; + email = "zppfan@gmail.com"; + }; + }; + }; + }; +}