diff --git a/flake.nix b/flake.nix index cee430f..8bb0af2 100644 --- a/flake.nix +++ b/flake.nix @@ -7,13 +7,15 @@ impermanence.url = "github:nix-community/impermanence"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; ppetru-home = { url = "git+file:../ppetru-home"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, deploy-rs, ppetru-home, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-unstable, deploy-rs, disko, ppetru-home, ... }@inputs: let inherit (self); @@ -28,6 +30,7 @@ nixpkgs.overlays = [ overlay-unstable ]; nixpkgs.config.allowUnfree = true; }) + disko.nixosModules.disko ] ++ modules; specialArgs = { inherit inputs self; }; }; @@ -39,6 +42,7 @@ 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 ]; + chilly = mkNixos "x86_64-linux" [ ./hosts/chilly ]; }; deploy = { diff --git a/hosts/chilly/default.nix b/hosts/chilly/default.nix new file mode 100644 index 0000000..82bbb18 --- /dev/null +++ b/hosts/chilly/default.nix @@ -0,0 +1,12 @@ +{ pkgs, inputs, ... }: +{ + imports = [ + ../../common/global + ../../common/compute-node.nix + ./disk-config.nix + ./hardware.nix + ]; + + networking.hostName = "chilly"; + services.tailscaleAutoconnect.authkey = "tskey-auth-kRXS9oPyPm11CNTRL-BE6YnbP9J6ZZuV9dHkX17ZMnm1JGdu93"; +} diff --git a/hosts/chilly/disk-config.nix b/hosts/chilly/disk-config.nix new file mode 100644 index 0000000..90df489 --- /dev/null +++ b/hosts/chilly/disk-config.nix @@ -0,0 +1,76 @@ +{ lib, ... }: +{ + disko.devices = { + disk.main = { + device = "/dev/disk/by-id/ata-FORESEE_512GB_SSD_MP15B03900928"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + esp = { + name = "ESP"; + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + luksroot = { + end = "-8G"; + content = { + type = "luks"; + name = "luksroot"; + settings = { + allowDiscards = true; + keyFile = "/dev/disk/by-id/usb-Intenso_Micro_Line_22080777660586-0:0"; + keyFileSize = 4096; + }; + content = { + type = "btrfs"; + subvolumes = { + "root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "persist" = { + mountpoint = "/persist"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "log" = { + mountpoint = "/var/log"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + }; + }; + }; + }; + swap = { + size = "8G"; + content = { + type = "swap"; + randomEncryption = true; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/chilly/hardware.nix b/hosts/chilly/hardware.nix new file mode 100644 index 0000000..3c629c1 --- /dev/null +++ b/hosts/chilly/hardware.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = true; +} + diff --git a/hosts/chilly/key.bin b/hosts/chilly/key.bin new file mode 100644 index 0000000..e7ebdcf Binary files /dev/null and b/hosts/chilly/key.bin differ