Compare commits

..

No commits in common. "97fddca4a4cb9fea4925d9a9b32bb8522d3fa6a1" and "0db9f248fbb8f38dd7ffe72f52d7f01d24596d79" have entirely different histories.

18 changed files with 150 additions and 373 deletions

View file

@ -1,41 +0,0 @@
# Installation
```sh
git clone https://codeberg.org/muon/home && cd home
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount hosts/$(hostname)/disk-config.nix
sudo btrfs subvolume snapshot -r /mnt /mnt/root-blank
sudo nixos-generate-config --root /mnt
cp /mnt/etc/nixos/hardware-configuration.nix hosts/$(hostname)/hardware-configuration.nix
sudo nixos-install --root /mnt --no-root-passwd --flake .#$(hostname)
```
# Impermanence
## Erasure
```nix
boot.initrd.postResumeCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount /dev/mapper/crypted /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
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"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
```

194
flake.lock generated
View file

@ -37,11 +37,11 @@
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1752979451,
"narHash": "sha256-0CQM+FkYy0fOO/sMGhOoNL80ftsAzYCg9VhIrodqusM=",
"lastModified": 1748408240,
"narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "27cf1e66e50abc622fb76a3019012dc07c678fac",
"rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e",
"type": "github"
},
"original": {
@ -114,6 +114,21 @@
"type": "github"
}
},
"flake-compat_3": {
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -122,11 +137,11 @@
]
},
"locked": {
"lastModified": 1751413152,
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
@ -169,6 +184,54 @@
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"stylix",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1747372754,
"narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"stylix",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gnome-shell": {
"flake": false,
"locked": {
@ -193,11 +256,11 @@
]
},
"locked": {
"lastModified": 1753595562,
"narHash": "sha256-Ci88mAdtiP5RQkYmVhRUq69iYPMM7/lS9/mw+FnC7DE=",
"lastModified": 1751580393,
"narHash": "sha256-oRipTA4/JGeDGI31GNNVGFx0uhuR7h/R9SvkR4K8Axc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "710771af3d1c8c3f86a9e5d562616973ed5f3f21",
"rev": "402333d5ec2f9eed0f2584555936361f39d2f93e",
"type": "github"
},
"original": {
@ -206,18 +269,24 @@
"type": "github"
}
},
"impermanence": {
"home-manager_2": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1737831083,
"narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
"lastModified": 1751146119,
"narHash": "sha256-gvjG95TCnUVJkvQvLMlnC4NqiqFyBdJk3o8/RwuHeaU=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
"repo": "home-manager",
"rev": "76d0c31fce2aa0c71409de953e2f9113acd5b656",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"repo": "home-manager",
"type": "github"
}
},
@ -228,11 +297,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1752566074,
"narHash": "sha256-hWPv6S5lFn6qOQdSL5Ad/m0mge2ALTC8WEAR7c6YWcE=",
"lastModified": 1749976779,
"narHash": "sha256-Mjb4qsu+Fma1cXe1lGo0GqisvsiUeW0LfacziI7C7oM=",
"owner": "thiagokokada",
"repo": "nix-alien",
"rev": "ccf263b7ac5f44f89fd990594b09aa52de3d6585",
"rev": "f8716e36f8864e2f50663fde364ddd8dce5d937f",
"type": "github"
},
"original": {
@ -249,11 +318,11 @@
]
},
"locked": {
"lastModified": 1752441837,
"narHash": "sha256-FMH1OSSJp8Cx8MZHXz6KckxJGbCnVMotZNAH3v2WneU=",
"lastModified": 1749960154,
"narHash": "sha256-EWlr9MZDd+GoGtZB4QsDzaLyaDQPGnRY03MFp6u2wSg=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "839e02dece5845be3a322e507a79712b73a96ba2",
"rev": "424a40050cdc5f494ec45e46462d288f08c64475",
"type": "github"
},
"original": {
@ -284,11 +353,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1751984180,
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
"lastModified": 1749794982,
"narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
"rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81",
"type": "github"
},
"original": {
@ -316,11 +385,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1753429684,
"narHash": "sha256-9h7+4/53cSfQ/uA3pSvCaBepmZaz/dLlLVJnbQ+SJjk=",
"lastModified": 1751271578,
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7fd36ee82c0275fb545775cc5e4d30542899511d",
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
"type": "github"
},
"original": {
@ -332,11 +401,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1751792365,
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
"lastModified": 1748460289,
"narHash": "sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
"rev": "96ec055edbe5ee227f28cdbc3f1ddf1df5965102",
"type": "github"
},
"original": {
@ -355,14 +424,15 @@
"nixpkgs": [
"stylix",
"nixpkgs"
]
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1751906969,
"narHash": "sha256-BSQAOdPnzdpOuCdAGSJmefSDlqmStFNScEnrWzSqKPw=",
"lastModified": 1748730660,
"narHash": "sha256-5LKmRYKdPuhm8j5GFe3AfrJL8dd8o57BQ34AGjJl1R0=",
"owner": "nix-community",
"repo": "NUR",
"rev": "ddb679f4131e819efe3bbc6457ba19d7ad116f25",
"rev": "2c0bc52fe14681e9ef60e3553888c4f086e46ecb",
"type": "github"
},
"original": {
@ -374,7 +444,6 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"impermanence": "impermanence",
"nix-alien": "nix-alien",
"nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_3",
@ -390,11 +459,11 @@
]
},
"locked": {
"lastModified": 1752544651,
"narHash": "sha256-GllP7cmQu7zLZTs9z0J2gIL42IZHa9CBEXwBY9szT0U=",
"lastModified": 1750119275,
"narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "2c8def626f54708a9c38a5861866660395bb3461",
"rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2",
"type": "github"
},
"original": {
@ -431,8 +500,11 @@
"base16-helix": "base16-helix",
"base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_3",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_4",
"nur": "nur",
"systems": "systems_2",
@ -443,11 +515,11 @@
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1753553562,
"narHash": "sha256-CpTwdsrPU3UFy95Btg56RcVMgNpnw3C0DYTznE5aRq4=",
"lastModified": 1751570224,
"narHash": "sha256-ZZ6BH0g6Th9OttOdHw7cDaTbbaGdrSoYJBswt5gfUiU=",
"owner": "danth",
"repo": "stylix",
"rev": "af85565aba0f4749cb18b118a7333a0745920950",
"rev": "9b4ecf4aca38f329fc53d35bef32479c30ea74d6",
"type": "github"
},
"original": {
@ -522,11 +594,11 @@
"tinted-schemes": {
"flake": false,
"locked": {
"lastModified": 1750770351,
"narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=",
"lastModified": 1748180480,
"narHash": "sha256-7n0XiZiEHl2zRhDwZd/g+p38xwEoWtT0/aESwTMXWG4=",
"owner": "tinted-theming",
"repo": "schemes",
"rev": "5a775c6ffd6e6125947b393872cde95867d85a2a",
"rev": "87d652edd26f5c0c99deda5ae13dfb8ece2ffe31",
"type": "github"
},
"original": {
@ -538,11 +610,11 @@
"tinted-tmux": {
"flake": false,
"locked": {
"lastModified": 1751159871,
"narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=",
"lastModified": 1748740859,
"narHash": "sha256-OEM12bg7F4N5WjZOcV7FHJbqRI6jtCqL6u8FtPrlZz4=",
"owner": "tinted-theming",
"repo": "tinted-tmux",
"rev": "bded5e24407cec9d01bd47a317d15b9223a1546c",
"rev": "57d5f9683ff9a3b590643beeaf0364da819aedda",
"type": "github"
},
"original": {
@ -554,11 +626,11 @@
"tinted-zed": {
"flake": false,
"locked": {
"lastModified": 1751158968,
"narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=",
"lastModified": 1725758778,
"narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=",
"owner": "tinted-theming",
"repo": "base16-zed",
"rev": "86a470d94204f7652b906ab0d378e4231a5b3384",
"rev": "122c9e5c0e6f27211361a04fae92df97940eccf9",
"type": "github"
},
"original": {
@ -567,6 +639,28 @@
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"stylix",
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"valheim-server": {
"inputs": {
"nixpkgs": [

View file

@ -8,8 +8,6 @@
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
impermanence.url = "github:nix-community/impermanence";
stylix.url = "github:danth/stylix";
nix-minecraft.url = "git+https://codeberg.org/nix-astral/nix-minecraft.git";
# nix-minecraft.url = "github:Infinidoge/nix-minecraft";
@ -46,9 +44,6 @@
# vm
muvm = utils.mkHost ./hosts/muvm/configuration.nix;
# work
murk = utils.mkHost ./hosts/murk/configuration.nix;
};
homeManagerModules.default = ./modules/home;

View file

@ -9,7 +9,6 @@ in {
nix-alien
pkgs.r2modman
pkgs.lutris
pkgs.godot
];
# System

View file

@ -1,47 +0,0 @@
{ config, lib, pkgs, inputs, system, sources, modulesPath, ... }:
let cfg = config.mods;
in {
# Hardware
imports = [
./hardware-configuration.nix
./disk-config.nix
inputs.impermanence.nixosModules.impermanence
(inputs.nixpkgs
+ "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
];
environment.systemPackages = with inputs.nix-alien.packages.${system};
[ nix-alien ];
# System
mods.user.name = "muon";
networking.hostName = "murk";
networking.hostId = "a2309090";
mods.home.file = ./home.nix;
# Modules
mods.desktop.enable = true;
mods.boot.enable = false;
mods.theme.enable = true;
mods.theme.scheme = "woodland";
mods.theme.wallpaper = ./wallpaper.png;
mods.impermanence.enable = false;
services.xserver.windowManager.i3.enable = true;
# Hardware preferences
environment.variables = {
WINIT_HIDPI_FACTOR = "1";
WINIT_X11_SCALE_FACTOR = "1";
};
## Mouse
services.libinput.mouse.accelProfile = "flat";
# Version of first install
system.stateVersion = "23.05";
}

View file

@ -1,69 +0,0 @@
{ inputs }: {
inputs.disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/disk/by-diskseq/1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
# disable settings.keyFile if you want to use interactive password entry
#passwordFile = "/tmp/secret.key"; # Interactive
# settings = {
# allowDiscards = true;
# keyFile = "/tmp/secret.key";
# };
# additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/log" = {
mountpoint = "/var/log";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/swap" = {
mountpoint = "/swap";
swap.swapfile.size = "4G";
};
};
};
};
};
};
};
};
};
};
}

