mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
merged zfs.nix and erase-your-darlings.nix
This commit is contained in:
parent
3a1f1245e8
commit
e1d4cb64c2
2 changed files with 27 additions and 19 deletions
|
|
@ -1,18 +0,0 @@
|
||||||
{lib, ...}: {
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"d /mnt - - - - -"
|
|
||||||
"L+ /etc/ssh/ssh_host_ed25519_key - - - - /persist/ssh/ssh_host_ed25519_key"
|
|
||||||
"L+ /etc/ssh/ssh_host_ed25519_key.pub - - - - /persist/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"L+ /etc/nixos - - - - /persist/nixos"
|
|
||||||
];
|
|
||||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
|
||||||
zfs rollback -r rpool/root@empty
|
|
||||||
zfs rollback -r rpool/var@empty
|
|
||||||
'';
|
|
||||||
#make sure the sopskey is found
|
|
||||||
sops.age.sshKeyPaths = lib.mkForce ["/persist/ssh/ssh_host_ed25519_key"];
|
|
||||||
fileSystems."/persist".neededForBoot = true;
|
|
||||||
environment.etc = {
|
|
||||||
"machine-id".text = "b6431c2851094770b614a9cfa78fb6ea";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +1,41 @@
|
||||||
{config, ...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
#link some stuff
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"L+ /etc/ssh/ssh_host_ed25519_key - - - - /persist/ssh/ssh_host_ed25519_key"
|
||||||
|
"L+ /etc/ssh/ssh_host_ed25519_key.pub - - - - /persist/ssh/ssh_host_ed25519_key.pub"
|
||||||
|
"L+ /etc/nixos - - - - /persist/nixos"
|
||||||
|
];
|
||||||
|
#create machine-id for spotify
|
||||||
|
environment.etc = {
|
||||||
|
"machine-id".text = "b6431c2851094770b614a9cfa78fb6ea";
|
||||||
|
};
|
||||||
|
#make sure the sopskey is found
|
||||||
|
sops.age.sshKeyPaths = lib.mkForce ["/persist/ssh/ssh_host_ed25519_key"];
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
zfs = {
|
zfs = {
|
||||||
devNodes = "/dev/disk/by-id/";
|
devNodes = "/dev/disk/by-id/";
|
||||||
forceImportAll = true;
|
forceImportAll = true;
|
||||||
};
|
};
|
||||||
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
|
#disable hibernate and set cache max
|
||||||
kernelParams = ["nohibernate" "zfs.zfs_arc_max=17179869184"];
|
kernelParams = ["nohibernate" "zfs.zfs_arc_max=17179869184"];
|
||||||
supportedFilesystems = ["zfs" "vfat"];
|
supportedFilesystems = ["zfs" "vfat"];
|
||||||
initrd = {
|
initrd = {
|
||||||
|
#module for multiple swap devices
|
||||||
kernelModules = ["dm_mod"];
|
kernelModules = ["dm_mod"];
|
||||||
|
#keyboard module for zfs password
|
||||||
availableKernelModules = ["hid_generic"];
|
availableKernelModules = ["hid_generic"];
|
||||||
|
#wipe / and /var on boot
|
||||||
|
postDeviceCommands = lib.mkAfter ''
|
||||||
|
zfs rollback -r rpool/root@empty
|
||||||
|
zfs rollback -r rpool/var@empty
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
plymouth.enable = false;
|
plymouth.enable = false;
|
||||||
loader = {
|
loader = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue