summaryrefslogtreecommitdiff
path: root/hosts/thinkpad
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/thinkpad')
-rw-r--r--hosts/thinkpad/configuration.nix16
-rw-r--r--hosts/thinkpad/disko.nix150
2 files changed, 151 insertions, 15 deletions
diff --git a/hosts/thinkpad/configuration.nix b/hosts/thinkpad/configuration.nix
index a38d74b..d58858a 100644
--- a/hosts/thinkpad/configuration.nix
+++ b/hosts/thinkpad/configuration.nix
@@ -2,17 +2,20 @@
inputs,
username,
...
-}: {
+}:
+{
system.stateVersion = "25.05";
imports = [
+ inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480s
inputs.disko.nixosModules.disko
./disko.nix
- ./hardware-configuration.nix
../../os/default.nix
];
+ hardware.facter.reportPath = /etc/nixos/hosts/thinkpad/facter.json;
+
os = {
core = {
allowUnfree.enable = true;
@@ -20,15 +23,15 @@
audio.enable = true;
bootloader = {
type = "grub";
- enableEncryption = true;
- grubDevice = "/dev/nvme0n1";
- luksDevice = "/dev/nvme0n1p2";
+ efi = false;
+ timeout = 0;
+ luks.enable = true;
};
drivers = {
enable = true;
cpu = "intel";
graphics.enable = true;
- kernel = "hardened";
+ kernel = "stable";
};
fonts.enable = true;
greet.enable = true;
@@ -73,5 +76,4 @@
};
};
services.thinkfan.enable = true;
- boot.kernelModules = ["thinkpad_acpi"];
}
diff --git a/hosts/thinkpad/disko.nix b/hosts/thinkpad/disko.nix
index 97e5c87..31427d3 100644
--- a/hosts/thinkpad/disko.nix
+++ b/hosts/thinkpad/disko.nix
@@ -7,38 +7,56 @@
content = {
type = "gpt";
partitions = {
- biosboot = {
+ bootloader = {
size = "1M";
type = "EF02";
};
+ boot = {
+ size = "2G";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [ "umask=0077" ];
+ };
+ };
luks = {
size = "100%";
content = {
type = "luks";
- name = "crypted";
+ name = "crypted_main";
settings.allowDiscards = true;
content = {
type = "btrfs";
- extraArgs = ["-f"];
+ extraArgs = [ "-f" ];
subvolumes = {
"root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd:1"
+ "space_cache=v2"
+ "discard=async"
"noatime"
];
};
- "home" = {
- mountpoint = "/home";
+ "nix" = {
+ mountpoint = "/nix";
mountOptions = [
"compress=zstd:1"
+ "space_cache=v2"
+ "discard=async"
+ "nodev"
"noatime"
];
};
- "nix" = {
- mountpoint = "/nix";
+ "home" = {
+ mountpoint = "/home";
mountOptions = [
"compress=zstd:1"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
"noatime"
];
};
@@ -46,21 +64,43 @@
mountpoint = "/var/log";
mountOptions = [
"compress=zstd:1"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
+ "noatime"
+ ];
+ };
+ "games" = {
+ mountpoint = "/games";
+ mountOptions = [
+ "compress=none"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
"noatime"
];
};
"vms" = {
mountpoint = "/vms";
mountOptions = [
+ "compress=none"
+ "space_cache=v2"
+ "discard=async"
"nodatacow"
+ "nosuid"
+ "nodev"
"noatime"
];
};
"swap" = {
mountpoint = "/.swapvol";
mountOptions = [
+ "compress=none"
+ "space_cache=v2"
+ "discard=async"
"nodatacow"
- "compress=no"
"noatime"
];
};
@@ -71,6 +111,100 @@
};
};
};
+ storage = {
+ type = "disk";
+ device = "/dev/sda";
+ content = {
+ type = "gpt";
+ partitions = {
+ luks = {
+ size = "100%";
+ content = {
+ type = "luks";
+ name = "crypted_storage";
+ keyFile = "/tmp/storage.key";
+ settings.allowDiscards = true;
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" ];
+ subvolumes = {
+ "archive" = {
+ mountpoint = "/storage/archive";
+ mountOptions = [
+ "compress=zstd:1"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
+ "noatime"
+
+ "nofail"
+ "x-systemd.device-timeout=5s"
+ ];
+ };
+ "movies" = {
+ mountpoint = "/storage/movies";
+ mountOptions = [
+ "compress=none"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
+ "noatime"
+
+ "nofail"
+ "x-systemd.device-timeout=5s"
+ ];
+ };
+ "anime" = {
+ mountpoint = "/storage/anime";
+ mountOptions = [
+ "compress=none"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
+ "noatime"
+
+ "nofail"
+ "x-systemd.device-timeout=5s"
+ ];
+ };
+ "pictures" = {
+ mountpoint = "/storage/pics";
+ mountOptions = [
+ "compress=none"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
+ "noatime"
+
+ "nofail"
+ "x-systemd.device-timeout=5s"
+ ];
+ };
+ "videos" = {
+ mountpoint = "/storage/vids";
+ mountOptions = [
+ "compress=none"
+ "space_cache=v2"
+ "discard=async"
+ "nosuid"
+ "nodev"
+ "noatime"
+
+ "nofail"
+ "x-systemd.device-timeout=5s"
+ ];
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
};
};
}