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;
|
kernelPackages = pkgs.linuxPackages_zen;
|
||||||
supportedFilesystems = ["ntfs"];
|
supportedFilesystems = ["ntfs"];
|
||||||
|
|
||||||
initrd.systemd = {
|
initrd = {
|
||||||
enable = lib.mkForce true;
|
kernelModules = [
|
||||||
|
"vfio_pci"
|
||||||
|
"vfio"
|
||||||
|
"vfio_iommu_type1"
|
||||||
|
];
|
||||||
|
|
||||||
services.wipe-my-fs = {
|
systemd = {
|
||||||
wantedBy = ["initrd.target"];
|
enable = lib.mkForce true;
|
||||||
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
|
|
||||||
|
|
||||||
if [[ -e /btrfs_tmp/root ]]; then
|
services.wipe-my-fs = {
|
||||||
mkdir -p /btrfs_tmp/old_roots
|
wantedBy = ["initrd.target"];
|
||||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
after = ["initrd-root-device.target"];
|
||||||
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
before = ["sysroot.mount"];
|
||||||
fi
|
unitConfig.DefaultDependencies = "no";
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
script = ''
|
||||||
|
mkdir /btrfs_tmp
|
||||||
|
mount /dev/disk/by-partlabel/disk-primary-root /btrfs_tmp
|
||||||
|
|
||||||
delete_subvolume_recursively() {
|
if [[ -e /btrfs_tmp/root ]]; then
|
||||||
IFS=$'\n'
|
mkdir -p /btrfs_tmp/old_roots
|
||||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||||
delete_subvolume_recursively "/btrfs_tmp/$i"
|
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||||
done
|
fi
|
||||||
btrfs subvolume delete "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
|
delete_subvolume_recursively() {
|
||||||
delete_subvolume_recursively "$i"
|
IFS=$'\n'
|
||||||
done
|
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
|
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
|
||||||
umount /btrfs_tmp
|
delete_subvolume_recursively "$i"
|
||||||
'';
|
done
|
||||||
|
|
||||||
|
btrfs subvolume create /btrfs_tmp/root
|
||||||
|
umount /btrfs_tmp
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -393,6 +401,7 @@
|
|||||||
"/var/lib/docker"
|
"/var/lib/docker"
|
||||||
"/var/lib/waydroid"
|
"/var/lib/waydroid"
|
||||||
"/var/lib/iwd"
|
"/var/lib/iwd"
|
||||||
|
"/var/lib/libvirt"
|
||||||
"/etc/NetworkManager/system-connections"
|
"/etc/NetworkManager/system-connections"
|
||||||
];
|
];
|
||||||
files = [
|
files = [
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
spotify = "wezterm start --class wezterm-floating -e spotify_player";
|
spotify = "wezterm start --class wezterm-floating -e spotify_player";
|
||||||
filemanager = "wezterm start --class wezterm-floating -e superfile";
|
filemanager = "wezterm start --class wezterm-floating -e superfile";
|
||||||
in {
|
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
|
#-- Output
|
||||||
# See https://wiki.hyprland.org/Configuring/Monitors
|
# See https://wiki.hyprland.org/Configuring/Monitors
|
||||||
monitor = "eDP-1,2560x1440@90,0x0,1";
|
monitor = "eDP-1,2560x1440@90,0x0,1";
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
swtpm.enable = true;
|
swtpm.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
spiceUSBRedirection.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.${username}.extraGroups = ["libvirtd"];
|
users.users.${username}.extraGroups = ["libvirtd"];
|
||||||
|
|||||||
Reference in New Issue
Block a user