nixos/modules/boot/chn-PC.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

2023-06-24 23:00:02 +08:00
inputs:
2023-06-05 21:53:13 +08:00
{
config =
{
2023-06-25 00:31:46 +08:00
# modules auto loaded in stage2
boot.kernelModules = [ "kvm-intel" "br_netfilter" ];
# modules install but not auto loaded
# boot.extraModulePackages = [ yourmodulename ];
2023-07-22 12:30:37 +08:00
boot.extraModprobeConfig = "options kvm_intel nested=1";
2023-06-25 00:31:46 +08:00
# initrd, luks
2023-07-22 14:16:01 +08:00
boot.initrd.systemd.services."systemd-cryptsetup@swap" =
2023-06-25 00:31:46 +08:00
{
2023-07-22 14:16:01 +08:00
before = [ "systemd-cryptsetup@root.service" ];
overrideStrategy = "asDropin";
2023-06-24 23:25:35 +08:00
};
2023-06-25 00:31:46 +08:00
# impermanence
2023-07-02 14:53:37 +08:00
environment.persistence."/nix/persistent" =
2023-06-24 23:25:35 +08:00
{
hideMounts = true;
directories =
[
2023-06-27 20:50:26 +08:00
"/etc/NetworkManager/system-connections"
2023-06-24 23:25:35 +08:00
"/home"
"/root"
"/var"
];
2023-06-27 20:50:26 +08:00
files =
[
"/etc/machine-id"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_rsa_key.pub"
"/etc/ssh/ssh_host_rsa_key"
];
2023-06-24 23:25:35 +08:00
};
2023-06-25 00:31:46 +08:00
# services
2023-06-24 23:25:35 +08:00
services =
{
2023-07-02 14:53:37 +08:00
snapper.configs.persistent =
2023-06-24 23:25:35 +08:00
{
2023-07-02 14:53:37 +08:00
SUBVOLUME = "/nix/persistent";
2023-06-24 23:25:35 +08:00
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_MIN_AGE = 1800;
TIMELINE_LIMIT_HOURLY = "10";
TIMELINE_LIMIT_DAILY = "7";
TIMELINE_LIMIT_WEEKLY = "1";
TIMELINE_LIMIT_MONTHLY = "0";
TIMELINE_LIMIT_YEARLY = "0";
};
2023-06-05 21:53:13 +08:00
};
};
}