From e2014034bbf9b266283902f97fbcc6a6d66e3c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikodem=20Rabuli=C5=84ski?= Date: Tue, 17 Dec 2024 22:18:04 +0100 Subject: [PATCH] hosts/youko: init --- hosts/default.nix | 1 + hosts/youko/default.nix | 26 ++++++++++++++++++ hosts/youko/disks.nix | 58 ++++++++++++++++++++++++++++++++++++++++ hosts/youko/hardware.nix | 19 +++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 hosts/youko/default.nix create mode 100644 hosts/youko/disks.nix create mode 100644 hosts/youko/hardware.nix diff --git a/hosts/default.nix b/hosts/default.nix index a245e1c..03d464d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -14,6 +14,7 @@ # ./installer ./ude ./kogata + ./youko ]; builders = diff --git a/hosts/youko/default.nix b/hosts/youko/default.nix new file mode 100644 index 0000000..d708d8a --- /dev/null +++ b/hosts/youko/default.nix @@ -0,0 +1,26 @@ +{ + configurations.nixos.youko = { + imports = [ + ./disks.nix + ./hardware.nix + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + }; + + networking.networkmanager.enable = true; + + settei.user.config = + { lib, ... }: + { + programs.git.signing = lib.mkForce { + key = null; + signByDefault = false; + }; + }; + }; +} diff --git a/hosts/youko/disks.nix b/hosts/youko/disks.nix new file mode 100644 index 0000000..3156235 --- /dev/null +++ b/hosts/youko/disks.nix @@ -0,0 +1,58 @@ +{ + disko.devices.disk.main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + esp = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + settings.allowDiscards = true; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = + let + mountOptions = [ + "noatime" + "compress=zstd" + ]; + in + { + "/root" = { + inherit mountOptions; + mountpoint = "/"; + }; + "/home" = { + inherit mountOptions; + mountpoint = "/home"; + }; + "/nix" = { + inherit mountOptions; + mountpoint = "/nix"; + }; + "/swap" = { + mountpoint = "/.swapvol"; + swap.swapfile.size = "16G"; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/youko/hardware.nix b/hosts/youko/hardware.nix new file mode 100644 index 0000000..2160bd9 --- /dev/null +++ b/hosts/youko/hardware.nix @@ -0,0 +1,19 @@ +{ + boot = { + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + kernelModules = [ + "kvm-amd" + "i2c-dev" + ]; + }; + + services.smartd.enable = true; + hardware.cpu.amd.updateMicrocode = true; +}