···11-### key-bindings.fish ###
22-# ____ ____
33-# / __/___ / __/
44-# / /_/_ / / /_
55-# / __/ / /_/ __/
66-# /_/ /___/_/ key-bindings.fish
77-#
88-# - $FZF_TMUX_OPTS
99-# - $FZF_CTRL_T_COMMAND
1010-# - $FZF_CTRL_T_OPTS
1111-# - $FZF_CTRL_R_OPTS
1212-# - $FZF_ALT_C_COMMAND
1313-# - $FZF_ALT_C_OPTS
1414-1515-status is-interactive; or exit 0
1616-1717-1818-# Key bindings
1919-# ------------
2020-function fzf_key_bindings
2121-2222- function __fzf_defaults
2323- # $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
2424- # $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
2525- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
2626- echo "--height $FZF_TMUX_HEIGHT --bind=ctrl-z:ignore" $argv[1]
2727- command cat "$FZF_DEFAULT_OPTS_FILE" 2> /dev/null
2828- echo $FZF_DEFAULT_OPTS $argv[2]
2929- end
3030-3131- # Store current token in $dir as root for the 'find' command
3232- function fzf-file-widget -d "List files and folders"
3333- set -l commandline (__fzf_parse_commandline)
3434- set -lx dir $commandline[1]
3535- set -l fzf_query $commandline[2]
3636- set -l prefix $commandline[3]
3737-3838- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
3939- begin
4040- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "--reverse --walker=file,dir,follow,hidden --scheme=path --walker-root='$dir'" "$FZF_CTRL_T_OPTS")
4141- set -lx FZF_DEFAULT_COMMAND "$FZF_CTRL_T_COMMAND"
4242- set -lx FZF_DEFAULT_OPTS_FILE ''
4343- eval (__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end
4444- end
4545- if [ -z "$result" ]
4646- commandline -f repaint
4747- return
4848- else
4949- # Remove last token from commandline.
5050- commandline -t ""
5151- end
5252- for i in $result
5353- commandline -it -- $prefix
5454- commandline -it -- (string escape $i)
5555- commandline -it -- ' '
5656- end
5757- commandline -f repaint
5858- end
5959-6060- function fzf-history-widget -d "Show command history"
6161- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
6262- begin
6363- set -l FISH_MAJOR (echo $version | cut -f1 -d.)
6464- set -l FISH_MINOR (echo $version | cut -f2 -d.)
6565-6666- # merge history from other sessions before searching
6767- if test -z "$fish_private_mode"
6868- builtin history merge
6969- end
7070-7171- # history's -z flag is needed for multi-line support.
7272- # history's -z flag was added in fish 2.4.0, so don't use it for versions
7373- # before 2.4.0.
7474- if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];
7575- if type -P perl > /dev/null 2>&1
7676- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '"\t"↳ ' --highlight-line $FZF_CTRL_R_OPTS +m")
7777- set -lx FZF_DEFAULT_OPTS_FILE ''
7878- builtin history -z --reverse | command perl -0 -pe 's/^/$.\t/g; s/\n/\n\t/gm' | eval (__fzfcmd) --tac --read0 --print0 -q '(commandline)' | command perl -pe 's/^\d*\t//' | read -lz result
7979- and commandline -- $result
8080- else
8181- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "--scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '"\t"↳ ' --highlight-line $FZF_CTRL_R_OPTS +m")
8282- set -lx FZF_DEFAULT_OPTS_FILE ''
8383- builtin history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
8484- and commandline -- $result
8585- end
8686- else
8787- builtin history | eval (__fzfcmd) -q '(commandline)' | read -l result
8888- and commandline -- $result
8989- end
9090- end
9191- commandline -f repaint
9292- end
9393-9494- function fzf-cd-widget -d "Change directory"
9595- set -l commandline (__fzf_parse_commandline)
9696- set -lx dir $commandline[1]
9797- set -l fzf_query $commandline[2]
9898- set -l prefix $commandline[3]
9999-100100- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
101101- begin
102102- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "--reverse --walker=dir,follow,hidden --scheme=path --walker-root='$dir'" "$FZF_ALT_C_OPTS")
103103- set -lx FZF_DEFAULT_OPTS_FILE ''
104104- set -lx FZF_DEFAULT_COMMAND "$FZF_ALT_C_COMMAND"
105105- eval (__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
106106-107107- if [ -n "$result" ]
108108- cd -- $result
109109-110110- # Remove last token from commandline.
111111- commandline -t ""
112112- commandline -it -- $prefix
113113- end
114114- end
115115-116116- commandline -f repaint
117117- end
118118-119119- function __fzfcmd
120120- test -n "$FZF_TMUX"; or set FZF_TMUX 0
121121- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
122122- if [ -n "$FZF_TMUX_OPTS" ]
123123- echo "fzf-tmux $FZF_TMUX_OPTS -- "
124124- else if [ $FZF_TMUX -eq 1 ]
125125- echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
126126- else
127127- echo "fzf"
128128- end
129129- end
130130-131131- bind \cr fzf-history-widget
132132- if not set -q FZF_CTRL_T_COMMAND; or test -n "$FZF_CTRL_T_COMMAND"
133133- bind \ct fzf-file-widget
134134- end
135135- if not set -q FZF_ALT_C_COMMAND; or test -n "$FZF_ALT_C_COMMAND"
136136- bind \ec fzf-cd-widget
137137- end
138138-139139- if bind -M insert > /dev/null 2>&1
140140- bind -M insert \cr fzf-history-widget
141141- if not set -q FZF_CTRL_T_COMMAND; or test -n "$FZF_CTRL_T_COMMAND"
142142- bind -M insert \ct fzf-file-widget
143143- end
144144- if not set -q FZF_ALT_C_COMMAND; or test -n "$FZF_ALT_C_COMMAND"
145145- bind -M insert \ec fzf-cd-widget
146146- end
147147- end
148148-149149- function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix'
150150- set -l commandline (commandline -t)
151151-152152- # strip -option= from token if present
153153- set -l prefix (string match -r -- '^-[^\s=]+=' $commandline)
154154- set commandline (string replace -- "$prefix" '' $commandline)
155155-156156- # eval is used to do shell expansion on paths
157157- eval set commandline $commandline
158158-159159- if [ -z $commandline ]
160160- # Default to current directory with no --query
161161- set dir '.'
162162- set fzf_query ''
163163- else
164164- set dir (__fzf_get_dir $commandline)
165165-166166- if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ]
167167- # if $dir is "." but commandline is not a relative path, this means no file path found
168168- set fzf_query $commandline
169169- else
170170- # Also remove trailing slash after dir, to "split" input properly
171171- set fzf_query (string replace -r "^$dir/?" -- '' "$commandline")
172172- end
173173- end
174174-175175- echo $dir
176176- echo $fzf_query
177177- echo $prefix
178178- end
179179-180180- function __fzf_get_dir -d 'Find the longest existing filepath from input string'
181181- set dir $argv
182182-183183- # Strip all trailing slashes. Ignore if $dir is root dir (/)
184184- if [ (string length -- $dir) -gt 1 ]
185185- set dir (string replace -r '/*$' -- '' $dir)
186186- end
187187-188188- # Iteratively check if dir exists and strip tail end of path
189189- while [ ! -d "$dir" ]
190190- # If path is absolute, this can keep going until ends up at /
191191- # If path is relative, this can keep going until entire input is consumed, dirname returns "."
192192- set dir (dirname -- "$dir")
193193- end
194194-195195- echo $dir
196196- end
197197-198198-end
199199-### end: key-bindings.fish ###
200200-fzf_key_bindings
-20
fish/functions/rfv.fish
···11-# ripgrep->fzf->nvim [QUERY]
22-# Ripped from: https://junegunn.github.io/fzf/tips/ripgrep-integration/
33-function rfv
44- set -lx RELOAD 'reload:rg --column --color=always --smart-case {q} || :'
55- set -lx OPENER 'if [[ $FZF_SELECT_COUNT -eq 0 ]]; then
66- nvim {1} +{2} # No selection. Open the current line in Vim.
77- else
88- nvim +cw -q {+f} # Build quickfix list for the selected items.
99- fi'
1010- fzf < /dev/null \
1111- --disabled --ansi --multi \
1212- --bind "start:$RELOAD" --bind "change:$RELOAD" \
1313- --bind "enter:become:$OPENER" \
1414- --bind "ctrl-o:execute:$OPENER" \
1515- --bind 'alt-a:select-all,alt-d:deselect-all,ctrl-/:toggle-preview' \
1616- --delimiter : \
1717- --preview 'bat --style=full --color=always --highlight-line {2} {1}' \
1818- --preview-window '~4,+{2}+4/3,<80(up)' \
1919- --query "$argv"
2020-end
···11+# Edit this configuration file to define what should be installed on
22+# your system. Help is available in the configuration.nix(5) man page, on
33+# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
44+55+{
66+ config,
77+ lib,
88+ pkgs,
99+ inputs,
1010+ ...
1111+}:
1212+let
1313+ system = pkgs.stdenv.targetPlatform.system;
1414+ agave = (builtins.getFlake "/home/noah/repos/agave");
1515+in
1616+{
1717+ imports = [
1818+ # Include the results of the hardware scan.
1919+ ./hardware-configuration.nix
2020+ agave.nixosModules.default
2121+ ];
2222+2323+ nix.settings.experimental-features = [
2424+ "nix-command"
2525+ "flakes"
2626+ ];
2727+2828+ # Use the systemd-boot EFI boot loader.
2929+ boot.loader.systemd-boot.enable = true;
3030+ #boot.loader.grub.device = "nodev";
3131+ #boot.loader.grub.efiSupport = true;
3232+ #boot.loader.grub.useOSProber = true;
3333+ boot.loader.efi.canTouchEfiVariables = true;
3434+3535+ # Use latest kernel.
3636+ boot.kernelPackages = pkgs.linuxPackages_latest;
3737+3838+ networking.hostName = "edge"; # Define your hostname.
3939+4040+ # Configure network connections interactively with nmcli or nmtui.
4141+ networking.networkmanager.enable = true;
4242+4343+ # Set your time zone.
4444+ # time.timeZone = "Europe/Amsterdam";
4545+4646+ # Configure network proxy if necessary
4747+ # networking.proxy.default = "http://user:password@proxy:port/";
4848+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
4949+5050+ # Select internationalisation properties.
5151+ i18n.defaultLocale = "en_US.UTF-8";
5252+ console = {
5353+ font = "Lat2-Terminus16";
5454+ keyMap = "us";
5555+ #useXkbConfig = true; # use xkb.options in tty.
5656+ };
5757+5858+ # Enable the X11 windowing system.
5959+ # services.xserver.enable = true;
6060+6161+ # Configure keymap in X11
6262+ # services.xserver.xkb.layout = "us";
6363+ # services.xserver.xkb.options = "eurosign:e,caps:escape";
6464+6565+ # Enable CUPS to print documents.
6666+ # services.printing.enable = true;
6767+6868+ # Enable sound.
6969+ # services.pulseaudio.enable = true;
7070+ # OR
7171+ # services.pipewire = {
7272+ # enable = true;
7373+ # pulse.enable = true;
7474+ # };
7575+7676+ # Enable touchpad support (enabled default in most desktopManager).
7777+ # services.libinput.enable = true;
7878+7979+ # Define a user account. Don't forget to set a password with ‘passwd’.
8080+ # users.users.alice = {
8181+ # isNormalUser = true;
8282+ # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
8383+ # packages = with pkgs; [
8484+ # tree
8585+ # ];
8686+ # };
8787+8888+ # programs.firefox.enable = true;
8989+9090+ # List packages installed in system profile.
9191+ # You can use https://search.nixos.org/ to find more packages (and options).
9292+ environment.systemPackages = with pkgs; [
9393+ neovim
9494+ wget
9595+ git
9696+ htop
9797+ inputs.agenix.packages."${system}".agenix
9898+ agave.packages.${system}.solana
9999+ agave.packages.${system}.solana-keygen
100100+ ];
101101+102102+ services.tailscale.useRoutingFeatures = "both";
103103+104104+ # Some programs need SUID wrappers, can be configured further or are
105105+ # started in user sessions.
106106+ # programs.mtr.enable = true;
107107+ # programs.gnupg.agent = {
108108+ # enable = true;
109109+ # enableSSHSupport = true;
110110+ # };
111111+112112+ # List services that you want to enable:
113113+114114+ # Enable the OpenSSH daemon.
115115+ services.openssh.enable = true;
116116+ services.openssh.openFirewall = true;
117117+118118+ # Open ports in the firewall.
119119+ # networking.firewall.allowedTCPPorts = [ ... ];
120120+ # networking.firewall.allowedUDPPorts = [ ... ];
121121+ # Or disable the firewall altogether.
122122+ networking.firewall.enable = true;
123123+ networking.firewall = {
124124+ allowPing = true;
125125+ allowedUDPPorts = [ ];
126126+ allowedUDPPortRanges = [
127127+ # Agave
128128+ {
129129+ from = 8000;
130130+ to = 8020;
131131+ }
132132+ ];
133133+ allowedTCPPorts = [
134134+ 2375
135135+ 3000
136136+ # Agave
137137+ 8001
138138+ 8899
139139+ 8900
140140+ 10000
141141+ ];
142142+ };
143143+ security.pam.loginLimits = [
144144+ {
145145+ domain = "*";
146146+ type = "soft";
147147+ item = "nofile";
148148+ value = "100000";
149149+ }
150150+ {
151151+ domain = "*";
152152+ type = "hard";
153153+ item = "nofile";
154154+ value = "1000000";
155155+ }
156156+ ];
157157+158158+ age.secrets.validator-identity = {
159159+ file = ../../secrets/validator-identity.age;
160160+ owner = "sol";
161161+ group = "sol";
162162+ };
163163+ services.ambient-validator = {
164164+ enable = true;
165165+ package = agave.packages.${system}.ambient-validator;
166166+ # this needs to be a secret
167167+ identityKeypair = config.age.secrets.validator-identity.path;
168168+ rpcBindAddress = "0.0.0.0";
169169+ geyserPluginConfig = {
170170+ libpath = "${agave.packages.${system}.yellowstone-geyser}/lib/libyellowstone_grpc_geyser.so";
171171+ log = {
172172+ level = "info";
173173+ };
174174+ tokio = {
175175+ worker_threads = 4;
176176+ affinity = null;
177177+ };
178178+ grpc = {
179179+ address = "0.0.0.0:10000";
180180+ };
181181+ };
182182+ };
183183+ # Copy the NixOS configuration file and link it from the resulting system
184184+ # (/run/current-system/configuration.nix). This is useful in case you
185185+ # accidentally delete configuration.nix.
186186+ # system.copySystemConfiguration = true;
187187+188188+ # This option defines the first version of NixOS you have installed on this particular machine,
189189+ # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
190190+ #
191191+ # Most users should NEVER change this value after the initial install, for any reason,
192192+ # even if you've upgraded your system to a new NixOS release.
193193+ #
194194+ # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
195195+ # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
196196+ # to actually do that.
197197+ #
198198+ # This value being lower than the current NixOS release does NOT mean your system is
199199+ # out of date, out of support, or vulnerable.
200200+ #
201201+ # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
202202+ # and migrated your data accordingly.
203203+ #
204204+ # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
205205+ system.stateVersion = "25.11"; # Did you read the comment?
206206+207207+}
···11+# Edit this configuration file to define what should be installed on
22+## your system. Help is available in the configuration.nix(5) man page, on
33+# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
44+55+{ ... }:
66+{
77+ imports = [
88+ # Include the results of the hardware scan.
99+ ./hardware-configuration.nix
1010+ ./boot.nix
1111+ ./networking.nix
1212+ #./gui.nix
1313+ ./packages.nix
1414+ ./services.nix
1515+ ];
1616+1717+ nixpkgs.config.allowUnfree = true;
1818+1919+ # Set your time zone.
2020+ time.timeZone = "America/Chicago";
2121+2222+ # Select internationalisation properties.
2323+ i18n.defaultLocale = "en_US.UTF-8";
2424+ # console = {
2525+ # font = "Lat2-Terminus16";
2626+ # keyMap = "us";
2727+ # useXkbConfig = true; # use xkb.options in tty.
2828+ # };
2929+3030+ # Automatic doc cache generation
3131+ documentation.man.generateCaches = true;
3232+3333+ # Automatic system upgrades
3434+ system.autoUpgrade = {
3535+ enable = true;
3636+ dates = "09:00";
3737+ randomizedDelaySec = "45min";
3838+ };
3939+4040+ # Automatic Garbage Collection
4141+ nix.gc.automatic = true;
4242+ nix.gc.options = "--delete-older-than 8d";
4343+4444+ # This option defines the first version of NixOS you have installed on this particular machine,
4545+ # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
4646+ #
4747+ # Most users should NEVER change this value after the initial install, for any reason,
4848+ # even if you've upgraded your system to a new NixOS release.
4949+ #
5050+ # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
5151+ # so changing it will NOT upgrade your system.
5252+ #
5353+ # This value being lower than the current NixOS release does NOT mean your system is
5454+ # out of date, out of support, or vulnerable.
5555+ #
5656+ # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
5757+ # and migrated your data accordingly.
5858+ #
5959+ # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
6060+ system.stateVersion = "23.11"; # Did you read the comment?
6161+6262+}