vpsConfig

my VPS configuration deployed through nixosAnywhere
Log | Files | Refs

configuration.nix (1433B)


      1 { modulesPath, pkgs, ... }: {
      2   system.stateVersion = "24.05";
      3   imports = [
      4     (modulesPath + "/profiles/qemu-guest.nix")
      5     ./containers/minecraft.nix
      6     ./containers/websites.nix
      7   ];
      8 
      9   boot.loader.grub = {
     10     efiSupport = true;
     11     efiInstallAsRemovable = true;
     12   };
     13 
     14   disko.devices.disk.disk1.device = "/dev/sda";
     15 
     16   services.openssh = {
     17     enable = true;
     18     settings = {
     19       PasswordAuthentication = false;
     20       KbdInteractiveAuthentication = false;
     21     };
     22   };
     23 
     24  # users.users.over.
     25   users.users.over = {
     26     isNormalUser = true;
     27     extraGroups = [ "wheel" ];
     28     openssh.authorizedKeys.keys = [
     29       "ssh-ed25519 ... "
     30     ];
     31     packages = with pkgs; [
     32       vim
     33       zellij
     34     ];
     35   };
     36 
     37   nixpkgs.config.allowUnfree = true;
     38   nix.settings = {
     39     trusted-users = [ "root" "over" ];
     40     experimental-features = [ "nix-command" "flakes" ];
     41     auto-optimise-store = true;
     42   };
     43 
     44   users.users.root.openssh.authorizedKeys.keys = [
     45     "ssh-ed25519 ... "
     46   ];
     47 
     48   networking = {
     49     nat = {
     50       enable = true;
     51       internalInterfaces = ["ve-+"];
     52       externalInterface = "eth0";
     53     };
     54     hostName = "t-nix-vps";
     55     useDHCP = false;
     56     interfaces.eth0.ipv4.addresses = [
     57   {
     58 	address = "191.101.2.240";
     59 	prefixLength = 24;
     60       }
     61     ];
     62     defaultGateway = "191.101.2.254";
     63     nameservers = [ "8.8.8.8" "8.8.4.4" ];
     64     firewall = {
     65       enable = true;
     66       allowedTCPPorts = [ 43000 ];
     67     };
     68   };
     69 }
     70