mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-06-17 10:16:31 +05:30
feat(sirius): enable impermanence
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
tnix = {
|
tnix = {
|
||||||
boot.secure-boot.enable = true;
|
boot.secure-boot.enable = true;
|
||||||
|
boot.impermanence.enable = true;
|
||||||
networking.openssh.enable = true;
|
networking.openssh.enable = true;
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
|||||||
82
modules/hosts/sirius/disko.nix
Normal file
82
modules/hosts/sirius/disko.nix
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
flake.modules.nixos.sirius =
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
hasOptinPersistence = config.tnix.boot.impermanence.enable;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.disko.nixosModules.disko
|
||||||
|
];
|
||||||
|
|
||||||
|
disko.devices.disk.primary = {
|
||||||
|
device = "/dev/nvme1n1";
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "1G";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [
|
||||||
|
"defaults"
|
||||||
|
"umask=0077"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
swap = {
|
||||||
|
size = "70G";
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
discardPolicy = "both";
|
||||||
|
resumeDevice = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
size = "100%";
|
||||||
|
type = "8300";
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
# Base subvolumes that always exist
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountOptions = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
"space_cache=v2"
|
||||||
|
];
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountOptions = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
"noacl"
|
||||||
|
"space_cache=v2"
|
||||||
|
];
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# Conditionally merge /persist only when impermanence is enabled
|
||||||
|
// lib.optionalAttrs hasOptinPersistence {
|
||||||
|
"/persist" = {
|
||||||
|
mountOptions = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
"space_cache=v2"
|
||||||
|
];
|
||||||
|
mountpoint = "/persist";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user