From 342d50d936e1d241bc90017368b0a1ecb7ec8854 Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 30 Aug 2025 09:52:25 +0200 Subject: [PATCH 1/3] pkgs/bijwerken-system-upgrade: Copy system store path from any configured nix cache --- pkgs/bijwerken-system-upgrade/bijwerken-system-upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/bijwerken-system-upgrade/bijwerken-system-upgrade.sh b/pkgs/bijwerken-system-upgrade/bijwerken-system-upgrade.sh index 729c5b1..2c5685e 100755 --- a/pkgs/bijwerken-system-upgrade/bijwerken-system-upgrade.sh +++ b/pkgs/bijwerken-system-upgrade/bijwerken-system-upgrade.sh @@ -40,7 +40,7 @@ if [[ -z $NO_CONFIRM ]]; then fi echo "Download ${STORE_PATH}" -nix copy --from "https://nix-cache.clerie.de" "${STORE_PATH}" +nix copy --to daemon "${STORE_PATH}" echo "Add to system profile" nix-env -p "/nix/var/nix/profiles/system" --set "${STORE_PATH}" From 82f80649565a5619a0d5c5bed6ab4f55aee3d622 Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 30 Aug 2025 11:11:57 +0200 Subject: [PATCH 2/3] pkgs/grow-last-partition-and-filesystem: Add command to easily grow a filesystem on a disk resized by Proxmox --- configuration/common/programs.nix | 1 + .../default.nix | 17 +++++++++++ .../grow-last-partition-and-filesystem.sh | 29 +++++++++++++++++++ pkgs/overlay.nix | 1 + 4 files changed, 48 insertions(+) create mode 100644 pkgs/grow-last-partition-and-filesystem/default.nix create mode 100755 pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh diff --git a/configuration/common/programs.nix b/configuration/common/programs.nix index f9c9d82..87889c9 100644 --- a/configuration/common/programs.nix +++ b/configuration/common/programs.nix @@ -6,6 +6,7 @@ # My system is fucked gptfdisk parted + grow-last-partition-and-filesystem # Normal usage htop diff --git a/pkgs/grow-last-partition-and-filesystem/default.nix b/pkgs/grow-last-partition-and-filesystem/default.nix new file mode 100644 index 0000000..06dac05 --- /dev/null +++ b/pkgs/grow-last-partition-and-filesystem/default.nix @@ -0,0 +1,17 @@ +{ + e2fsprogs, + jq, + parted, + writeShellApplication, +}: + +writeShellApplication { + name = "grow-last-partition-and-filesystem"; + text = builtins.readFile ./grow-last-partition-and-filesystem.sh; + runtimeInputs = [ + e2fsprogs + jq + parted + ]; +} + diff --git a/pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh b/pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh new file mode 100755 index 0000000..864b035 --- /dev/null +++ b/pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [[ $# -ne 1 ]]; then + echo "Pass device to grow as first argument:" + echo "grow-last-partition-and-filesystem DEVICE" + + exit 1 +fi + +DEVICE="$1" + +PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)" +PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')" +PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')" + +echo "Growing partition ${DEVICE}${PARTNUMBER} (${PARTNAME})" +echo + +parted "${DEVICE}" resizepart "${PARTNUMBER}" 100% + +echo +echo "Resizing filesystem" +echo + +resize2fs "${DEVICE}${PARTNUMBER}" + +echo "Done." diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 1d66db8..8fd5cce 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -19,6 +19,7 @@ final: prev: { git-diff-word = final.callPackage ./git-diff-word {}; git-pp = final.callPackage ./git-pp {}; git-show-link = final.callPackage ./git-show-link {}; + grow-last-partition-and-filesystem = final.callPackage ./grow-last-partition-and-filesystem {}; nix-remove-result-links = final.callPackage ./nix-remove-result-links {}; nixfiles-auto-install = final.callPackage ./nixfiles/nixfiles-auto-install.nix {}; nixfiles-generate-config = final.callPackage ./nixfiles/nixfiles-generate-config.nix {}; From f502b13e589048bd39112201fd8652b3c5c5cf6b Mon Sep 17 00:00:00 2001 From: Flake Update Bot Date: Sun, 31 Aug 2025 03:04:12 +0200 Subject: [PATCH 3/3] Update nixpkgs 2025-08-31-01-03 --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index ba0c6b0..604fd0d 100644 --- a/flake.lock +++ b/flake.lock @@ -646,11 +646,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1753549186, - "narHash": "sha256-Znl7rzuxKg/Mdm6AhimcKynM7V3YeNDIcLjBuoBcmNs=", + "lastModified": 1756542300, + "narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "17f6bd177404d6d43017595c5264756764444ab8", + "rev": "d7600c775f877cd87b4f5a831c28aa94137377aa", "type": "github" }, "original": {