From 3fa6f2dd4dee440dd6e64a9adfc09990a3e02720 Mon Sep 17 00:00:00 2001 From: Lyes Saadi Date: Sun, 12 Oct 2025 01:12:39 +0200 Subject: [PATCH] Launching Zora --- hosts/zora/default.nix | 11 ++----- hosts/zora/hardware-configuration.nix | 40 ++++++++++++++++++++++--- hosts/zora/hardware.nix | 7 ++--- hosts/zora/networking.nix | 43 +++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 hosts/zora/networking.nix diff --git a/hosts/zora/default.nix b/hosts/zora/default.nix index 565f909..b2e032c 100644 --- a/hosts/zora/default.nix +++ b/hosts/zora/default.nix @@ -6,22 +6,17 @@ # Hosts ./hardware-configuration.nix ./hardware.nix - ./disko-config.nix + ./networking.nix + # ./disko-config.nix ../../users/lyes ../../modules - disko.nixosModules.disko + # disko.nixosModules.disko agenix.nixosModules.default ]; - # Networking - networking = { - hostName = "lyes-pc"; - # hostId = "ed183b8f"; - }; - # 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 diff --git a/hosts/zora/hardware-configuration.nix b/hosts/zora/hardware-configuration.nix index 706a299..20dc638 100644 --- a/hosts/zora/hardware-configuration.nix +++ b/hosts/zora/hardware-configuration.nix @@ -8,18 +8,50 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ]; + boot.initrd.availableKernelModules = [ "ahci" "ehci_pci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + fileSystems."/" = + { device = "/dev/disk/by-uuid/05969535-264a-4ab0-b98a-b54da621ffaf"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/3307-11CD"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/acfd9160-01b6-489c-8cc4-13976db3cd62"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/var" = + { device = "/dev/disk/by-uuid/acfd9160-01b6-489c-8cc4-13976db3cd62"; + fsType = "btrfs"; + options = [ "subvol=var" ]; + }; + + fileSystems."/root" = + { device = "/dev/disk/by-uuid/acfd9160-01b6-489c-8cc4-13976db3cd62"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + swapDevices = [ ]; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.ens2f0.useDHCP = lib.mkDefault true; + # networking.interfaces.ens2f1.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/zora/hardware.nix b/hosts/zora/hardware.nix index cff96b4..06205e9 100644 --- a/hosts/zora/hardware.nix +++ b/hosts/zora/hardware.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: +{ ... }: { # Kernel - boot.kernelPackages = pkgs.linuxPackages_6_16; + # boot.kernelPackages = pkgs.linuxPackages_6_12; # Boot boot.loader.systemd-boot.enable = true; @@ -13,7 +13,4 @@ enable = true; # network.enable = true; }; - - # Swap - zramSwap.enable = true; } diff --git a/hosts/zora/networking.nix b/hosts/zora/networking.nix new file mode 100644 index 0000000..a55b60b --- /dev/null +++ b/hosts/zora/networking.nix @@ -0,0 +1,43 @@ +{ }: + +{ + # Networking + networking = { + hostName = "zora"; + domain = "lyes.eu"; + enableIPv6 = false; + hostId = "233c35ca"; + + firewall = { + enable = true; + + allowedTCPPorts = [ + 22 + 80 + 443 + ]; + allowedUDPPorts = [ + 80 + 443 + ]; + }; + + interfaces = { + ens2f0 = { + addresses = [ + { + address = "185.230.78.13"; + prefixLength = 24; + } + ]; + routes = [ + { + address = "0.0.0.0"; + prefixLength = 0; + via = "185.230.78.99"; + } + ]; + }; + }; + }; +}