From 3aa810d7b37c3382ab7a6ae00a6009c7240afd63 Mon Sep 17 00:00:00 2001 From: marc Date: Fri, 20 Jan 2023 21:00:19 +0100 Subject: [PATCH] Fixed bootloader and added/fixed rofi-pass --- config/rofi/menus/pass/pass.rasi | 147 +++++++++++++++++++++++++++++++ hosts/reykjavik/default.nix | 14 +-- hosts/reykjavik/hardware.nix | 2 +- modules/system/gpg.nix | 2 +- modules/system/pass.nix | 15 +++- 5 files changed, 164 insertions(+), 16 deletions(-) create mode 100644 config/rofi/menus/pass/pass.rasi diff --git a/config/rofi/menus/pass/pass.rasi b/config/rofi/menus/pass/pass.rasi new file mode 100644 index 0000000..e39961e --- /dev/null +++ b/config/rofi/menus/pass/pass.rasi @@ -0,0 +1,147 @@ +/** + * + * Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x) + * + **/ + +@import "../../theme.rasi" + +/*****----- Configuration -----*****/ +configuration { + show-icons: false; +} + +/*****----- Main Window -----*****/ +window { + /* properties for window widget */ + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 800px; + x-offset: 0px; + y-offset: 0px; + + /* properties for all widgets */ + enabled: true; + margin: 0px; + padding: 0px; + border: 2px solid; + border-radius: 15px; + border-color: @background-alt; + cursor: "default"; + background-color: @background; +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 15px; + margin: 0px; + padding: 30px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + children: [ "inputbar", "listview" ]; +} +message { + enabled: true; + margin: 0px; + padding: 10px; + border: 0px solid; + border-radius: 10px; + border-color: @selected; + background-color: @background-alt; + text-color: @foreground; +} +textbox { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; + placeholder-color: @foreground; + blink: true; + markup: true; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 10px; + padding: 15px; + border-radius: 10px; + background-color: @background-alt; + text-color: @foreground; + children: [ "textbox-prompt-colon", "entry" ]; +} +textbox-prompt-colon { + enabled: true; + expand: false; + str: ""; + background-color: inherit; + text-color: inherit; +} +entry { + enabled: true; + background-color: inherit; + text-color: inherit; + cursor: text; +} + +/*****----- Listview -----*****/ +listview { + enabled: true; + columns: 1; + lines: 5; + cycle: true; + dynamic: true; + scrollbar: false; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + + spacing: 5px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + cursor: "default"; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + spacing: 0px; + margin: 0px; + padding: 12px; + border: 0px solid; + border-radius: 100%; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + cursor: pointer; +} +element-text { + background-color: transparent; + text-color: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; +} +element selected.normal { + background-color: var(selected); + text-color: var(background); +} +element active { + background-color: var(active); + text-color: var(background); +} +element selected.active { + background-color: var(selected); + text-color: var(background); +} diff --git a/hosts/reykjavik/default.nix b/hosts/reykjavik/default.nix index a34b989..ea69e30 100644 --- a/hosts/reykjavik/default.nix +++ b/hosts/reykjavik/default.nix @@ -30,19 +30,7 @@ in # - Bootloader --------------------------------- - boot.loader = { - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; - }; - grub = { - enable = true; - efiSupport = true; - #efiInstallAsRemovable = true; # in case canTouchEfiVariables doesn't work for your system - device = "nodev"; - }; - grub2-theme.enable = true; - }; + boot.loader.systemd-boot.enable = true; # - Themeing --------------------------------- diff --git a/hosts/reykjavik/hardware.nix b/hosts/reykjavik/hardware.nix index ec71852..4f23117 100644 --- a/hosts/reykjavik/hardware.nix +++ b/hosts/reykjavik/hardware.nix @@ -18,7 +18,7 @@ fsType = "ext4"; }; - "/boot/efi" = { + "/boot" = { device = "/dev/disk/by-label/BOOT"; fsType = "vfat"; }; diff --git a/modules/system/gpg.nix b/modules/system/gpg.nix index 34419e4..ef48c5b 100644 --- a/modules/system/gpg.nix +++ b/modules/system/gpg.nix @@ -11,7 +11,7 @@ in programs.gnupg.agent = { enable = true; enableSSHSupport = true; - pinentryFlavor = "curses"; + pinentryFlavor = "qt"; }; environment.systemPackages = with pkgs; [ pinentry diff --git a/modules/system/pass.nix b/modules/system/pass.nix index 190cf40..dc341f4 100644 --- a/modules/system/pass.nix +++ b/modules/system/pass.nix @@ -12,9 +12,22 @@ in samfelag.modules.system.gpg.enable = true; environment.systemPackages = with pkgs; [ pass - rofi-pass ]; + hm.programs.rofi.pass = { + enable = true; + extraConfig = '' + _rofi () { + rofi -i -no-auto-select -theme /home/marc/.config/rofi/menus/pass/pass.rasi "$@" + } + + fix_layout=true + layout_cmd () { + setxkbmap + } + ''; + }; + samfelag.modules.desktop.i3.extraKeybindings = lib.mkIf desktopCfg.enable { "${desktopCfg.i3.mod}+p" = "exec rofi-pass"; };