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

View File

@ -28,7 +28,16 @@
./system/ritchie.nix ./system/ritchie.nix
hyprland.nixosModules.default 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.nixosModules.home-manager {
home-manager = { home-manager = {

View File

@ -29,4 +29,14 @@ in
../users/foxsoft/authorized_keys ../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"; i18n.defaultLocale = "en_GB.UTF-8";
time.timeZone = "Europe/London"; time.timeZone = "Europe/London";
security.polkit.enable = true;
# Enable sound. # Enable sound.
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {
@ -91,6 +93,15 @@
settings.PasswordAuthentication = false; 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 system.stateVersion = "22.11"; # Don't change this
} }

View File

@ -16,7 +16,9 @@
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; 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 = { programs.tmux = {
@ -78,7 +80,8 @@
xdg.configFile."rofi/config.rasi".source = ./rofi/config.rasi; xdg.configFile."rofi/config.rasi".source = ./rofi/config.rasi;
xdg.configFile."qutebrowser/config.py".source = ./qutebrowser/config.py; xdg.configFile."qutebrowser/config.py".source = ./qutebrowser/config.py;
xdg.configFile."qutebrowser/gruvbox.py".source = ./qutebrowser/gruvbox.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.".ssh/config".source = ./ssh/config;
home.file.".LESS_TERMCAP".source = ./LESS_TERMCAP; home.file.".LESS_TERMCAP".source = ./LESS_TERMCAP;

View File

@ -1,9 +1,9 @@
# NVidia stuff # NVidia stuff
#env = LIBVA_DRIVER_NAME,nvidia # env = LIBVA_DRIVER_NAME,nvidia
#env = XDG_SESSION_TYPE,wayland # env = XDG_SESSION_TYPE,wayland
#env = GBM_BACKEND,nvidia-drm # env = GBM_BACKEND,nvidia-drm
#env = __GLX_VENDOR_LIBRARY_NAME,nvidia # env = __GLX_VENDOR_LIBRARY_NAME,nvidia
#env = WLR_NO_HARDWARE_CURSORS,1 # env = WLR_NO_HARDWARE_CURSORS,1
monitor=eDP-1, preferred, auto, 1 monitor=eDP-1, preferred, auto, 1
monitor=DP-2, preferred, auto, auto 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(',p', 'spawn --userscript qute-1pass')
config.bind(',f', 'spawn -d firefox {url}') config.bind(',f', 'spawn -d firefox {url}')
config.bind(',c', 'spawn -d chromium {url}') config.bind(',c', 'spawn -d chromium {url}')
config.bind(',e', 'spawn -d microsoft-edge {url}')
config.source('gruvbox.py') 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 if [ -f "$TOKEN_CACHE" ]; then
TOKEN=$(cat "$TOKEN_CACHE") TOKEN=$(cat "$TOKEN_CACHE")
if ! op signin --session="$TOKEN" --output=raw > /dev/null; then if ! op signin --session="$TOKEN" --raw > /dev/null; then
TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" TOKEN=$(rofi -dmenu -password -p "1password: "| op signin) || TOKEN=""
echo "$TOKEN" > "$TOKEN_CACHE" echo "$TOKEN" > "$TOKEN_CACHE"
fi fi
else 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" install -m 600 /dev/null "$TOKEN_CACHE"
echo "$TOKEN" > "$TOKEN_CACHE" echo "$TOKEN" > "$TOKEN_CACHE"
fi fi
if [ -n "$TOKEN" ]; then 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 if [ -z "$UUID" ] || [ "$UUID" == "null" ];then
echo "message-error 'No entry found for $URL'" >> "$QUTE_FIFO" 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="" TOTP=$(echo "$ITEM" | op get totp --cache --session="$TOKEN" "$UUID") || TOTP=""
if [ -n "$TOTP" ]; then if [ -n "$TOTP" ]; then
echo "$TOTP" | xclip -in -selection clipboard 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 fi
else else
echo "message-error 'No password found for $URL'" >> "$QUTE_FIFO" echo "message-error 'No password found for $URL'" >> "$QUTE_FIFO"

View File

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