···2727 # this value at the release version of the first install of this system.
2828 # Before changing this value read the documentation for this option
2929 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
3030- system.stateVersion = "23.11"; # Did you read the comment?
3030+ #system.stateVersion = "23.11"; # Did you read the comment?
3131}
···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+{ config, lib, pkgs, inputs, ... }:
66+let
77+ system = pkgs.stdenv.targetPlatform.system;
88+ agave = (builtins.getFlake "/home/noah/repos/agave");
99+in
1010+{
1111+ imports =
1212+ [ # Include the results of the hardware scan.
1313+ ./hardware-configuration.nix
1414+ agave.nixosModules.default
1515+ ];
1616+1717+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
1818+1919+ # Use the systemd-boot EFI boot loader.
2020+ boot.loader.systemd-boot.enable = true;
2121+ #boot.loader.grub.device = "nodev";
2222+ #boot.loader.grub.efiSupport = true;
2323+ #boot.loader.grub.useOSProber = true;
2424+ boot.loader.efi.canTouchEfiVariables = true;
2525+2626+ # Use latest kernel.
2727+ boot.kernelPackages = pkgs.linuxPackages_latest;
2828+2929+ networking.hostName = "edge"; # Define your hostname.
3030+3131+ # Configure network connections interactively with nmcli or nmtui.
3232+ networking.networkmanager.enable = true;
3333+3434+ # Set your time zone.
3535+ # time.timeZone = "Europe/Amsterdam";
3636+3737+ # Configure network proxy if necessary
3838+ # networking.proxy.default = "http://user:password@proxy:port/";
3939+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
4040+4141+ # Select internationalisation properties.
4242+ i18n.defaultLocale = "en_US.UTF-8";
4343+ console = {
4444+ font = "Lat2-Terminus16";
4545+ keyMap = "us";
4646+ #useXkbConfig = true; # use xkb.options in tty.
4747+ };
4848+4949+ # Enable the X11 windowing system.
5050+ # services.xserver.enable = true;
5151+5252+5353+5454+5555+ # Configure keymap in X11
5656+ # services.xserver.xkb.layout = "us";
5757+ # services.xserver.xkb.options = "eurosign:e,caps:escape";
5858+5959+ # Enable CUPS to print documents.
6060+ # services.printing.enable = true;
6161+6262+ # Enable sound.
6363+ # services.pulseaudio.enable = true;
6464+ # OR
6565+ # services.pipewire = {
6666+ # enable = true;
6767+ # pulse.enable = true;
6868+ # };
6969+7070+ # Enable touchpad support (enabled default in most desktopManager).
7171+ # services.libinput.enable = true;
7272+7373+ # Define a user account. Don't forget to set a password with ‘passwd’.
7474+ # users.users.alice = {
7575+ # isNormalUser = true;
7676+ # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
7777+ # packages = with pkgs; [
7878+ # tree
7979+ # ];
8080+ # };
8181+8282+ # programs.firefox.enable = true;
8383+8484+ # List packages installed in system profile.
8585+ # You can use https://search.nixos.org/ to find more packages (and options).
8686+ environment.systemPackages = with pkgs; [
8787+ neovim
8888+ wget
8989+ git
9090+ htop
9191+ inputs.agenix.packages."${system}".agenix
9292+ agave.packages.${system}.solana
9393+ agave.packages.${system}.solana-keygen
9494+ ];
9595+9696+ # Some programs need SUID wrappers, can be configured further or are
9797+ # started in user sessions.
9898+ # programs.mtr.enable = true;
9999+ # programs.gnupg.agent = {
100100+ # enable = true;
101101+ # enableSSHSupport = true;
102102+ # };
103103+104104+ # List services that you want to enable:
105105+106106+ # Enable the OpenSSH daemon.
107107+ services.openssh.enable = true;
108108+ services.openssh.openFirewall = true;
109109+110110+ # Open ports in the firewall.
111111+ # networking.firewall.allowedTCPPorts = [ ... ];
112112+ # networking.firewall.allowedUDPPorts = [ ... ];
113113+ # Or disable the firewall altogether.
114114+ networking.firewall.enable = true;
115115+ networking.firewall = {
116116+ allowPing = true;
117117+ allowedUDPPorts = [ ];
118118+ allowedUDPPortRanges = [
119119+ # Agave
120120+ { from = 8000; to = 8020; }
121121+ ];
122122+ allowedTCPPorts = [
123123+ 2375
124124+ 3000
125125+ # Agave
126126+ 8001
127127+ 8899
128128+ 8900
129129+ 10000
130130+ ];
131131+ };
132132+ security.pam.loginLimits = [
133133+ {
134134+ domain = "*";
135135+ type = "soft";
136136+ item = "nofile";
137137+ value = "100000";
138138+ }
139139+ {
140140+ domain = "*";
141141+ type = "hard";
142142+ item = "nofile";
143143+ value = "1000000";
144144+ }
145145+ ];
146146+147147+ age.secrets.validator-identity = {
148148+ file = ./secrets/validator-identity.age;
149149+ owner = "sol";
150150+ group = "sol";
151151+ };
152152+ services.ambient-validator = {
153153+ enable = true;
154154+ package = agave.packages.${system}.ambient-validator;
155155+ # this needs to be a secret
156156+ identityKeypair = config.age.secrets.validator-identity.path;
157157+ rpcBindAddress = "0.0.0.0";
158158+ geyserPluginConfig = {
159159+ libpath = "${agave.packages.${system}.yellowstone-geyser}/lib/libyellowstone_grpc_geyser.so";
160160+ log = {
161161+ level = "info";
162162+ };
163163+ tokio = {
164164+ worker_threads = 4;
165165+ affinity = null;
166166+ };
167167+ grpc = {
168168+ address = "0.0.0.0:10000";
169169+ };
170170+ };
171171+ };
172172+ # Copy the NixOS configuration file and link it from the resulting system
173173+ # (/run/current-system/configuration.nix). This is useful in case you
174174+ # accidentally delete configuration.nix.
175175+ # system.copySystemConfiguration = true;
176176+177177+ # This option defines the first version of NixOS you have installed on this particular machine,
178178+ # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
179179+ #
180180+ # Most users should NEVER change this value after the initial install, for any reason,
181181+ # even if you've upgraded your system to a new NixOS release.
182182+ #
183183+ # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
184184+ # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
185185+ # to actually do that.
186186+ #
187187+ # This value being lower than the current NixOS release does NOT mean your system is
188188+ # out of date, out of support, or vulnerable.
189189+ #
190190+ # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
191191+ # and migrated your data accordingly.
192192+ #
193193+ # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
194194+ system.stateVersion = "25.11"; # Did you read the comment?
195195+196196+}
197197+