From 694e373b94d4fd9b7e579dcdc4cd761a4e33d61e Mon Sep 17 00:00:00 2001 From: pagedMov Date: Mon, 14 Oct 2024 05:47:25 -0400 Subject: [PATCH] (desktop) Gen 484: Improved keyring formatting --- flake.lock | 6 +- modules/home/programs/firefox.nix | 92 +++++++++++++++++++ .../home/scripts/wm-controls/passhelper.nix | 9 +- .../home/scripts/wm-controls/passhelper.sh | 17 ++++ 4 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 modules/home/programs/firefox.nix create mode 100755 modules/home/scripts/wm-controls/passhelper.sh diff --git a/flake.lock b/flake.lock index 53f38ec..64837b8 100644 --- a/flake.lock +++ b/flake.lock @@ -825,11 +825,11 @@ }, "nur": { "locked": { - "lastModified": 1728889933, - "narHash": "sha256-ZqCutCb0MxSfLm5VyVq5p029kJ+++5j+E5e9qS8W+/8=", + "lastModified": 1728897080, + "narHash": "sha256-aTXVDADO4CflvvnHNYmmcfmQNnJeOfOwqWoKwXKsWWQ=", "owner": "nix-community", "repo": "NUR", - "rev": "5572baaaacd0ff97783859f35eb20de9a5cf6000", + "rev": "9fe98265f7f8beed5ab2a55263317fa492bd908c", "type": "github" }, "original": { diff --git a/modules/home/programs/firefox.nix b/modules/home/programs/firefox.nix new file mode 100644 index 0000000..b5b55fe --- /dev/null +++ b/modules/home/programs/firefox.nix @@ -0,0 +1,92 @@ +{ nur, username }: + +{ + programs.firefox = { + enable = true; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value= true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" isDefault = true; + }; + profiles.${username} = { + name = "${username}"; + bookmarks = [ + { name = "NixOS Options"; + url = "https://search.nixos.org/options"; + } + { name = "Home Manager Options"; + url = "https://home-manager-options.extranix.com/"; + } + { name = "Nixvim Docs"; + url = "https://nix-community.github.io/nixvim/"; + } + { name = "Rust Manual"; + url = "https://doc.rust-lang.org/book/ch01-03-hello-cargo.html"; + } + { name = "ChatGPT"; + url = "https://chatgpt.com/"; + } + { name = "DataAnnotation"; + url = "https://app.dataannotation.tech/users/sign_in"; + } + { name = "Nerd Fonts Cheatsheet"; + url = "https://www.nerdfonts.com/cheat-sheet"; + } + ]; + extensions = with nur.repos.rycee.firefox-addons; [ + darkreader + adnauseam + cookie-autodelete + disconnect + firefox-color + vimium + firenvim + privacy-badger + new-tab-override + tampermonkey + ]; + extraConfig = '' + "browser.startup.homepage" = "${self}/glasshouse-desktop/home/firefox/homepage.html"; + "browser.active_color" = "#EE0000"; + "browser.active_color.dark" = "#FF6666"; + "browser.anchor_color" = "#0000EE"; + "browser.anchor_color.dark" = "#8C8CFF"; + "browser.display.background_color" = "#FFFFFF"; + "browser.display.background_color.dark" = "#1C1B22"; + "browser.display.document_color_use" = "1"; + "browser.display.foreground_color" = "#000000"; + "browser.display.foreground_color.dark" = "#FBFBFE"; + "browser.display.suppress_canvas_background_image_on_forced_colors" = "true"; + "browser.display.use_system_colors" = "false"; + "browser.newtabpage.activity-stream.newNewtabExperience.colors" = "#0090ED,#FF4F5F,#2AC3A2,#FF7139,#A172FF,#FFA437,#FF2A8A"; + "browser.theme.colorway-closet" = "true"; + "browser.theme.colorway-migration" = "true"; + "browser.theme.windows.accent-color-in-tabs.enabled" = "false"; + "browser.visited_color" = "#551A8B"; + "browser.visited_color.dark" = "#FFADFF"; + "browser.newtabpage.pinned" = [{ + title = "Homepage"; + url = "${self}/glasshouse-desktop/home/firefox/homepage.html"; + }]; + "devtools.defaultColorUnit" = "authored"; + "editor.background_color" = "#FFFFFF"; + "editor.use_custom_colors" = "false"; + ''; + }; + }; +} diff --git a/modules/home/scripts/wm-controls/passhelper.nix b/modules/home/scripts/wm-controls/passhelper.nix index 77de739..9b36b97 100644 --- a/modules/home/scripts/wm-controls/passhelper.nix +++ b/modules/home/scripts/wm-controls/passhelper.nix @@ -3,17 +3,18 @@ pkgs.writeShellScriptBin "passhelper" ('' #!/run/current-system/sw/bin/bash -# prevent multiple instances, conditional check happens in the hyprland bind + # prevent multiple instances, conditional check happens in the hyprland bind touch /tmp/passhelperfile trap "[ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile" EXIT SIGHUP SIGINT -# get passwords from password store, remove .password store/ prefix and .gpg suffix, exlude .gpg-id file, open results in fzf + # get passwords from password store, remove .password store/ prefix and .gpg suffix, exlude .gpg-id file, open results in fzf pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | sed 's|^\([^/]*\)|\x1b[32m\1\x1b[0m|' | rg -v "\.git|.gpg-id" | sort -r | fzf --border --border-label="$(whoami)'s keyring" --ansi --layout=reverse) [ $? = 0 ] || { [ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile; exit 1; } -pass -c "$pass_string" -sleep 1.5 + # pass it through fmt for soft word wrapping +pass -c "$pass_string" | fmt -w 45 /run/current-system/sw/bin/rm /tmp/passhelperfile +sleep 1.5 exit 0 '') diff --git a/modules/home/scripts/wm-controls/passhelper.sh b/modules/home/scripts/wm-controls/passhelper.sh new file mode 100755 index 0000000..764ed5c --- /dev/null +++ b/modules/home/scripts/wm-controls/passhelper.sh @@ -0,0 +1,17 @@ + +#!/run/current-system/sw/bin/bash + + # prevent multiple instances, conditional check happens in the hyprland bind +touch /tmp/passhelperfile +trap "[ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile" EXIT SIGHUP SIGINT + + # get passwords from password store, remove .password store/ prefix and .gpg suffix, exlude .gpg-id file, open results in fzf +pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | sed 's|^\([^/]*\)|\x1b[32m\1\x1b[0m|' | rg -v "\.git|.gpg-id" | sort -r | fzf --border --border-label="$(whoami)'s keyring" --ansi --layout=reverse) + +[ $? = 0 ] || { [ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile; exit 1; } + + # pass it through fmt for soft word wrapping +pass -c "$pass_string" | fmt -w 45 +/run/current-system/sw/bin/rm /tmp/passhelperfile +sleep 10 +exit 0