nix: new programs, scripts, ...
Anirudh Oppiliappan x@icyphox.sh
Thu, 24 Mar 2022 17:54:47 +0530
10 files changed,
79 insertions(+),
10 deletions(-)
M
nix/bin/default.nix
→
nix/bin/default.nix
@@ -35,6 +35,9 @@
# bar bar = import ./bar.nix { inherit pkgs theme; }; + # xurls + xurls = import ./xurls.nix pkgs; + # file uploader # uploader = import ./up.nix pkgs;@@ -48,4 +51,5 @@ webcam
record battery bar + xurls ]
A
nix/bin/xurls.nix
@@ -0,0 +1,27 @@
+{ pkgs, ... }: + +let + name = "xurls"; + fzy = "${pkgs.fzy}/bin/fzy"; +in +pkgs.writeShellScriptBin name + '' + content="$(tmux capture-pane -J -p)" + + mapfile -t urls < <(echo "$content" | grep -oE '(https?|ftp|file):/?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]') + mapfile -t wwws < <(echo "$content" | grep -oE '(http?s://)?www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' | grep -vE '^https?://' |sed 's/^\(.*\)$/http:\/\/\1/') + mapfile -t ips < <(echo "$content" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9]{1,5})?(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/') + mapfile -t gits < <(echo "$content" | grep -oE '(ssh://)?git@\S*' | sed 's/:/\//g' | sed 's/^\(ssh\/\/\/\)\{0,1\}git@\(.*\)$/https:\/\/\2/') + + items="$(printf '%s\n' "''${urls[@]}" "''${wwws[@]}" "''${ips[@]}" "''${gits[@]}" | + grep -v '^$' | + sort -u | + nl -w3 -s ' ' + )" + + [ -z "$items" ] && exit + + u="$(${fzy} <<< "$items" | awk '{ print $2 }')" + $BROWSER "$u" + '' +
M
nix/flake.lock
→
nix/flake.lock
@@ -195,13 +195,17 @@ "nixpkgs"
] }, "locked": { - "narHash": "sha256-smj6KAi1MdZxZ67Sxwc/uKop9bZmUaOhp8M6fafAg9Y=", - "path": "/home/icy/code/nerd-prompt", - "type": "path" + "lastModified": 1643513342, + "narHash": "sha256-t819RkW5NiURx4lJlGMfHW3IuAMJtK29jUpAqUixKeg=", + "ref": "master", + "rev": "8b1dd1f5609447f5d862e330a75a4b2a0dfc3929", + "revCount": 3, + "type": "git", + "url": "https://git.peppe.rs/cli/prompt" }, "original": { - "path": "/home/icy/code/nerd-prompt", - "type": "path" + "type": "git", + "url": "https://git.peppe.rs/cli/prompt" } }, "root": {
M
nix/flake.nix
→
nix/flake.nix
@@ -14,10 +14,9 @@
neovim.url = "github:nix-community/neovim-nightly-overlay"; prompt = { - url = "path:/home/icy/code/nerd-prompt"; + url = "git+https://git.peppe.rs/cli/prompt"; inputs.nixpkgs.follows = "nixpkgs"; }; - }; outputs =
M
nix/home.nix
→
nix/home.nix
@@ -24,7 +24,6 @@ unzip
curl tmux weechat - firefox xclip ripgrep arandr
M
nix/hosts/lapis/configuration.nix
→
nix/hosts/lapis/configuration.nix
@@ -21,7 +21,6 @@ dhcpcd.enable = false;
hostName = "lapis"; useDHCP = false; interfaces.wlan0.useDHCP = true; - wireless.iwd.enable = true; }; i18n.defaultLocale = "en_US.UTF-8";@@ -104,6 +103,7 @@ '';
doas.extraRules = [{ users = [ "icy" ]; }]; + pki.certificateFiles = [ "/home/icy/.local/share/caddy/pki/authorities/local/root.crt" ]; };
M
nix/programs/bash.nix
→
nix/programs/bash.nix
@@ -45,7 +45,7 @@ MANPAGER = "nvim +Man!";
BROWSER = "firefox"; PW_DIR = "$HOME/.pw"; PW_KEY = "x@icyphox.sh"; - PATH = "$PATH:$HOME/bin"; + PATH = "$PATH:$HOME/go/bin:$HOME/bin"; };
M
nix/programs/default.nix
→
nix/programs/default.nix
@@ -15,6 +15,7 @@ ./neovim.nix
./readline.nix ./tmux.nix ./zathura.nix + ./firefox.nix ]; programs = {@@ -38,5 +39,9 @@ enable = true;
enableBashIntegration = true; }; gpg.enable = true; + htop = { + enable = true; + settings.color_scheme = 1; + }; }; }
A
nix/programs/firefox.nix
@@ -0,0 +1,29 @@
+{ config +, pkgs +, ... +}: + +{ + programs.firefox = { + enable = true; + profiles = { + icy = { + isDefault = true; + path = "34x366wc.default"; + userChrome = '' + #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { + display: none; + } + + #main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar > .toolbar-items { + opacity: 0; + pointer-events: none; + } + #main-window:not([tabsintitlebar="true"]) #TabsToolbar { + visibility: collapse !important; + } + ''; + }; + }; + }; +}
M
nix/programs/neovim.nix
→
nix/programs/neovim.nix
@@ -27,6 +27,8 @@ vim-surround
targets-vim vim-gitgutter vim-rsi + vim-go + vim-jsonnet ]; }; }