update flake lock, update btrfs wipe GLaDOS, replace SDDM with plasma launch on EDI and GLaDOS
This commit is contained in:
parent
c6d25885c1
commit
68a7950b5e
3 changed files with 61 additions and 32 deletions
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -389,11 +389,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771519029,
|
"lastModified": 1771531206,
|
||||||
"narHash": "sha256-H59Qf82wv5kBXVoyXsmUKW+9J3o8FqgY4uKaLdsLdLg=",
|
"narHash": "sha256-1R3Wx6KUkMb4x4E5UOhW9p6rqiexzSGGWxZqSHqW5n0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "167e0b6837115e672ec5f58e2b0ea39093abe807",
|
"rev": "91be7cce763fa4022c7cf025a71b0c366d1b6e77",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -555,11 +555,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-edge": {
|
"nixpkgs-edge": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771529647,
|
"lastModified": 1771539422,
|
||||||
"narHash": "sha256-jg/CvWdnL3ZZhx58j8g1WDXJHALqiutiwnSyP4zPLj8=",
|
"narHash": "sha256-TerWaqclKBZY7mWBEgA+7uwjSmpuWQ4QaOH7MTUkFkI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "64a253ac18f1496577a30251a06c3871bdcaaa99",
|
"rev": "c4c6a8dea4a441e4cb2bdb5bc4266a6a9cce3859",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -906,11 +906,11 @@
|
||||||
"tinted-zed": "tinted-zed"
|
"tinted-zed": "tinted-zed"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771428844,
|
"lastModified": 1771536203,
|
||||||
"narHash": "sha256-rTzo6bZEsdT7yHUZ0B4BYe32XQZzm8SiWKvWLJnxerE=",
|
"narHash": "sha256-ffSQmf7RZqCShzUkK4VlROGsBZy9tgKBYRQ5XQD0PiM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "stylix",
|
"repo": "stylix",
|
||||||
"rev": "801843d10e9e22d7a00f660d069e2de70aa2980a",
|
"rev": "ec4d1ce9da22da964cef8a77795dc32011ebbb55",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,8 @@
|
||||||
|
|
||||||
virtualisation.spiceUSBRedirection.enable = true;
|
virtualisation.spiceUSBRedirection.enable = true;
|
||||||
|
|
||||||
services.displayManager.sddm = {
|
services.displayManager.plasma-login-manager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wayland.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.displayManager.defaultSession = "plasma";
|
services.displayManager.defaultSession = "plasma";
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,8 @@
|
||||||
gparted
|
gparted
|
||||||
];
|
];
|
||||||
|
|
||||||
services.displayManager.sddm = {
|
services.displayManager.plasma-login-manager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wayland.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.displayManager.defaultSession = "plasma";
|
services.displayManager.defaultSession = "plasma";
|
||||||
|
|
@ -76,14 +75,36 @@
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
boot = {
|
boot = {
|
||||||
# Nuke root AND home subvolumes on every boot
|
initrd.systemd.services.rollback = {
|
||||||
initrd.systemd.services.wipe-my-fs = {
|
description = "Rollback BTRFS root subvolume to a pristine state";
|
||||||
requires = ["dev-mapper-nvme_crypted.device"];
|
unitConfig.DefaultDependencies = "no";
|
||||||
after = ["dev-mapper-nvme_crypted.device"];
|
serviceConfig.Type = "oneshot";
|
||||||
wantedBy = ["initrd.target"];
|
wantedBy = ["initrd.target"];
|
||||||
|
after = ["systemd-cryptsetup@nvme_crypted.service"];
|
||||||
|
before = ["sysroot.mount"];
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
|
echo "mounting btrfs volume to tmp..."
|
||||||
mkdir -p /btrfs_tmp
|
mkdir -p /btrfs_tmp
|
||||||
mount /dev/mapper/cryptroot /btrfs_tmp
|
mount /dev/mapper/nvme_crypted /btrfs_tmp
|
||||||
|
echo "mount successful!"
|
||||||
|
|
||||||
|
if [[ -e /btrfs_tmp/root ]]; then
|
||||||
|
echo "copying root to backup..."
|
||||||
|
mkdir -p /btrfs_tmp/old_roots
|
||||||
|
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||||
|
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||||
|
echo "copy complete!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -e /btrfs_tmp/home ]]; then
|
||||||
|
echo "copying home to backup..."
|
||||||
|
mkdir -p /btrfs_tmp/old_homes
|
||||||
|
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/home)" "+%Y-%m-%-d_%H:%M:%S")
|
||||||
|
mv /btrfs_tmp/home "/btrfs_tmp/old_homes/$timestamp"
|
||||||
|
"copy complete!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
delete_subvolume_recursively() {
|
delete_subvolume_recursively() {
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|
@ -93,15 +114,24 @@
|
||||||
btrfs subvolume delete "$1"
|
btrfs subvolume delete "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Nuke and recreate root
|
echo "recursively deleting root subvolumes older than five days..."
|
||||||
delete_subvolume_recursively /btrfs_tmp/root
|
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +5); do
|
||||||
|
delete_subvolume_recursively "$i"
|
||||||
|
done
|
||||||
|
echo "subvolumes deleted!"
|
||||||
|
|
||||||
|
echo "recursively deleting home subvolumes older than five days..."
|
||||||
|
for i in $(find /btrfs_tmp/old_homes/ -maxdepth 1 -mtime +5); do
|
||||||
|
delete_subvolume_recursively "$i"
|
||||||
|
done
|
||||||
|
echo "subvolumes deleted!"
|
||||||
|
|
||||||
|
echo "creating new root and home subvolumes..."
|
||||||
btrfs subvolume create /btrfs_tmp/root
|
btrfs subvolume create /btrfs_tmp/root
|
||||||
|
|
||||||
# Nuke and recreate home (wipes /home — but we restore via impermanence)
|
|
||||||
delete_subvolume_recursively /btrfs_tmp/home
|
|
||||||
btrfs subvolume create /btrfs_tmp/home
|
btrfs subvolume create /btrfs_tmp/home
|
||||||
|
echo "unmounting btrfs temporary mount..."
|
||||||
umount /btrfs_tmp
|
umount /btrfs_tmp
|
||||||
|
echo "disk clear complete!"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue