framework-2024-11-25-00-02-03
This commit is contained in:
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [../configs/common.nix ../configs/docker.nix ../configs/user.nix];
|
|
||||||
|
|
||||||
fileSystems."/export/docker" = {
|
|
||||||
device = "/home/alex/docker";
|
|
||||||
options = ["bind"];
|
|
||||||
};
|
|
||||||
}
|
|
@ -5,14 +5,73 @@
|
|||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
nixpkgs = {
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
loader = {
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
grub = {
|
||||||
|
enable = true;
|
||||||
|
device = "nodev";
|
||||||
|
efiSupport = true;
|
||||||
|
configurationLimit = 5;
|
||||||
|
enableCryptodisk = true;
|
||||||
|
useOSProber = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
tmp = {
|
tmp = {
|
||||||
useTmpfs = lib.mkDefault true;
|
useTmpfs = lib.mkDefault true;
|
||||||
cleanOnBoot = true;
|
cleanOnBoot = true;
|
||||||
};
|
};
|
||||||
consoleLogLevel = 0;
|
consoleLogLevel = 0;
|
||||||
kernel.sysctl = {"vm.max_map_count" = 262144;};
|
kernel.sysctl = {"vm.max_map_count" = 262144;};
|
||||||
supportedFilesystems = ["ntfs"];
|
supportedFilesystems = ["ntfs" "btrfs"];
|
||||||
|
|
||||||
|
initrd = {
|
||||||
|
postDeviceCommands = pkgs.lib.mkBefore ''
|
||||||
|
mkdir -p /mnt
|
||||||
|
|
||||||
|
# We first mount the btrfs root to /mnt
|
||||||
|
# so we can manipulate btrfs subvolumes.
|
||||||
|
mount -o subvol=/ /dev/mapper/lvm-root /mnt
|
||||||
|
|
||||||
|
# While we're tempted to just delete /root and create
|
||||||
|
# a new snapshot from /root-blank, /root is already
|
||||||
|
# populated at this point with a number of subvolumes,
|
||||||
|
# which makes `btrfs subvolume delete` fail.
|
||||||
|
# So, we remove them first.
|
||||||
|
#
|
||||||
|
# /root contains subvolumes:
|
||||||
|
# - /root/var/lib/portables
|
||||||
|
# - /root/var/lib/machines
|
||||||
|
#
|
||||||
|
# I suspect these are related to systemd-nspawn, but
|
||||||
|
# since I don't use it I'm not 100% sure.
|
||||||
|
# Anyhow, deleting these subvolumes hasn't resulted
|
||||||
|
# in any issues so far, except for fairly
|
||||||
|
# benign-looking errors from systemd-tmpfiles.
|
||||||
|
btrfs subvolume list -o /mnt/root |
|
||||||
|
cut -f9 -d' ' |
|
||||||
|
while read subvolume; do
|
||||||
|
echo "deleting /$subvolume subvolume..."
|
||||||
|
btrfs subvolume delete "/mnt/$subvolume"
|
||||||
|
done &&
|
||||||
|
echo "deleting /root subvolume..." &&
|
||||||
|
btrfs subvolume delete /mnt/root
|
||||||
|
|
||||||
|
echo "restoring blank /root subvolume..."
|
||||||
|
btrfs subvolume snapshot /mnt/root-blank /mnt/root
|
||||||
|
|
||||||
|
# Once we're done rolling back to a blank snapshot,
|
||||||
|
# we can unmount /mnt and continue on the boot process.
|
||||||
|
umount /mnt
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Work around for https://github.com/NixOS/nixpkgs/issues/124215
|
# Work around for https://github.com/NixOS/nixpkgs/issues/124215
|
||||||
@ -88,6 +147,23 @@
|
|||||||
man-pages
|
man-pages
|
||||||
man-pages-posix
|
man-pages-posix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
persistence."/persist" = {
|
||||||
|
directories = [
|
||||||
|
"/var/lib/nixos"
|
||||||
|
"/var/lib/tailscale"
|
||||||
|
"/var/lib/tuptime"
|
||||||
|
"/var/lib/vnstat"
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
"/etc/machine-id"
|
||||||
|
"/etc/NIXOS"
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||||
|
"/etc/ssh/ssh_host_rsa_key"
|
||||||
|
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
i18n = {
|
i18n = {
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
ktimetracker
|
ktimetracker
|
||||||
kdiff3
|
kdiff3
|
||||||
kdiskmark
|
kdiskmark
|
||||||
|
maliit-keyboard
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,11 +32,6 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# services = {
|
|
||||||
# gvfs.enable = true;
|
|
||||||
# mullvad-vpn.enable = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
ssh = {startAgent = true;};
|
ssh = {startAgent = true;};
|
||||||
# dconf.enable = true;
|
# dconf.enable = true;
|
||||||
@ -49,7 +44,6 @@
|
|||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
czkawka # fslint before
|
czkawka # fslint before
|
||||||
grsync
|
|
||||||
handbrake
|
handbrake
|
||||||
keepassxc
|
keepassxc
|
||||||
nextcloud-client
|
nextcloud-client
|
||||||
@ -66,6 +60,8 @@
|
|||||||
kitty
|
kitty
|
||||||
|
|
||||||
lan-mouse_git
|
lan-mouse_git
|
||||||
|
|
||||||
|
libreoffice
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.alex = {pkgs, ...}: {
|
home-manager.users.alex = {pkgs, ...}: {
|
||||||
|
38
flake.lock
generated
38
flake.lock
generated
@ -8,11 +8,11 @@
|
|||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732150710,
|
"lastModified": 1732400024,
|
||||||
"narHash": "sha256-H6ps/jlPn3kkGtrZeduLtfMnV8htI117/qUgMtUzJBM=",
|
"narHash": "sha256-uf1QzIl0Jj5dr7+erWjHWiCUEvywLaR7ir1jcqGgjeQ=",
|
||||||
"owner": "chaotic-cx",
|
"owner": "chaotic-cx",
|
||||||
"repo": "nyx",
|
"repo": "nyx",
|
||||||
"rev": "4621aec08aa50869a305e275c2b8a0c766f3b59b",
|
"rev": "376a2e022a5d8fa21cecb5bb0fef0cb54db5cdfc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -82,11 +82,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732025103,
|
"lastModified": 1732303962,
|
||||||
"narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=",
|
"narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "a46e702093a5c46e192243edbd977d5749e7f294",
|
"rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -102,11 +102,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732303962,
|
"lastModified": 1732482255,
|
||||||
"narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=",
|
"narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c",
|
"rev": "a9953635d7f34e7358d5189751110f87e3ac17da",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -161,11 +161,11 @@
|
|||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730468752,
|
"lastModified": 1732459504,
|
||||||
"narHash": "sha256-PixWHyqvcwst38jnOunWe/WjwlZ5R327zR/C+e0slAA=",
|
"narHash": "sha256-WSHxq6cZz/GWkEK8LeYR4PM5Wh/KsG+WTZklB4pHJSQ=",
|
||||||
"owner": "taj-ny",
|
"owner": "taj-ny",
|
||||||
"repo": "kwin-effects-forceblur",
|
"repo": "kwin-effects-forceblur",
|
||||||
"rev": "411567be19109495f9afe56a2ccf404be0599d86",
|
"rev": "669ba8729d5703823c2e9712e2d68abe57eb342e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -199,11 +199,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731797098,
|
"lastModified": 1732483221,
|
||||||
"narHash": "sha256-UhWmEZhwJZmVZ1jfHZFzCg+ZLO9Tb/v3Y6LC0UNyeTo=",
|
"narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "672ac2ac86f7dff2f6f3406405bddecf960e0db6",
|
"rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -231,16 +231,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732310578,
|
"lastModified": 1732014248,
|
||||||
"narHash": "sha256-kk5Cv6wB20ujrB8w2ny5Co20xCHYOjUSyk2VRuP0sZw=",
|
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "72f68849662579c8d4e5d13bd4d400723a1d8edd",
|
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable-small",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
# nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
nixos-hardware.url = "github:nixos/nixos-hardware/master";
|
nixos-hardware.url = "github:nixos/nixos-hardware/master";
|
||||||
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
|
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
|
||||||
|
@ -7,16 +7,6 @@
|
|||||||
}: let
|
}: let
|
||||||
be = import ../../configs/borg-exclude.nix;
|
be = import ../../configs/borg-exclude.nix;
|
||||||
in {
|
in {
|
||||||
nixpkgs = {
|
|
||||||
overlays = [
|
|
||||||
outputs.overlays.additions
|
|
||||||
outputs.overlays.modifications
|
|
||||||
];
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../configs/browser.nix
|
../../configs/browser.nix
|
||||||
@ -25,7 +15,7 @@ in {
|
|||||||
../../configs/games.nix
|
../../configs/games.nix
|
||||||
../../configs/develop.nix
|
../../configs/develop.nix
|
||||||
../../configs/hardware.nix
|
../../configs/hardware.nix
|
||||||
../../configs/virtualisation.nix
|
../../configs/virtualization.nix
|
||||||
../../configs/plasma.nix
|
../../configs/plasma.nix
|
||||||
../../configs/user-gui.nix
|
../../configs/user-gui.nix
|
||||||
../../configs/user.nix
|
../../configs/user.nix
|
||||||
@ -75,19 +65,7 @@ in {
|
|||||||
# };
|
# };
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
efiSupport = true;
|
|
||||||
device = "nodev";
|
|
||||||
configurationLimit = 5;
|
|
||||||
useOSProber = true;
|
|
||||||
};
|
|
||||||
efi = {canTouchEfiVariables = true;};
|
|
||||||
};
|
|
||||||
|
|
||||||
tmp.useTmpfs = false;
|
tmp.useTmpfs = false;
|
||||||
supportedFilesystems = ["btrfs"];
|
|
||||||
kernelPackages = pkgs.linuxPackages_cachyos;
|
kernelPackages = pkgs.linuxPackages_cachyos;
|
||||||
kernelParams = ["clearcpuid=514" "ip=dhcp"];
|
kernelParams = ["clearcpuid=514" "ip=dhcp"];
|
||||||
kernelModules = ["nct6775"];
|
kernelModules = ["nct6775"];
|
||||||
@ -116,45 +94,6 @@ in {
|
|||||||
preLVM = true;
|
preLVM = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
postDeviceCommands = pkgs.lib.mkBefore ''
|
|
||||||
mkdir -p /mnt
|
|
||||||
|
|
||||||
# We first mount the btrfs root to /mnt
|
|
||||||
# so we can manipulate btrfs subvolumes.
|
|
||||||
mount -o subvol=/ /dev/mapper/lvm-root /mnt
|
|
||||||
|
|
||||||
# While we're tempted to just delete /root and create
|
|
||||||
# a new snapshot from /root-blank, /root is already
|
|
||||||
# populated at this point with a number of subvolumes,
|
|
||||||
# which makes `btrfs subvolume delete` fail.
|
|
||||||
# So, we remove them first.
|
|
||||||
#
|
|
||||||
# /root contains subvolumes:
|
|
||||||
# - /root/var/lib/portables
|
|
||||||
# - /root/var/lib/machines
|
|
||||||
#
|
|
||||||
# I suspect these are related to systemd-nspawn, but
|
|
||||||
# since I don't use it I'm not 100% sure.
|
|
||||||
# Anyhow, deleting these subvolumes hasn't resulted
|
|
||||||
# in any issues so far, except for fairly
|
|
||||||
# benign-looking errors from systemd-tmpfiles.
|
|
||||||
btrfs subvolume list -o /mnt/root |
|
|
||||||
cut -f9 -d' ' |
|
|
||||||
while read subvolume; do
|
|
||||||
echo "deleting /$subvolume subvolume..."
|
|
||||||
btrfs subvolume delete "/mnt/$subvolume"
|
|
||||||
done &&
|
|
||||||
echo "deleting /root subvolume..." &&
|
|
||||||
btrfs subvolume delete /mnt/root
|
|
||||||
|
|
||||||
echo "restoring blank /root subvolume..."
|
|
||||||
btrfs subvolume snapshot /mnt/root-blank /mnt/root
|
|
||||||
|
|
||||||
# Once we're done rolling back to a blank snapshot,
|
|
||||||
# we can unmount /mnt and continue on the boot process.
|
|
||||||
umount /mnt
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -205,21 +144,9 @@ in {
|
|||||||
"/etc/NetworkManager/system-connections"
|
"/etc/NetworkManager/system-connections"
|
||||||
"/var/lib/bluetooth"
|
"/var/lib/bluetooth"
|
||||||
"/var/lib/docker"
|
"/var/lib/docker"
|
||||||
"/var/lib/nixos"
|
|
||||||
"/var/lib/samba"
|
"/var/lib/samba"
|
||||||
"/var/lib/sddm"
|
"/var/lib/sddm"
|
||||||
"/var/lib/systemd/rfkill"
|
"/var/lib/systemd/rfkill"
|
||||||
"/var/lib/tailscale"
|
|
||||||
"/var/lib/tuptime"
|
|
||||||
"/var/lib/vnstat"
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
# "/etc/machine-id"
|
|
||||||
"/etc/NIXOS"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -8,26 +8,13 @@
|
|||||||
}: let
|
}: let
|
||||||
be = import ../../configs/borg-exclude.nix;
|
be = import ../../configs/borg-exclude.nix;
|
||||||
in {
|
in {
|
||||||
nixpkgs = {
|
|
||||||
overlays = [
|
|
||||||
outputs.overlays.additions
|
|
||||||
];
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
# packageOverrides = pkgs: {
|
|
||||||
# intel-vaapi-driver =
|
|
||||||
# pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../configs/browser.nix
|
../../configs/browser.nix
|
||||||
../../configs/common.nix
|
../../configs/common.nix
|
||||||
../../configs/docker.nix
|
../../configs/docker.nix
|
||||||
../../configs/games.nix
|
../../configs/games.nix
|
||||||
../../configs/virtualisation.nix
|
../../configs/virtualization.nix
|
||||||
../../configs/plasma.nix
|
../../configs/plasma.nix
|
||||||
../../configs/user-gui.nix
|
../../configs/user-gui.nix
|
||||||
../../configs/user.nix
|
../../configs/user.nix
|
||||||
@ -70,19 +57,7 @@ in {
|
|||||||
# };
|
# };
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
efiSupport = true;
|
|
||||||
device = "nodev";
|
|
||||||
configurationLimit = 5;
|
|
||||||
# enableCryptodisk = true;
|
|
||||||
};
|
|
||||||
efi = {canTouchEfiVariables = true;};
|
|
||||||
};
|
|
||||||
|
|
||||||
tmp.useTmpfs = false;
|
tmp.useTmpfs = false;
|
||||||
supportedFilesystems = ["btrfs"];
|
|
||||||
kernelPackages = pkgs.linuxPackages_6_11;
|
kernelPackages = pkgs.linuxPackages_6_11;
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
@ -93,45 +68,6 @@ in {
|
|||||||
preLVM = true;
|
preLVM = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
postDeviceCommands = pkgs.lib.mkBefore ''
|
|
||||||
mkdir -p /mnt
|
|
||||||
|
|
||||||
# We first mount the btrfs root to /mnt
|
|
||||||
# so we can manipulate btrfs subvolumes.
|
|
||||||
mount -o subvol=/ /dev/mapper/lvm-root /mnt
|
|
||||||
|
|
||||||
# While we're tempted to just delete /root and create
|
|
||||||
# a new snapshot from /root-blank, /root is already
|
|
||||||
# populated at this point with a number of subvolumes,
|
|
||||||
# which makes `btrfs subvolume delete` fail.
|
|
||||||
# So, we remove them first.
|
|
||||||
#
|
|
||||||
# /root contains subvolumes:
|
|
||||||
# - /root/var/lib/portables
|
|
||||||
# - /root/var/lib/machines
|
|
||||||
#
|
|
||||||
# I suspect these are related to systemd-nspawn, but
|
|
||||||
# since I don't use it I'm not 100% sure.
|
|
||||||
# Anyhow, deleting these subvolumes hasn't resulted
|
|
||||||
# in any issues so far, except for fairly
|
|
||||||
# benign-looking errors from systemd-tmpfiles.
|
|
||||||
btrfs subvolume list -o /mnt/root |
|
|
||||||
cut -f9 -d' ' |
|
|
||||||
while read subvolume; do
|
|
||||||
echo "deleting /$subvolume subvolume..."
|
|
||||||
btrfs subvolume delete "/mnt/$subvolume"
|
|
||||||
done &&
|
|
||||||
echo "deleting /root subvolume..." &&
|
|
||||||
btrfs subvolume delete /mnt/root
|
|
||||||
|
|
||||||
echo "restoring blank /root subvolume..."
|
|
||||||
btrfs subvolume snapshot /mnt/root-blank /mnt/root
|
|
||||||
|
|
||||||
# Once we're done rolling back to a blank snapshot,
|
|
||||||
# we can unmount /mnt and continue on the boot process.
|
|
||||||
umount /mnt
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -225,7 +161,7 @@ in {
|
|||||||
|
|
||||||
borgbackup.jobs.home = rec {
|
borgbackup.jobs.home = rec {
|
||||||
repo = "ssh://u278697-sub9@u278697.your-storagebox.de:23/./borg";
|
repo = "ssh://u278697-sub9@u278697.your-storagebox.de:23/./borg";
|
||||||
|
|
||||||
compression = "auto,zstd";
|
compression = "auto,zstd";
|
||||||
encryption = {
|
encryption = {
|
||||||
mode = "repokey-blake2";
|
mode = "repokey-blake2";
|
||||||
@ -293,21 +229,8 @@ in {
|
|||||||
"/etc/NetworkManager/system-connections"
|
"/etc/NetworkManager/system-connections"
|
||||||
# "/var/lib/bluetooth"
|
# "/var/lib/bluetooth"
|
||||||
"/var/lib/docker"
|
"/var/lib/docker"
|
||||||
"/var/lib/nixos"
|
|
||||||
# "/var/lib/samba"
|
# "/var/lib/samba"
|
||||||
"/var/lib/sddm"
|
"/var/lib/sddm"
|
||||||
# "/var/lib/systemd/rfkill"
|
|
||||||
"/var/lib/tailscale"
|
|
||||||
"/var/lib/tuptime"
|
|
||||||
"/var/lib/vnstat"
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
"/etc/machine-id"
|
|
||||||
"/etc/NIXOS"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -5,17 +5,6 @@
|
|||||||
outputs,
|
outputs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
nixpkgs = {
|
|
||||||
overlays = [
|
|
||||||
outputs.overlays.additions
|
|
||||||
outputs.overlays.modifications
|
|
||||||
outputs.overlays.unstable-packages
|
|
||||||
];
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../configs/docker.nix
|
../../configs/docker.nix
|
||||||
@ -46,17 +35,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
device = "nodev";
|
|
||||||
efiSupport = true;
|
|
||||||
configurationLimit = 5;
|
|
||||||
};
|
|
||||||
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = ["r8169"];
|
availableKernelModules = ["r8169"];
|
||||||
systemd.users.root.shell = "/bin/cryptsetup-askpass";
|
systemd.users.root.shell = "/bin/cryptsetup-askpass";
|
||||||
@ -79,50 +57,8 @@
|
|||||||
preLVM = true;
|
preLVM = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
postDeviceCommands = pkgs.lib.mkBefore ''
|
|
||||||
mkdir -p /mnt
|
|
||||||
|
|
||||||
# We first mount the btrfs root to /mnt
|
|
||||||
# so we can manipulate btrfs subvolumes.
|
|
||||||
mount -o subvol=/ /dev/mapper/lvm-root /mnt
|
|
||||||
|
|
||||||
# While we're tempted to just delete /root and create
|
|
||||||
# a new snapshot from /root-blank, /root is already
|
|
||||||
# populated at this point with a number of subvolumes,
|
|
||||||
# which makes `btrfs subvolume delete` fail.
|
|
||||||
# So, we remove them first.
|
|
||||||
#
|
|
||||||
# /root contains subvolumes:
|
|
||||||
# - /root/var/lib/portables
|
|
||||||
# - /root/var/lib/machines
|
|
||||||
#
|
|
||||||
# I suspect these are related to systemd-nspawn, but
|
|
||||||
# since I don't use it I'm not 100% sure.
|
|
||||||
# Anyhow, deleting these subvolumes hasn't resulted
|
|
||||||
# in any issues so far, except for fairly
|
|
||||||
# benign-looking errors from systemd-tmpfiles.
|
|
||||||
btrfs subvolume list -o /mnt/root |
|
|
||||||
cut -f9 -d' ' |
|
|
||||||
while read subvolume; do
|
|
||||||
echo "deleting /$subvolume subvolume..."
|
|
||||||
btrfs subvolume delete "/mnt/$subvolume"
|
|
||||||
done &&
|
|
||||||
echo "deleting /root subvolume..." &&
|
|
||||||
btrfs subvolume delete /mnt/root
|
|
||||||
|
|
||||||
echo "restoring blank /root subvolume..."
|
|
||||||
btrfs subvolume snapshot /mnt/root-blank /mnt/root
|
|
||||||
|
|
||||||
# Once we're done rolling back to a blank snapshot,
|
|
||||||
# we can unmount /mnt and continue on the boot process.
|
|
||||||
umount /mnt
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
supportedFilesystems = ["btrfs"];
|
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
extraModulePackages = with pkgs.linuxPackages_latest; [rtl88x2bu];
|
extraModulePackages = with pkgs.linuxPackages_latest; [rtl88x2bu];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -175,19 +111,7 @@
|
|||||||
persistence."/persist" = {
|
persistence."/persist" = {
|
||||||
directories = [
|
directories = [
|
||||||
# "/var/lib/docker"
|
# "/var/lib/docker"
|
||||||
"/var/lib/nixos"
|
|
||||||
"/var/lib/tor"
|
"/var/lib/tor"
|
||||||
"/var/lib/tailscale"
|
|
||||||
"/var/lib/tuptime"
|
|
||||||
"/var/lib/vnstat"
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
"/etc/machine-id"
|
|
||||||
"/etc/NIXOS"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -5,12 +5,6 @@
|
|||||||
outputs,
|
outputs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
nixpkgs = {
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../configs/common.nix
|
../../configs/common.nix
|
||||||
@ -37,57 +31,9 @@
|
|||||||
time.timeZone = "Europe/Berlin";
|
time.timeZone = "Europe/Berlin";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
efiSupport = true;
|
|
||||||
device = "nodev";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
supportedFilesystems = ["btrfs"];
|
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
supportedFilesystems = ["btrfs"];
|
supportedFilesystems = ["btrfs"];
|
||||||
|
|
||||||
postResumeCommands = lib.mkAfter ''
|
|
||||||
mkdir -p /mnt
|
|
||||||
# We first mount the btrfs root to /mnt
|
|
||||||
# so we can manipulate btrfs subvolumes.
|
|
||||||
mount -o subvol=/ /dev/vda3 /mnt
|
|
||||||
|
|
||||||
# While we're tempted to just delete /root and create
|
|
||||||
# a new snapshot from /root-blank, /root is already
|
|
||||||
# populated at this point with a number of subvolumes,
|
|
||||||
# which makes `btrfs subvolume delete` fail.
|
|
||||||
# So, we remove them first.
|
|
||||||
#
|
|
||||||
# /root contains subvolumes:
|
|
||||||
# - /root/var/lib/portables
|
|
||||||
# - /root/var/lib/machines
|
|
||||||
#
|
|
||||||
# I suspect these are related to systemd-nspawn, but
|
|
||||||
# since I don't use it I'm not 100% sure.
|
|
||||||
# Anyhow, deleting these subvolumes hasn't resulted
|
|
||||||
# in any issues so far, except for fairly
|
|
||||||
# benign-looking errors from systemd-tmpfiles.
|
|
||||||
btrfs subvolume list -o /mnt/root |
|
|
||||||
cut -f9 -d' ' |
|
|
||||||
while read subvolume; do
|
|
||||||
echo "deleting /$subvolume subvolume..."
|
|
||||||
btrfs subvolume delete "/mnt/$subvolume"
|
|
||||||
done &&
|
|
||||||
echo "deleting /root subvolume..." &&
|
|
||||||
btrfs subvolume delete /mnt/root
|
|
||||||
|
|
||||||
echo "restoring blank /root subvolume..."
|
|
||||||
btrfs subvolume snapshot /mnt/root-blank /mnt/root
|
|
||||||
|
|
||||||
# Once we're done rolling back to a blank snapshot,
|
|
||||||
# we can unmount /mnt and continue on the boot process.
|
|
||||||
umount /mnt
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -100,15 +46,6 @@
|
|||||||
persistence."/persist" = {
|
persistence."/persist" = {
|
||||||
directories = [
|
directories = [
|
||||||
"/var/lib/docker"
|
"/var/lib/docker"
|
||||||
"/var/lib/nixos"
|
|
||||||
"/var/lib/tuptime"
|
|
||||||
"/var/lib/vnstat"
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -9,17 +9,6 @@
|
|||||||
secrets = import ../../configs/secrets.nix;
|
secrets = import ../../configs/secrets.nix;
|
||||||
be = import ../../configs/borg-exclude.nix;
|
be = import ../../configs/borg-exclude.nix;
|
||||||
in {
|
in {
|
||||||
nixpkgs = {
|
|
||||||
overlays = [
|
|
||||||
outputs.overlays.additions
|
|
||||||
outputs.overlays.modifications
|
|
||||||
outputs.overlays.unstable-packages
|
|
||||||
];
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../configs/common.nix
|
../../configs/common.nix
|
||||||
@ -80,18 +69,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
device = "nodev";
|
|
||||||
efiSupport = true;
|
|
||||||
enableCryptodisk = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
supportedFilesystems = ["btrfs"];
|
|
||||||
kernelParams = ["ip=dhcp"];
|
kernelParams = ["ip=dhcp"];
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = ["virtio-pci"];
|
availableKernelModules = ["virtio-pci"];
|
||||||
@ -115,45 +93,6 @@ in {
|
|||||||
preLVM = true;
|
preLVM = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
postDeviceCommands = pkgs.lib.mkBefore ''
|
|
||||||
mkdir -p /mnt
|
|
||||||
|
|
||||||
# We first mount the btrfs root to /mnt
|
|
||||||
# so we can manipulate btrfs subvolumes.
|
|
||||||
mount -o subvol=/ /dev/mapper/lvm-root /mnt
|
|
||||||
|
|
||||||
# While we're tempted to just delete /root and create
|
|
||||||
# a new snapshot from /root-blank, /root is already
|
|
||||||
# populated at this point with a number of subvolumes,
|
|
||||||
# which makes `btrfs subvolume delete` fail.
|
|
||||||
# So, we remove them first.
|
|
||||||
#
|
|
||||||
# /root contains subvolumes:
|
|
||||||
# - /root/var/lib/portables
|
|
||||||
# - /root/var/lib/machines
|
|
||||||
#
|
|
||||||
# I suspect these are related to systemd-nspawn, but
|
|
||||||
# since I don't use it I'm not 100% sure.
|
|
||||||
# Anyhow, deleting these subvolumes hasn't resulted
|
|
||||||
# in any issues so far, except for fairly
|
|
||||||
# benign-looking errors from systemd-tmpfiles.
|
|
||||||
btrfs subvolume list -o /mnt/root |
|
|
||||||
cut -f9 -d' ' |
|
|
||||||
while read subvolume; do
|
|
||||||
echo "deleting /$subvolume subvolume..."
|
|
||||||
btrfs subvolume delete "/mnt/$subvolume"
|
|
||||||
done &&
|
|
||||||
echo "deleting /root subvolume..." &&
|
|
||||||
btrfs subvolume delete /mnt/root
|
|
||||||
|
|
||||||
echo "restoring blank /root subvolume..."
|
|
||||||
btrfs subvolume snapshot /mnt/root-blank /mnt/root
|
|
||||||
|
|
||||||
# Once we're done rolling back to a blank snapshot,
|
|
||||||
# we can unmount /mnt and continue on the boot process.
|
|
||||||
umount /mnt
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -210,23 +149,11 @@ in {
|
|||||||
"/var/lib/gitea"
|
"/var/lib/gitea"
|
||||||
"/var/lib/headscale"
|
"/var/lib/headscale"
|
||||||
"/var/lib/nextcloud"
|
"/var/lib/nextcloud"
|
||||||
"/var/lib/nixos"
|
|
||||||
"/var/lib/postgresql"
|
"/var/lib/postgresql"
|
||||||
"/var/lib/private"
|
"/var/lib/private"
|
||||||
"/var/lib/redis-nextcloud"
|
"/var/lib/redis-nextcloud"
|
||||||
"/var/lib/tailscale"
|
|
||||||
"/var/lib/tuptime"
|
|
||||||
"/var/lib/vnstat"
|
|
||||||
"/var/www"
|
"/var/www"
|
||||||
];
|
];
|
||||||
files = [
|
|
||||||
"/etc/machine-id"
|
|
||||||
"/etc/NIXOS"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user