From 7d63e71646adc89059ee3406a6f87ab8108e69fc Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Thu, 25 Jul 2024 11:50:37 +0100 Subject: [PATCH] Flake configs for zippy. --- common/cattle-node.nix | 15 ++++++++++++ flake.nix | 8 ++++++ hosts/zippy/default.nix | 11 +++++++++ hosts/zippy/hardware.nix | 53 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 common/cattle-node.nix create mode 100644 hosts/zippy/default.nix create mode 100644 hosts/zippy/hardware.nix diff --git a/common/cattle-node.nix b/common/cattle-node.nix new file mode 100644 index 0000000..f73097d --- /dev/null +++ b/common/cattle-node.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + imports = [ + ./cifs-client.nix + ./consul.nix + ./glusterfs.nix + ./glusterfs-client.nix + ./impermanence.nix + ./nomad.nix + ./sshd.nix + ./user-ppetru.nix + ./unattended-encryption.nix + ./systemd-boot.nix + ]; +} diff --git a/flake.nix b/flake.nix index db76e46..60783d8 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ c3 = mkNixos "x86_64-linux" [ ./hosts/c3 ]; nix-dev = mkNixos "x86_64-linux" [ ./hosts/nix-dev ]; alo-cloud-1 = mkNixos "aarch64-linux" [./hosts/alo-cloud-1 ]; + zippy = mkNixos "x86_64-linux" [ ./hosts/zippy ]; }; deploy = { @@ -73,6 +74,13 @@ path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.alo-cloud-1; }; }; + zippy = { + hostname = "zippy"; + profiles.system = { + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.zippy; + }; + }; }; }; diff --git a/hosts/zippy/default.nix b/hosts/zippy/default.nix new file mode 100644 index 0000000..c0a9a61 --- /dev/null +++ b/hosts/zippy/default.nix @@ -0,0 +1,11 @@ +{ pkgs, inputs, ... }: +{ + imports = [ + ../../common/global + ../../common/cattle-node.nix + ./hardware.nix + ]; + + networking.hostName = "zippy"; + services.tailscaleAutoconnect.authkey = "tskey-auth-ktKyQ59f2p11CNTRL-ut8E71dLWPXsVtb92hevNX9RTjmk4owBf"; +} diff --git a/hosts/zippy/hardware.nix b/hosts/zippy/hardware.nix new file mode 100644 index 0000000..86717fc --- /dev/null +++ b/hosts/zippy/hardware.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/e009eed5-90cd-4756-b56f-149d876ca934"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + boot.initrd.luks.devices."luksroot".device = "/dev/disk/by-uuid/3fb5eb41-34d3-4ef6-8f3e-5db5a788ceef"; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/e009eed5-90cd-4756-b56f-149d876ca934"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; + + fileSystems."/persist" = + { device = "/dev/disk/by-uuid/e009eed5-90cd-4756-b56f-149d876ca934"; + fsType = "btrfs"; + options = [ "subvol=persist" ]; + }; + + fileSystems."/var/log" = + { device = "/dev/disk/by-uuid/e009eed5-90cd-4756-b56f-149d876ca934"; + fsType = "btrfs"; + options = [ "subvol=log" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/F3C9-A38F"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ { + device = "/dev/disk/by-id/ata-KINGSTON_SKC600MS1024G_50026B7785AE0A92-part2"; + randomEncryption.enable = true; + }]; + + nixpkgs.hostPlatform = "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = true; +} +