Add hidden partition

This commit is contained in:
Bun 2025-05-14 12:07:20 +00:00
parent 161c11c23a
commit f75eec5484
6 changed files with 161 additions and 0 deletions

View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader.systemd-boot.enable = true;
plymouth.enable = true;
};
}

17
hosts/hidden/default.nix Normal file
View file

@ -0,0 +1,17 @@
{ ... }:
{
imports = [
./boot
./disko
./hardware
./user
../../modules/system
];
networking.hostName = "hidden";
system = {
desktop.enable = true;
stateVersion = "24.11";
};
}

View file

@ -0,0 +1,106 @@
{ config, disko, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [
"compress=zstd"
"noexec"
"ssd"
];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"ssd"
];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/persist/.snapshots" = { };
"/persist/home" = { };
"/persist/home/.snapshots" = { };
};
};
};
swap = {
size = "2G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -0,0 +1,22 @@
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [
"ahci"
"nvme"
"sd_mod"
"sr_mod"
"usbhid"
"xhci_pci"
];
kernelModules = [ "dm-snapshot" ];
};
kernelModules = [ "kvm-intel" ];
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,7 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}".home = {
guifull.enable = true;
stateVersion = lib.mkForce config.system.stateVersion;
};
}