From d9a41add9f6892e2016746775d8d7a820c756ebb Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Fri, 12 Jul 2024 14:37:28 -0400 Subject: [PATCH] added bixbox1 --- flake.nix | 27 +++++++++++-- hosts/hl-bigbox1.hardware-configuration.nix | 42 +++++++++++++++++++++ hosts/hl-bigbox1.nix | 29 ++++++++++++++ 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 hosts/hl-bigbox1.hardware-configuration.nix create mode 100644 hosts/hl-bigbox1.nix diff --git a/flake.nix b/flake.nix index ae814f4..52050d3 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,7 @@ formatter = eachSystem (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt); - # NIXOS Setups + # NIXOS Framework Setups # ------------- nixosConfigurations."fwbook" = lib.makeNixOsModule { system = "x86_64-linux"; @@ -87,10 +87,31 @@ enable = true; version = homeMangerVersion; }; - desktop = { enable = false; }; - os = { enable = false; }; configuration = (import ./hosts/asosnovsky-mac.nix { user = sumoUser; }); }; + + # NIXOS Homelab - BIGBOX1 + # ------------- + nixosConfigurations."hl-bigbox1" = lib.makeNixOsModule { + system = "x86_64-linux"; + user = user; + systemStateVersion = "24.05"; + hostName = "hl-bigbox1"; + home-manager = { + enable = true; + version = homeMangerVersion; + }; + os = { + enable = true; + firewall = { enable = false; }; + enableFonts = true; + enableNetowrking = true; + enableSSH = true; + hardware = { enable = true; }; + }; + configuration = + (import ./hosts/hl-bigbox1.nix { user = user; }); + }; }; } diff --git a/hosts/hl-bigbox1.hardware-configuration.nix b/hosts/hl-bigbox1.hardware-configuration.nix new file mode 100644 index 0000000..b1f05ea --- /dev/null +++ b/hosts/hl-bigbox1.hardware-configuration.nix @@ -0,0 +1,42 @@ +# 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, pkgs, modulesPath, ... }: + +{ + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + 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."/boot" = + { + device = "/dev/disk/by-uuid/9222-7B1D"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + 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.enp2s0f0u4c2.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.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.nix b/hosts/hl-bigbox1.nix new file mode 100644 index 0000000..25a223e --- /dev/null +++ b/hosts/hl-bigbox1.nix @@ -0,0 +1,29 @@ +{ user }: +{ pkgs, lib, ... }: +{ + imports = [ ./hl-bigbox1.hardware-configuration.nix ]; + # firmware updater + services.fwupd.enable = true; + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.tmp.useTmpfs = true; + boot.kernelPackages = pkgs.linuxPackages_latest; + # environment.systemPackages = with pkgs; [ + + # ]; + # Ollama + services.ollama = { + enable = true; + acceleration = "cuda"; + listenAddress = "0.0.0.0:11434"; + }; + # Docker + virtualisation.docker.enableNvidia = true; + # Kernel + # boot.initrd.kernelModules = [ "amdgpu" "evdi" ]; + # hardware.opengl.extraPackages = with pkgs; [ rocmPackages.clr.icd amdvlk ]; + # home-manager.users.${user.name}.programs.zsh.initExtra = '' + # tmux attach || tmux + # ''; +}