diff --git a/nixos/common/modules/ssh-luks.nix b/nixos/common/modules/ssh-luks.nix index a49e447f..9e64476e 100644 --- a/nixos/common/modules/ssh-luks.nix +++ b/nixos/common/modules/ssh-luks.nix @@ -3,8 +3,6 @@ # Unlock command: # ssh root@<Local_IP_Address> "Password" - boot.kernelParams = [ "ip=dhcp" ]; - boot.initrd = { enable = true; systemd.users.root.shell = "/bin/systemd-tty-ask-password-agent"; diff --git a/nixos/hosts/framework-server/default.nix b/nixos/hosts/framework-server/default.nix index ff9548e4..fe3b8d4d 100644 --- a/nixos/hosts/framework-server/default.nix +++ b/nixos/hosts/framework-server/default.nix @@ -19,6 +19,9 @@ ./firewall.nix ]; + # TODO: Set a static IP when you can + boot.kernelParams = [ "ip=dhcp" ]; + environment.systemPackages = [ inputs.deploy-rs.packages.${system}.deploy-rs pkgs.distrobox diff --git a/nixos/hosts/nuc-server/default.nix b/nixos/hosts/nuc-server/default.nix index 59b44c1c..8115dc3f 100644 --- a/nixos/hosts/nuc-server/default.nix +++ b/nixos/hosts/nuc-server/default.nix @@ -1,4 +1,9 @@ -{ inputs, config, lib, modulesPath, system, ... }: { +{ hostname, inputs, config, lib, modulesPath, system, ... }: +let + ipAddress = "192.168.1.35"; + gateway = "192.168.1.1"; + netDev = "eno1"; +in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ../../common/services/tailscale-autoconnect.nix @@ -12,25 +17,32 @@ ./firewall.nix ]; - environment.systemPackages = [ - inputs.deploy-rs.packages.${system}.deploy-rs - ]; + boot.kernelParams = [ "ip=${ipAddress}::${gateway}:255.255.255.0:${hostname}:${netDev}:none" ]; + networking = { + useDHCP = false; + interfaces.${netDev} = { + ipv4.addresses = [{ + address = ipAddress; + prefixLength = 24; + }]; + }; + defaultGateway = gateway; +}; + # Allow root login, but only with SSH keys + services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password"; # backups-rpi4: Backups # warsaw-ovh-01: Backups users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKp2wgqFcr0LGaUXbom88/zK2631pysePUWIaCMljT0K root@backups-rpi4'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIcGPkzFaSGd1q/oy/uP5zEoOuPNr1h17ifu7oj4DaYO root@warsaw-ovh-01'' ]; - # Allow root login, but only with SSH keys - services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password"; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "sd_mod" "uas" ]; boot.initrd.kernelModules = [ "r8152" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ]; - networking.useDHCP = lib.mkDefault true; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; @@ -38,7 +50,7 @@ time.timeZone = "America/Los_Angeles"; # Set the networking hostname: - networking.hostName = "nuc-server"; + networking.hostName = hostname; # networking.firewall.allowedTCPPorts = [ 22 ]; services.tailscale.extraUpFlags = [