Improve Qutebrowser and Wayland setup

This commit is contained in:
Trevor Vallender 2023-06-13 10:42:46 +01:00
parent 0335159f12
commit 87292d7f58
9 changed files with 70 additions and 35 deletions

View File

@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1686363992,
"narHash": "sha256-OmWKx1axmCrdTWvjidtfrMCAs63G6yU0kzP4cdslYqU=",
"lastModified": 1686623080,
"narHash": "sha256-Be9a89KBd5t4sh9eIcU9FMzZuNWxwtSutkGQLQ4MhHU=",
"owner": "jcdickinson",
"repo": "codeium.nvim",
"rev": "b1ff0d6c993e3d87a4362d2ccd6c660f7444599f",
"rev": "cfa9100f81133b64c32ab6a19396492515eac0e5",
"type": "github"
},
"original": {
@ -136,11 +136,11 @@
]
},
"locked": {
"lastModified": 1686391840,
"narHash": "sha256-5S0APl6Mfm6a37taHwvuf11UHnAX0+PnoWQbsYbMUnc=",
"lastModified": 1686639065,
"narHash": "sha256-ZBDPI1GCsZaQBzPd6zjowqfNj58sRE+PTpZiThQCj68=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0144ac418ef633bfc9dbd89b8c199ad3a617c59f",
"rev": "d437f0d4e0f72fe76688142e954a4a9b61ac9833",
"type": "github"
},
"original": {
@ -154,11 +154,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1686236640,
"narHash": "sha256-HUqtNdiwMbNvgSWFYAy/b8vcnZbqoHGzZj5D7NrzjxA=",
"lastModified": 1686564083,
"narHash": "sha256-fBstj/fGsIuy05aBT2djyRsreIkGdjqslVBDtLlzpGs=",
"owner": "hyprwm",
"repo": "contrib",
"rev": "eece565c149e13cedf02d07d248f1697db5be400",
"rev": "f698ac5c135498224198687b32a524248b9f4e61",
"type": "github"
},
"original": {
@ -175,11 +175,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1686392880,
"narHash": "sha256-CI0n8XDenLWjgv3LeWyv4CezttxojkV9jMb6OLmSOzA=",
"lastModified": 1686588433,
"narHash": "sha256-qWuFScv2cokEaH1As3iH5J7fQeYoww6GghrtB96sS0g=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "003993337a96494881b9d43bdf8955fd0813ada8",
"rev": "528cfc28891431be116bcaed7e72d4f8497ed009",
"type": "github"
},
"original": {
@ -315,11 +315,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1685655444,
"narHash": "sha256-6EujQNAeaUkWvpEZZcVF8qSfQrNVWFNNGbUJxv/A5a8=",
"lastModified": 1686501370,
"narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e635192892f5abbc2289eaac3a73cdb249abaefd",
"rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519",
"type": "github"
},
"original": {
@ -331,11 +331,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1686319658,
"narHash": "sha256-tGWdoUAqKnE866mYFlEfc2a99kxFy31hOQJH5YQKrTQ=",
"lastModified": 1686501370,
"narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ae766d59b07c450e0f1de8a1bfd6529089f40849",
"rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519",
"type": "github"
},
"original": {
@ -403,11 +403,11 @@
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1685803001,
"narHash": "sha256-yxq/U9zL1ssFZtgT27A96UKteCiKb3zSmbA/dokK76U=",
"lastModified": 1686573751,
"narHash": "sha256-5vnFxEMvn4wzT+XKR5Jo8VSn1hXrdf/mWuTmdHhRFBs=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "b61d5922f1d0910a848deb100570ad8587aea38d",
"rev": "6e8fb5509f2c94d09d4efa0f9b1f40b37bf73863",
"type": "gitlab"
},
"original": {

View File

@ -28,7 +28,16 @@
./system/ritchie.nix
hyprland.nixosModules.default
{ programs.hyprland.enable = true; }
{
programs.hyprland = {
enable = true;
nvidiaPatches = true;
xwayland = {
enable = true;
hidpi = true;
};
};
}
home-manager.nixosModules.home-manager {
home-manager = {

View File

@ -29,4 +29,14 @@ in
../users/foxsoft/authorized_keys
];
};
# Enable the 1Password CLI, this also enables a SGUID wrapper so the CLI can authorize against the GUI app
programs._1password = {
enable = true;
};
# Enable the 1Passsword GUI with myself as an authorized user for polkit
programs._1password-gui = {
enable = true;
};
}

View File

@ -11,6 +11,8 @@
i18n.defaultLocale = "en_GB.UTF-8";
time.timeZone = "Europe/London";
security.polkit.enable = true;
# Enable sound.
security.rtkit.enable = true;
services.pipewire = {
@ -91,6 +93,15 @@
settings.PasswordAuthentication = false;
};
xdg.mime.enable = true;
xdg.mime.defaultApplications = {
"text/html" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop";
};
system.stateVersion = "22.11"; # Don't change this
}

