Add murk and impermanence

This commit is contained in:
muon 2025-07-31 00:34:46 +00:00
parent a8668c1a44
commit b4f998d455
17 changed files with 354 additions and 6 deletions

View file

@ -0,0 +1,50 @@
{ pkgs, lib, config, osConfig, ... }:
let
fs-diff = with pkgs;
writeShellApplication {
name = "fs-diff";
runtimeInputs = [ flameshot curl xsel ];
text = ''
#!/usr/bin/env bash
# fs-diff.sh
set -euo pipefail
OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999)
OLD_TRANSID=${OLD_TRANSID}
sudo mkdir /mnt
sudo mount -o subvol=/ /dev/mapper/crypted /mnt
sudo btrfs subvolume find-new "/mnt/root" "$OLD_TRANSID" |
sed \'$d\' |
cut -f17- -d' ' |
sort |
uniq |
while read path; do
path="/$path"
if [ -L "$path" ]; then
: # The path is a symbolic link, so is probably handled by NixOS already
elif [ -d "$path" ]; then
: # The path is a directory, ignore
else
echo "$path"
fi
done
sudo umount /mnt
'';
};
in with lib; {
config = mkIf osConfig.mods.impermanence.enable {
home.packages = [ fs-diff ];
home.persistence."/persistent/home/muon" = {
directories = [
"documents"
"downloads"
"src"
".gnupg"
".ssh"
".config/sops"
".local/share/direnv"
];
};
};
}