# Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running `nixos-help`). { config, pkgs, ssh, ... }: let ipv4Address = "65.21.145.150"; ipv6Address = "2a01:4f9:c011:9ac1::1"; in { nix = { settings = { experimental-features = [ "nix-command" "flakes" ]; auto-optimise-store = true; }; gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 30d"; }; }; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "freun-dev"; # Define your hostname. networking.domain = "freun.dev"; networking.useDHCP = false; networking.nftables.enable = true; services.octodns.records = { "" = { A = { ttl = 86400; values = [ ipv4Address ]; }; AAAA = { ttl = 86400; values = [ ipv6Address ]; }; TXT = { ttl = 86400; values = [ "v=spf1 include:spf.uberspace.de ~all" ]; }; }; "_dmarc".TXT = { ttl = 86400; values = [ "v=DMARC1; p=reject" ]; }; "uberspace._domainkey".TXT = { ttl = 86400; values = [ "v=DKIM1\\;t=s\\;n=core\\;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArjZrrWhFn/xSH3+aPA3G1eGD5yAeyn7ZhHSCBM7b/9A5Fny9URjEf1La7dcU+oF/d7outgmTCs/umItBCB7ybkMriaLC+RBZJY0blf35bMYWL9NLpbKzVVAZQPgDZJm7R/grbg0nJgb5RCGLYu9iPcRjJtpu2vYaitkNh8WJ4q+iA/YOos2pQmP+6I5zLTVenFfEWJccdtfhJcORSuONN+Xi1+dQxpQzlwxUWz4DgOsfVaE3woDH3RAAQCtiMyk8ZQhhrL85pHH6zT3sNXzzVphJdIIYA+VYAgYYOTkRbdDhYSd5zCDX5f4L1UmBsJS2ommBGvw2qMDhagXsaN32BwIDAQAB" ]; }; "ts" = { A = { ttl = 86400; values = [ "100.84.105.63" ]; }; AAAA = { ttl = 86400; values = [ "fd7a:115c:a1e0::7901:693f" ]; }; }; }; systemd.network = { enable = true; networks.static = { name = "enp1s0"; address = [ "${ipv4Address}/32" "${ipv6Address}/64" ]; routes = [ { Gateway = "fe80::1"; } { Gateway = "172.31.1.1"; GatewayOnLink = true; } ]; dns = [ # Hetzner "185.12.64.1" "185.12.64.2" "2a01:4ff:ff00::add:1" "2a01:4ff:ff00::add:2" # Quad9 "9.9.9.9" "149.112.112.112" "2620:fe::fe" "2620:fe::9" ]; }; }; services.networkd-dispatcher = { enable = true; rules."50-tailscale" = { onState = [ "routable" ]; script = '' #!${pkgs.runtimeShell} ${pkgs.ethtool}/bin/ethtool -K ${config.systemd.network.networks.static.name} rx-udp-gro-forwarding on rx-gro-list off ''; }; }; # Set your time zone. time.timeZone = "Europe/Helsinki"; # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; # console = { # font = "Lat2-Terminus16"; # keyMap = "us"; # useXkbConfig = true; # use xkbOptions in tty. # }; # Configure keymap in X11 services.xserver.xkb.layout = "us"; services.xserver.xkb.options = "eurosign:e,caps:escape"; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.jokke = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. packages = [ pkgs.nh ]; openssh.authorizedKeys.keys = [ ssh.publicKeys.yubikey ]; }; users.users.root.openssh.authorizedKeys.keys = [ ssh.publicKeys.yubikey ]; nix.settings.trusted-users = [ "jokke" ]; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget htop git ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; # programs.gnupg.agent = { # enable = true; # enableSSHSupport = true; # }; # List services that you want to enable: # Enable the OpenSSH daemon. services.openssh = { enable = true; settings.PasswordAuthentication = false; }; modules.firewall = { enable = true; allInterfaces = [ "ssh" ]; }; # Copy the NixOS configuration file and link it from the resulting system # (/run/current-system/configuration.nix). This is useful in case you # accidentally delete configuration.nix. # system.copySystemConfiguration = true; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.11"; # Did you read the comment? }