From e0c87891ce835a2c095a76bfe08e08fe0a4e1780 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sat, 19 Apr 2025 20:31:26 -0500 Subject: [PATCH] pull ipaddrs from separate repo initial --- nixos/configuration.nix | 37 ++++++++++++++++++-------------- nixos/flake.nix | 5 +++++ nixos/hardware-configuration.nix | 2 +- nixos/home.nix | 1 + nixos/ip-addresses.nix | 3 --- 5 files changed, 28 insertions(+), 20 deletions(-) delete mode 100644 nixos/ip-addresses.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix index a2e2cc2..9c62dc5 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,9 +1,6 @@ -{ config, lib, pkgs, meta, ... }: +{ config, lib, pkgs, meta, ipAddrs, ... }: - -let - addresses = import (toString ./ip-addresses.nix); -in { +{ imports = [ ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; @@ -40,11 +37,22 @@ in { networking.interfaces.eth0.ipv4.addresses = [ { - address = addresses.${meta.hostname}; + address = ipAddrs.${meta.hostname}; prefixLength = 24; } ]; + networking.defaultGateway = "192.168.1.1"; + networking.nameservers = [ "1.1.1.1" "1.0.0.1" ]; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + networking.firewall = { + enable = true; + allowedTCPPorts = [ 22 80 443 ]; + }; + # Set your time zone. time.timeZone = "America/Chicago"; @@ -89,6 +97,13 @@ in { "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICNkZ5Xr75thR/tEgsASzYAtaA/kbsv2PKI8ux9rgpTe roydumblauskas@gmail.com" ]; }; + + users.users.root = { + hashedPassword = "$y$j9T$IjaP0KIfdpEvlLtOn.u0T/$0MJDaFEdSu6zSJ04CF1dtorD6IVgbN3vmDiiwGwwqr5"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICNkZ5Xr75thR/tEgsASzYAtaA/kbsv2PKI8ux9rgpTe roydumblauskas@gmail.com" + ]; + }; # List packages installed in system profile. To search, run: # $ nix search wget @@ -111,16 +126,6 @@ in { # Enable the OpenSSH daemon. services.openssh.enable = true; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - networking.firewall = { - enable = true; - allowedTCPPorts = [ 22 80 443 ]; - }; - # 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. diff --git a/nixos/flake.nix b/nixos/flake.nix index cdfdd3c..cb2e698 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -16,6 +16,10 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + quasiSecrets = { + url = "git+ssh://git@github.com/RoyDumblauskas/server-semi-secrets"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, nixvim, home-manager, disko, sops-nix }@inputs: @@ -37,6 +41,7 @@ ./disk-config.nix disko.nixosModules.disko sops-nix.nixosModules.sops + quasiSecrets.nixosModules.ipAddrs home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index 60e6ce9..4d9c12b 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "nvme" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; diff --git a/nixos/home.nix b/nixos/home.nix index 7ba0d13..616e068 100644 --- a/nixos/home.nix +++ b/nixos/home.nix @@ -8,6 +8,7 @@ home.packages = with pkgs; [ git tree + unixtools.ping ]; home.stateVersion = "24.11"; diff --git a/nixos/ip-addresses.nix b/nixos/ip-addresses.nix deleted file mode 100644 index e634e3d..0000000 --- a/nixos/ip-addresses.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - hostName = "000.000.0.000"; -}