{ inputs, pkgs, hostname, ... }: { # NixOS version. system.stateVersion = "25.05"; # nix config. nix = { # Set $NIX_PATH. nixPath = ["nixpkgs=${inputs.nixpkgs}"]; # Optimise store. optimise = { automatic = true; dates = ["daily"]; }; settings = { # Enable flakes. experimental-features = [ "nix-command" "flakes" ]; }; }; # Install nh + enable autocleanup of store. programs.nh = { enable = true; clean = { enable = true; extraArgs = "--keep 3"; dates = "daily"; }; }; # Enable redistributable firmware. hardware.enableRedistributableFirmware = true; # Enable firmware updates. services.fwupd.enable = true; # Set time zone. time.timeZone = "Australia/Perth"; # Select internationalisation properties. i18n.defaultLocale = "en_AU.UTF-8"; i18n.extraLocaleSettings = { LC_ADDRESS = "en_AU.UTF-8"; LC_IDENTIFICATION = "en_AU.UTF-8"; LC_MEASUREMENT = "en_AU.UTF-8"; LC_MONETARY = "en_AU.UTF-8"; LC_NAME = "en_AU.UTF-8"; LC_NUMERIC = "en_AU.UTF-8"; LC_PAPER = "en_AU.UTF-8"; LC_TELEPHONE = "en_AU.UTF-8"; LC_TIME = "en_AU.UTF-8"; }; # Configure keymap in X11. services.xserver.xkb = { layout = "us"; variant = ""; }; # Enable networking. networking.networkmanager.enable = true; users.groups.networkmanager.members = ["fern"]; # Set hostname networking.hostName = hostname; # Define a user account. users.users.fern = { isNormalUser = true; uid = 1000; description = "Fern Garden"; extraGroups = ["wheel"]; }; # Set fish as default shell (https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell). programs.bash = { interactiveShellInit = '' if [[ $(ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] then shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" exec ${pkgs.fish}/bin/fish $LOGIN_OPTION fi ''; }; documentation.man.generateCaches = false; # https://discourse.nixos.org/t/slow-build-at-building-man-cache/52365/2 # Enable all terminfo (for ghostty). environment.enableAllTerminfo = true; # Enable avahi hostname resolution. services.avahi = { enable = true; nssmdns4 = true; publish = { enable = true; addresses = true; domain = true; userServices = true; }; }; }