mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-02-04 08:16:48 +05:30
Compare commits
4 Commits
87f3d1eacd
...
f71dcfb43c
| Author | SHA1 | Date | |
|---|---|---|---|
|
f71dcfb43c
|
|||
|
61f4af216e
|
|||
|
bb1dce3b3a
|
|||
|
8667f72e87
|
@@ -103,40 +103,48 @@
|
||||
kernelPackages = pkgs.linuxPackages_zen;
|
||||
supportedFilesystems = ["ntfs"];
|
||||
|
||||
initrd.systemd = {
|
||||
enable = lib.mkForce true;
|
||||
initrd = {
|
||||
kernelModules = [
|
||||
"vfio_pci"
|
||||
"vfio"
|
||||
"vfio_iommu_type1"
|
||||
];
|
||||
|
||||
services.wipe-my-fs = {
|
||||
wantedBy = ["initrd.target"];
|
||||
after = ["initrd-root-device.target"];
|
||||
before = ["sysroot.mount"];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
mkdir /btrfs_tmp
|
||||
mount /dev/disk/by-partlabel/disk-primary-root /btrfs_tmp
|
||||
systemd = {
|
||||
enable = lib.mkForce true;
|
||||
|
||||
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
|
||||
services.wipe-my-fs = {
|
||||
wantedBy = ["initrd.target"];
|
||||
after = ["initrd-root-device.target"];
|
||||
before = ["sysroot.mount"];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
mkdir /btrfs_tmp
|
||||
mount /dev/disk/by-partlabel/disk-primary-root /btrfs_tmp
|
||||
|
||||
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"
|
||||
}
|
||||
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
|
||||
|
||||
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
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"
|
||||
}
|
||||
|
||||
btrfs subvolume create /btrfs_tmp/root
|
||||
umount /btrfs_tmp
|
||||
'';
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -393,6 +401,7 @@
|
||||
"/var/lib/docker"
|
||||
"/var/lib/waydroid"
|
||||
"/var/lib/iwd"
|
||||
"/var/lib/libvirt"
|
||||
"/etc/NetworkManager/system-connections"
|
||||
];
|
||||
files = [
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
spotify = "wezterm start --class wezterm-floating -e spotify_player";
|
||||
filemanager = "wezterm start --class wezterm-floating -e superfile";
|
||||
in {
|
||||
# See https://wiki.hyprland.org/Configuring/Multi-GPU
|
||||
# @TODO: use card by path instead off symlink
|
||||
env = "AQ_DRM_DEVICES,/dev/dri/card2:/dev/dri/card1";
|
||||
|
||||
#-- Output
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors
|
||||
monitor = "eDP-1,2560x1440@90,0x0,1";
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
swtpm.enable = true;
|
||||
};
|
||||
};
|
||||
spiceUSBRedirection.enable = true;
|
||||
};
|
||||
|
||||
users.users.${username}.extraGroups = ["libvirtd"];
|
||||
|
||||
Reference in New Issue
Block a user