View File

@ -16,7 +16,9 @@
home.sessionVariables = {
EDITOR = "nvim";
MOZ_ENABLE_WAYLAND = 1;
MOZ_ENABLE_WAYLAND = "1";
DEFAULT_BROWSER = "${pkgs.qutebrowser}/bin/qutebrowser"; # Used by Electron apps
NIXOS_OZONE_WL = "1"; # Wayland in Slack
};
programs.tmux = {
@ -78,7 +80,8 @@
xdg.configFile."rofi/config.rasi".source = ./rofi/config.rasi;
xdg.configFile."qutebrowser/config.py".source = ./qutebrowser/config.py;
xdg.configFile."qutebrowser/gruvbox.py".source = ./qutebrowser/gruvbox.py;
home.file.".local/share/qutebrowser/userscripts/qute-1pass".source = .qutebrowser/userscripts/qute-1pass;
home.file.".local/share/qutebrowser/userscripts/qute-1pass".source = ./qutebrowser/userscripts/qute-1pass;
home.file.".local/share/qutebrowser/userscripts/qute-1pass".executable = true;
home.file.".ssh/config".source = ./ssh/config;
home.file.".LESS_TERMCAP".source = ./LESS_TERMCAP;

View File

@ -1,9 +1,9 @@
# NVidia stuff
#env = LIBVA_DRIVER_NAME,nvidia
#env = XDG_SESSION_TYPE,wayland
#env = GBM_BACKEND,nvidia-drm
#env = __GLX_VENDOR_LIBRARY_NAME,nvidia
#env = WLR_NO_HARDWARE_CURSORS,1
# env = LIBVA_DRIVER_NAME,nvidia
# env = XDG_SESSION_TYPE,wayland
# env = GBM_BACKEND,nvidia-drm
# env = __GLX_VENDOR_LIBRARY_NAME,nvidia
# env = WLR_NO_HARDWARE_CURSORS,1
monitor=eDP-1, preferred, auto, 1
monitor=DP-2, preferred, auto, auto

View File

@ -12,5 +12,8 @@ config.bind(',b', 'spawn --userscript qute-bitwarden')
config.bind(',p', 'spawn --userscript qute-1pass')
config.bind(',f', 'spawn -d firefox {url}')
config.bind(',c', 'spawn -d chromium {url}')
config.bind(',e', 'spawn -d microsoft-edge {url}')
config.source('gruvbox.py')
config.set("content.headers.user-agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36")

View File

@ -70,19 +70,19 @@ echo "message-info 'Looking for password for $URL...'" >> "$QUTE_FIFO"
if [ -f "$TOKEN_CACHE" ]; then
TOKEN=$(cat "$TOKEN_CACHE")
if ! op signin --session="$TOKEN" --output=raw > /dev/null; then
TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN=""
if ! op signin --session="$TOKEN" --raw > /dev/null; then
TOKEN=$(rofi -dmenu -password -p "1password: "| op signin) || TOKEN=""
echo "$TOKEN" > "$TOKEN_CACHE"
fi
else
TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN=""
TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --raw) || TOKEN=""
install -m 600 /dev/null "$TOKEN_CACHE"
echo "$TOKEN" > "$TOKEN_CACHE"
fi
if [ -n "$TOKEN" ]; then
UUID=$(op list items --cache --session="$TOKEN" | jq --arg url "$URL" -r '[.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?} | select(.uuid != null) | select(.url != null) | select(.url|test(".*\($url).*"))][.0].uuid') || UUID=""
UUID=$(op list items --cache --session="$TOKEN" | jq --arg url "$URL" -r '[.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?} | select(.uuid != null) | select(.url != null) | select(.url|test(".*\($url).*"))][.0].uuid') || UUID=""
if [ -z "$UUID" ] || [ "$UUID" == "null" ];then
echo "message-error 'No entry found for $URL'" >> "$QUTE_FIFO"
@ -111,7 +111,7 @@ if [ -n "$TOKEN" ]; then
TOTP=$(echo "$ITEM" | op get totp --cache --session="$TOKEN" "$UUID") || TOTP=""
if [ -n "$TOTP" ]; then
echo "$TOTP" | xclip -in -selection clipboard
echo "message-info 'Pasted one time password for $TITLE to clipboard'" >> "$QUTE_FIFO"
echo "message-info 'Pasted one time password for $TITLE to clipboard'" >> "$QUTE_FIFO"
fi
else
echo "message-error 'No password found for $URL'" >> "$QUTE_FIFO"

View File

@ -2,7 +2,6 @@
{
home.packages = with pkgs; [
_1password-gui
awscli2
awsebcli
gitflow