Compare commits
3 Commits
updated-in
...
updated-in
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f502b13e58 | ||
82f8064956 | |||
342d50d936 |
@@ -6,6 +6,7 @@
|
||||
# My system is fucked
|
||||
gptfdisk
|
||||
parted
|
||||
grow-last-partition-and-filesystem
|
||||
|
||||
# Normal usage
|
||||
htop
|
||||
|
6
flake.lock
generated
6
flake.lock
generated
@@ -646,11 +646,11 @@
|
||||
},
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1756386758,
|
||||
"narHash": "sha256-1wxxznpW2CKvI9VdniaUnTT2Os6rdRJcRUf65ZK9OtE=",
|
||||
"lastModified": 1756542300,
|
||||
"narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dfb2f12e899db4876308eba6d93455ab7da304cd",
|
||||
"rev": "d7600c775f877cd87b4f5a831c28aa94137377aa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -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}"
|
||||
|
17
pkgs/grow-last-partition-and-filesystem/default.nix
Normal file
17
pkgs/grow-last-partition-and-filesystem/default.nix
Normal file
@@ -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
|
||||
];
|
||||
}
|
||||
|
@@ -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."
|
@@ -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 {};
|
||||
|
Reference in New Issue
Block a user