···1-### key-bindings.fish ###
2-# ____ ____
3-# / __/___ / __/
4-# / /_/_ / / /_
5-# / __/ / /_/ __/
6-# /_/ /___/_/ key-bindings.fish
7-#
8-# - $FZF_TMUX_OPTS
9-# - $FZF_CTRL_T_COMMAND
10-# - $FZF_CTRL_T_OPTS
11-# - $FZF_CTRL_R_OPTS
12-# - $FZF_ALT_C_COMMAND
13-# - $FZF_ALT_C_OPTS
14-15-status is-interactive; or exit 0
16-17-18-# Key bindings
19-# ------------
20-function fzf_key_bindings
21-22- function __fzf_defaults
23- # $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
24- # $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
25- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
26- echo "--height $FZF_TMUX_HEIGHT --bind=ctrl-z:ignore" $argv[1]
27- command cat "$FZF_DEFAULT_OPTS_FILE" 2> /dev/null
28- echo $FZF_DEFAULT_OPTS $argv[2]
29- end
30-31- # Store current token in $dir as root for the 'find' command
32- function fzf-file-widget -d "List files and folders"
33- set -l commandline (__fzf_parse_commandline)
34- set -lx dir $commandline[1]
35- set -l fzf_query $commandline[2]
36- set -l prefix $commandline[3]
37-38- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
39- begin
40- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "--reverse --walker=file,dir,follow,hidden --scheme=path --walker-root='$dir'" "$FZF_CTRL_T_OPTS")
41- set -lx FZF_DEFAULT_COMMAND "$FZF_CTRL_T_COMMAND"
42- set -lx FZF_DEFAULT_OPTS_FILE ''
43- eval (__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end
44- end
45- if [ -z "$result" ]
46- commandline -f repaint
47- return
48- else
49- # Remove last token from commandline.
50- commandline -t ""
51- end
52- for i in $result
53- commandline -it -- $prefix
54- commandline -it -- (string escape $i)
55- commandline -it -- ' '
56- end
57- commandline -f repaint
58- end
59-60- function fzf-history-widget -d "Show command history"
61- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
62- begin
63- set -l FISH_MAJOR (echo $version | cut -f1 -d.)
64- set -l FISH_MINOR (echo $version | cut -f2 -d.)
65-66- # merge history from other sessions before searching
67- if test -z "$fish_private_mode"
68- builtin history merge
69- end
70-71- # history's -z flag is needed for multi-line support.
72- # history's -z flag was added in fish 2.4.0, so don't use it for versions
73- # before 2.4.0.
74- if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];
75- if type -P perl > /dev/null 2>&1
76- 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")
77- set -lx FZF_DEFAULT_OPTS_FILE ''
78- 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
79- and commandline -- $result
80- else
81- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "--scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '"\t"↳ ' --highlight-line $FZF_CTRL_R_OPTS +m")
82- set -lx FZF_DEFAULT_OPTS_FILE ''
83- builtin history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
84- and commandline -- $result
85- end
86- else
87- builtin history | eval (__fzfcmd) -q '(commandline)' | read -l result
88- and commandline -- $result
89- end
90- end
91- commandline -f repaint
92- end
93-94- function fzf-cd-widget -d "Change directory"
95- set -l commandline (__fzf_parse_commandline)
96- set -lx dir $commandline[1]
97- set -l fzf_query $commandline[2]
98- set -l prefix $commandline[3]
99-100- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
101- begin
102- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "--reverse --walker=dir,follow,hidden --scheme=path --walker-root='$dir'" "$FZF_ALT_C_OPTS")
103- set -lx FZF_DEFAULT_OPTS_FILE ''
104- set -lx FZF_DEFAULT_COMMAND "$FZF_ALT_C_COMMAND"
105- eval (__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
106-107- if [ -n "$result" ]
108- cd -- $result
109-110- # Remove last token from commandline.
111- commandline -t ""
112- commandline -it -- $prefix
113- end
114- end
115-116- commandline -f repaint
117- end
118-119- function __fzfcmd
120- test -n "$FZF_TMUX"; or set FZF_TMUX 0
121- test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
122- if [ -n "$FZF_TMUX_OPTS" ]
123- echo "fzf-tmux $FZF_TMUX_OPTS -- "
124- else if [ $FZF_TMUX -eq 1 ]
125- echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
126- else
127- echo "fzf"
128- end
129- end
130-131- bind \cr fzf-history-widget
132- if not set -q FZF_CTRL_T_COMMAND; or test -n "$FZF_CTRL_T_COMMAND"
133- bind \ct fzf-file-widget
134- end
135- if not set -q FZF_ALT_C_COMMAND; or test -n "$FZF_ALT_C_COMMAND"
136- bind \ec fzf-cd-widget
137- end
138-139- if bind -M insert > /dev/null 2>&1
140- bind -M insert \cr fzf-history-widget
141- if not set -q FZF_CTRL_T_COMMAND; or test -n "$FZF_CTRL_T_COMMAND"
142- bind -M insert \ct fzf-file-widget
143- end
144- if not set -q FZF_ALT_C_COMMAND; or test -n "$FZF_ALT_C_COMMAND"
145- bind -M insert \ec fzf-cd-widget
146- end
147- end
148-149- function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix'
150- set -l commandline (commandline -t)
151-152- # strip -option= from token if present
153- set -l prefix (string match -r -- '^-[^\s=]+=' $commandline)
154- set commandline (string replace -- "$prefix" '' $commandline)
155-156- # eval is used to do shell expansion on paths
157- eval set commandline $commandline
158-159- if [ -z $commandline ]
160- # Default to current directory with no --query
161- set dir '.'
162- set fzf_query ''
163- else
164- set dir (__fzf_get_dir $commandline)
165-166- if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ]
167- # if $dir is "." but commandline is not a relative path, this means no file path found
168- set fzf_query $commandline
169- else
170- # Also remove trailing slash after dir, to "split" input properly
171- set fzf_query (string replace -r "^$dir/?" -- '' "$commandline")
172- end
173- end
174-175- echo $dir
176- echo $fzf_query
177- echo $prefix
178- end
179-180- function __fzf_get_dir -d 'Find the longest existing filepath from input string'
181- set dir $argv
182-183- # Strip all trailing slashes. Ignore if $dir is root dir (/)
184- if [ (string length -- $dir) -gt 1 ]
185- set dir (string replace -r '/*$' -- '' $dir)
186- end
187-188- # Iteratively check if dir exists and strip tail end of path
189- while [ ! -d "$dir" ]
190- # If path is absolute, this can keep going until ends up at /
191- # If path is relative, this can keep going until entire input is consumed, dirname returns "."
192- set dir (dirname -- "$dir")
193- end
194-195- echo $dir
196- end
197-198-end
199-### end: key-bindings.fish ###
200-fzf_key_bindings
···1+# Edit this configuration file to define what should be installed on
2+# your system. Help is available in the configuration.nix(5) man page, on
3+# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
4+5+{
6+ config,
7+ lib,
8+ pkgs,
9+ inputs,
10+ ...
11+}:
12+let
13+ system = pkgs.stdenv.targetPlatform.system;
14+ agave = (builtins.getFlake "/home/noah/repos/agave");
15+in
16+{
17+ imports = [
18+ # Include the results of the hardware scan.
19+ ./hardware-configuration.nix
20+ agave.nixosModules.default
21+ ];
22+23+ nix.settings.experimental-features = [
24+ "nix-command"
25+ "flakes"
26+ ];
27+28+ # Use the systemd-boot EFI boot loader.
29+ boot.loader.systemd-boot.enable = true;
30+ #boot.loader.grub.device = "nodev";
31+ #boot.loader.grub.efiSupport = true;
32+ #boot.loader.grub.useOSProber = true;
33+ boot.loader.efi.canTouchEfiVariables = true;
34+35+ # Use latest kernel.
36+ boot.kernelPackages = pkgs.linuxPackages_latest;
37+38+ networking.hostName = "edge"; # Define your hostname.
39+40+ # Configure network connections interactively with nmcli or nmtui.
41+ networking.networkmanager.enable = true;
42+43+ # Set your time zone.
44+ # time.timeZone = "Europe/Amsterdam";
45+46+ # Configure network proxy if necessary
47+ # networking.proxy.default = "http://user:password@proxy:port/";
48+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
49+50+ # Select internationalisation properties.
51+ i18n.defaultLocale = "en_US.UTF-8";
52+ console = {
53+ font = "Lat2-Terminus16";
54+ keyMap = "us";
55+ #useXkbConfig = true; # use xkb.options in tty.
56+ };
57+58+ # Enable the X11 windowing system.
59+ # services.xserver.enable = true;
60+61+ # Configure keymap in X11
62+ # services.xserver.xkb.layout = "us";
63+ # services.xserver.xkb.options = "eurosign:e,caps:escape";
64+65+ # Enable CUPS to print documents.
66+ # services.printing.enable = true;
67+68+ # Enable sound.
69+ # services.pulseaudio.enable = true;
70+ # OR
71+ # services.pipewire = {
72+ # enable = true;
73+ # pulse.enable = true;
74+ # };
75+76+ # Enable touchpad support (enabled default in most desktopManager).
77+ # services.libinput.enable = true;
78+79+ # Define a user account. Don't forget to set a password with ‘passwd’.
80+ # users.users.alice = {
81+ # isNormalUser = true;
82+ # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
83+ # packages = with pkgs; [
84+ # tree
85+ # ];
86+ # };
87+88+ # programs.firefox.enable = true;
89+90+ # List packages installed in system profile.
91+ # You can use https://search.nixos.org/ to find more packages (and options).
92+ environment.systemPackages = with pkgs; [
93+ neovim
94+ wget
95+ git
96+ htop
97+ inputs.agenix.packages."${system}".agenix
98+ agave.packages.${system}.solana
99+ agave.packages.${system}.solana-keygen
100+ ];
101+102+ services.tailscale.useRoutingFeatures = "both";
103+104+ # Some programs need SUID wrappers, can be configured further or are
105+ # started in user sessions.
106+ # programs.mtr.enable = true;
107+ # programs.gnupg.agent = {
108+ # enable = true;
109+ # enableSSHSupport = true;
110+ # };
111+112+ # List services that you want to enable:
113+114+ # Enable the OpenSSH daemon.
115+ services.openssh.enable = true;
116+ services.openssh.openFirewall = true;
117+118+ # Open ports in the firewall.
119+ # networking.firewall.allowedTCPPorts = [ ... ];
120+ # networking.firewall.allowedUDPPorts = [ ... ];
121+ # Or disable the firewall altogether.
122+ networking.firewall.enable = true;
123+ networking.firewall = {
124+ allowPing = true;
125+ allowedUDPPorts = [ ];
126+ allowedUDPPortRanges = [
127+ # Agave
128+ {
129+ from = 8000;
130+ to = 8020;
131+ }
132+ ];
133+ allowedTCPPorts = [
134+ 2375
135+ 3000
136+ # Agave
137+ 8001
138+ 8899
139+ 8900
140+ 10000
141+ ];
142+ };
143+ security.pam.loginLimits = [
144+ {
145+ domain = "*";
146+ type = "soft";
147+ item = "nofile";
148+ value = "100000";
149+ }
150+ {
151+ domain = "*";
152+ type = "hard";
153+ item = "nofile";
154+ value = "1000000";
155+ }
156+ ];
157+158+ age.secrets.validator-identity = {
159+ file = ../../secrets/validator-identity.age;
160+ owner = "sol";
161+ group = "sol";
162+ };
163+ services.ambient-validator = {
164+ enable = true;
165+ package = agave.packages.${system}.ambient-validator;
166+ # this needs to be a secret
167+ identityKeypair = config.age.secrets.validator-identity.path;
168+ rpcBindAddress = "0.0.0.0";
169+ geyserPluginConfig = {
170+ libpath = "${agave.packages.${system}.yellowstone-geyser}/lib/libyellowstone_grpc_geyser.so";
171+ log = {
172+ level = "info";
173+ };
174+ tokio = {
175+ worker_threads = 4;
176+ affinity = null;
177+ };
178+ grpc = {
179+ address = "0.0.0.0:10000";
180+ };
181+ };
182+ };
183+ # Copy the NixOS configuration file and link it from the resulting system
184+ # (/run/current-system/configuration.nix). This is useful in case you
185+ # accidentally delete configuration.nix.
186+ # system.copySystemConfiguration = true;
187+188+ # This option defines the first version of NixOS you have installed on this particular machine,
189+ # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
190+ #
191+ # Most users should NEVER change this value after the initial install, for any reason,
192+ # even if you've upgraded your system to a new NixOS release.
193+ #
194+ # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
195+ # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
196+ # to actually do that.
197+ #
198+ # This value being lower than the current NixOS release does NOT mean your system is
199+ # out of date, out of support, or vulnerable.
200+ #
201+ # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
202+ # and migrated your data accordingly.
203+ #
204+ # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
205+ system.stateVersion = "25.11"; # Did you read the comment?
206+207+}
···1+# Edit this configuration file to define what should be installed on
2+## your system. Help is available in the configuration.nix(5) man page, on
3+# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
4+5+{ ... }:
6+{
7+ imports = [
8+ # Include the results of the hardware scan.
9+ ./hardware-configuration.nix
10+ ./boot.nix
11+ ./networking.nix
12+ #./gui.nix
13+ ./packages.nix
14+ ./services.nix
15+ ];
16+17+ nixpkgs.config.allowUnfree = true;
18+19+ # Set your time zone.
20+ time.timeZone = "America/Chicago";
21+22+ # Select internationalisation properties.
23+ i18n.defaultLocale = "en_US.UTF-8";
24+ # console = {
25+ # font = "Lat2-Terminus16";
26+ # keyMap = "us";
27+ # useXkbConfig = true; # use xkb.options in tty.
28+ # };
29+30+ # Automatic doc cache generation
31+ documentation.man.generateCaches = true;
32+33+ # Automatic system upgrades
34+ system.autoUpgrade = {
35+ enable = true;
36+ dates = "09:00";
37+ randomizedDelaySec = "45min";
38+ };
39+40+ # Automatic Garbage Collection
41+ nix.gc.automatic = true;
42+ nix.gc.options = "--delete-older-than 8d";
43+44+ # This option defines the first version of NixOS you have installed on this particular machine,
45+ # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
46+ #
47+ # Most users should NEVER change this value after the initial install, for any reason,
48+ # even if you've upgraded your system to a new NixOS release.
49+ #
50+ # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
51+ # so changing it will NOT upgrade your system.
52+ #
53+ # This value being lower than the current NixOS release does NOT mean your system is
54+ # out of date, out of support, or vulnerable.
55+ #
56+ # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
57+ # and migrated your data accordingly.
58+ #
59+ # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
60+ system.stateVersion = "23.11"; # Did you read the comment?
61+62+}