From 0283dea2e60770c86636bc3a5ed49ecb7ad80b92 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sat, 21 Dec 2024 19:17:11 -0800 Subject: [PATCH] feat!: init tanzanite host! --- flake.nix | 18 +++++++++ hosts/tanzanite/default.nix | 76 +++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 hosts/tanzanite/default.nix diff --git a/flake.nix b/flake.nix index 310483f..be3e0c6 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,24 @@ } ]; }; + tanzanite = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + + ./packages/default.nix + ./hosts/tanzanite/default.nix + ./users/nyadmin/default.nix + + home-manager.nixosModules.home-manager + { + home-manager.extraSpecialArgs = {inherit inputs;}; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.nyadmin = import ./users/nyadmin/home.nix; + } + ]; + }; }; }; diff --git a/hosts/tanzanite/default.nix b/hosts/tanzanite/default.nix new file mode 100644 index 0000000..7fca921 --- /dev/null +++ b/hosts/tanzanite/default.nix @@ -0,0 +1,76 @@ +{ config, lib, pkgs, modulesPath, ... }: +let + +in { + imports = [ ../default.nix ]; + + stitchyconf = { + form = "server"; + }; + + networking.hostName = "tanzanite"; + time.timeZone = "America/Los_Angeles"; + networking.firewall = { + allowedTCPPorts = [ 22 80 222 443 ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + }; + + }; + # Non-Redundant Storage + fileSystems."/" = + { device = "/dev/disk/by-uuid/ac31f656-1882-415e-bbb7-b4d24c0af01c"; + fsType = "btrfs"; + options = [ "subvol=@nix-root" "compress=zstd"]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/ac31f656-1882-415e-bbb7-b4d24c0af01c"; + fsType = "btrfs"; + options = [ "subvol=@nix-home" "compress=zstd"]; + }; + + fileSystems."/nix/store" = + { device = "/dev/disk/by-uuid/ac31f656-1882-415e-bbb7-b4d24c0af01c"; + fsType = "btrfs"; + options = [ "subvol=@nix" "noatime" "compress=zstd"]; + }; + + fileSystems."/persist" = + { device = "/dev/disk/by-uuid/ac31f656-1882-415e-bbb7-b4d24c0af01c"; + fsType = "btrfs"; + options = [ "subvol=@persist" "compress=zstd"]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/262D-F161"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/5c007a16-9f0f-42d0-8761-63bea3120f6d"; } + ]; + + # Static Networking + systemd.network.enable = true; + networking.useNetworkd = true; + systemd.network.networks."10-lan" = { + matchConfig.Name = "enp0s31f6"; + address = [ + "192.168.51.3/24" + ]; + routes = [ + { Gateway = "192.168.51.1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + system.stateVersion = "24.11"; +}