View file

@ -1,19 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "zfs" "ntfs" "btrfs" ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -1,32 +0,0 @@
{ pkgs, lib, osConfig, inputs, ... }:
let cfg = osConfig.mods;
in {
imports = [ inputs.impermanence.homeManagerModules.impermanence ];
# Modules
mods.xdg.enable = true;
mods.i3.enable = true;
mods.terminal.zsh.enable = true;
mods.terminal.emulator.enable = true;
mods.terminal.development.enable = true;
mods.terminal.tools.enable = true;
mods.desktop.development.enable = true;
mods.desktop.productivity.enable = false;
# Hardware preferences
## Monitors
services.autorandr.enable = true;
programs.autorandr = {
enable = true;
hooks.postswitch = {
"notify-i3" = "${pkgs.i3}/bin/i3-msg restart";
"set-wallpaper" = ''
${lib.getExe pkgs.feh} --bg-fill --nofehbg ${./wallpaper.png}
'';
};
};
# Version of first install
home.stateVersion = "23.05";
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

View file

@ -8,7 +8,6 @@ in {
./sops
./xdg.nix
./impermanence.nix
];
# Let Home Manager install and manage itself

View file

@ -3,6 +3,7 @@
lib.mkEnableOption "enables gui development tools";
config = lib.mkIf config.mods.desktop.development.enable {
home.packages = with pkgs; [ godot ];
programs.qutebrowser = {
enable = true;

View file

@ -1,50 +0,0 @@
{ 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"
];
};
};
}

