nixos-config/config/hardware/legatus.nix

87 lines
2.0 KiB
Nix
Raw Normal View History

2021-11-05 07:06:08 -07:00
{ config, lib, pkgs, ... }:
with lib; {
boot = {
initrd = {
2022-08-22 11:30:18 -07:00
availableKernelModules = [ "ahci" "usbhid" ];
2021-11-05 07:06:08 -07:00
kernelModules = [ "dm-snapshot" ];
};
kernelModules = [ ];
extraModulePackages = [ ];
loader.grub = {
enable = true;
device = "/dev/sda";
};
supportedFilesystems = [ "btrfs" ];
};
2022-08-22 11:30:18 -07:00
system.stateVersion = "22.05";
2021-11-05 07:06:08 -07:00
fileSystems = {
"/" = {
device = "root-tmpfs";
fsType = "tmpfs";
2023-10-14 16:15:26 -07:00
options = [ "mode=755" "noexec" "size=20G" ];
2021-11-05 07:06:08 -07:00
};
"/boot" = {
2022-08-22 11:30:18 -07:00
device = "/dev/disk/by-label/legatus-boot";
2021-11-05 07:06:08 -07:00
fsType = "ext4";
options = [ "noexec" "noatime" "nodiratime" ];
};
"/nix" = {
2022-08-22 11:30:18 -07:00
device = "/dev/disk/by-label/legatus-data";
2021-11-05 07:06:08 -07:00
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd" "noatime" "nodiratime" ];
};
"/var/log" = {
2022-08-22 11:30:18 -07:00
device = "/dev/disk/by-label/legatus-data";
2021-11-05 07:06:08 -07:00
fsType = "btrfs";
2022-08-22 11:30:18 -07:00
options =
[ "subvol=@log" "compress=zstd" "noatime" "nodiratime" "noexec" ];
2021-11-05 07:06:08 -07:00
neededForBoot = true;
};
"/state" = {
2022-08-22 11:30:18 -07:00
device = "/dev/disk/by-label/legatus-data";
2021-11-05 07:06:08 -07:00
fsType = "btrfs";
2022-08-22 11:30:18 -07:00
options =
[ "subvol=@state" "compress=zstd" "noatime" "nodiratime" "noexec" ];
2021-11-05 07:06:08 -07:00
};
2022-03-16 09:49:35 -07:00
2023-10-14 16:15:26 -07:00
"/var/lib/containers/storage" = {
device = "/dev/disk/by-label/legatus-data";
fsType = "btrfs";
options = [ "subvol=@container-data" "noatime" "compress=zstd" "noexec" ];
};
2024-05-21 23:16:02 -07:00
"/var/lib/tailscale" = {
device = "/dev/disk/by-label/legatus-data";
fsType = "btrfs";
options = [ "subvol=@tailscale" "noatime" "compress=zstd" "noexec" ];
};
2021-11-05 07:06:08 -07:00
};
2022-08-22 11:30:18 -07:00
swapDevices = [{ device = "/dev/disk/by-label/legatus-swap"; }];
2021-11-05 07:06:08 -07:00
networking = {
macvlans = {
extif0 = {
2022-08-22 11:30:18 -07:00
interface = "eno1";
2021-11-05 07:06:08 -07:00
mode = "bridge";
};
};
useDHCP = false;
interfaces = {
extif0 = {
2022-08-22 11:30:18 -07:00
macAddress = pkgs.lib.network.generate-mac-address "legatus" "extif0";
2021-11-05 07:06:08 -07:00
};
};
};
}