diff --git a/flake.nix b/flake.nix index 8f32b09..5225660 100644 --- a/flake.nix +++ b/flake.nix @@ -102,6 +102,7 @@ enable = true; version = homeManagerVersion; }; + enableNetworkDrives = true; os = { enable = true; firewall = { enable = false; }; @@ -112,5 +113,27 @@ }; configuration = (import ./hosts/hl-bigbox1.nix { user = user; }); }; + + # NIXOS Homelab - minipc1 + # ------------- + nixosConfigurations."hl-minipc1" = lib.makeNixOsModule { + system = "x86_64-linux"; + user = user; + systemStateVersion = "23.11"; + hostName = "hl-minipc1"; + enableNetworkDrives = true; + home-manager = { + enable = true; + version = homeManagerVersion; + }; + os = { + enable = true; + firewall = { enable = false; }; + enableFonts = true; + enableNetworking = true; + enableSSH = true; + }; + configuration = (import ./hosts/hl-minipc1.nix { user = user; }); + }; }; } diff --git a/hosts/fwbook.hardware-configuration.nix b/hosts/fwbook.hardware-configuration.nix index 076f76a..e802118 100644 --- a/hosts/fwbook.hardware-configuration.nix +++ b/hosts/fwbook.hardware-configuration.nix @@ -45,11 +45,7 @@ [{ device = "/dev/disk/by-uuid/5175a4b0-0067-47c6-b7da-35acb247f134"; }]; networking.useDHCP = lib.mkDefault true; - # networking.interfaces.br-74ce7d3722b8.useDHCP = lib.mkDefault true; networking.interfaces.docker0.useDHCP = lib.mkDefault true; - # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; - # networking.interfaces.vethdb1ba40.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/hl-bigbox1.hardware-configuration.nix b/hosts/hl-bigbox1.hardware-configuration.nix index c27b85b..f887b97 100644 --- a/hosts/hl-bigbox1.hardware-configuration.nix +++ b/hosts/hl-bigbox1.hardware-configuration.nix @@ -4,40 +4,26 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/f2732ab2-ea52-4f61-b55a-6617d496bf39"; - fsType = "ext4"; - }; - fileSystems."/mnt/EightTerra/DownloadedTorrents" = { - device = "tnas1.lab.internal:/mnt/EightTerra/DownloadedTorrents"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f2732ab2-ea52-4f61-b55a-6617d496bf39"; + fsType = "ext4"; }; - - fileSystems."/mnt/EightTerra/k3s-cluster" = { - device = "tnas1.lab.internal:/mnt/EightTerra/k3s-cluster"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/9222-7B1D"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/9222-7B1D"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; swapDevices = [ ]; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/hl-minipc1.hardware-configuration.nix b/hosts/hl-minipc1.hardware-configuration.nix new file mode 100644 index 0000000..3132df9 --- /dev/null +++ b/hosts/hl-minipc1.hardware-configuration.nix @@ -0,0 +1,30 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = + [ "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/142c88f4-b1bc-4ed9-92ee-2c52cdfa4274"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/01FE-EDCC"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1.nix new file mode 100644 index 0000000..ab1618d --- /dev/null +++ b/hosts/hl-minipc1.nix @@ -0,0 +1,22 @@ +{ user }: +{ pkgs, lib, config, ... }: { + imports = [ ./hl-minipc1.hardware-configuration.nix ]; + # firmware updater + services.fwupd.enable = true; + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + # Data + fileSystems."/mnt/Data" = { + device = "/dev/sda1"; + fsType = "ext4"; + options = [ "nofail" ]; + }; + services.audiobookshelf = { + enable = true; + host = "0.0.0.0"; + openFirewall = true; + port = 8000; + dataDir = "audiobookshelf"; + }; +} diff --git a/modules/main.nix b/modules/main.nix index bbaf8a7..1c55f92 100644 --- a/modules/main.nix +++ b/modules/main.nix @@ -2,6 +2,7 @@ , systemStateVersion , hostName , system +, enableNetworkDrives ? false # Desktop Module , desktop ? { enable = false; @@ -47,6 +48,8 @@ homeManagerVersion = home-manager.version; hostName = hostName; }) + ] else [ ]) ++ (if enableNetworkDrives then [ + (import ./network-drives) ] else [ ]) ; } diff --git a/modules/network-drives.nix b/modules/network-drives.nix new file mode 100644 index 0000000..e110f02 --- /dev/null +++ b/modules/network-drives.nix @@ -0,0 +1,13 @@ +{ ... }: { + fileSystems."/mnt/EightTerra/DownloadedTorrents" = { + device = "tnas1.lab.internal:/mnt/EightTerra/DownloadedTorrents"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; + + fileSystems."/mnt/EightTerra/k3s-cluster" = { + device = "tnas1.lab.internal:/mnt/EightTerra/k3s-cluster"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; +}