View file

@ -2,10 +2,7 @@
let
cfg = config.mods.terminal;
aliases = with lib; {
la = "ls -lah";
xc = "${getExe pkgs.xclip} -selection clipboard";
};
aliases = { la = "ls -lah"; };
in {
options.mods.terminal = { zsh.enable = lib.mkEnableOption "enables zsh"; };

View file

@ -28,7 +28,6 @@ in with lib; {
"bottom"
"htop"
"vifm"
"rbw"
]);
home.packages = with pkgs; [
@ -41,14 +40,10 @@ in with lib; {
dua
fdupes
vifm
unzip
# security
pinentry-tty
# utilities
# programs
fend
xclip
unzip
];
};
}

View file

@ -11,11 +11,10 @@
timeout = 2;
efi.canTouchEfiVariables = true;
grub = {
enable = lib.mkDefault true;
enable = true;
zfsSupport = true;
efiSupport = true;
device = "nodev";
} // lib.optionalAttrs (config.mods.monitors != { }) {
gfxmodeEfi = config.mods.monitors.primary.config.mode;
};
};

View file

@ -27,8 +27,7 @@ in with lib; {
config = {
networking.networkmanager.enable = true;
networking.nameservers = [ "45.90.28.97" "45.90.30.97" ];
# services.resolved.enable = true;
services.resolved.enable = true;
# udev 250 doesn't reliably reinitialize devices after restart
systemd.services.systemd-udevd.restartIfChanged = false;

View file

@ -7,8 +7,6 @@
./server
./sops
./impermanence.nix
# </3
./unfree
];

View file

@ -1,41 +0,0 @@
{ pkgs, lib, config, ... }:
with lib; {
options.mods.impermanence.enable = mkEnableOption "enables impermanence";
config = mkIf config.mods.impermanence.enable {
environment.persistence."/persistent" = {
directories = [
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
];
files = [ "/etc/machine-id" ];
};
boot.initrd.postResumeCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount /dev/mapper/crypted /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
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"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
};
}