1
0

Compare commits

...

3 Commits

4 changed files with 10 additions and 4 deletions

8
flake.lock generated
View File

@@ -411,11 +411,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1757364612, "lastModified": 1757627777,
"narHash": "sha256-6MSqlWHH15qbWbvS9b6OTGdtIkW6GVb9SSLkEYAMdDw=", "narHash": "sha256-NGUqHQ+/BaUhjgSYQauTihTtNyhhnQRMJ8t7ZSPNpmk=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "cb758d9bc97baa11e80a048e666c99986cabed43", "rev": "b7b0f0d5191433bca1377f7d818b800627a83fda",
"revCount": 6, "revCount": 9,
"type": "git", "type": "git",
"url": "https://git.clerie.de/clerie/mu5001tool.git" "url": "https://git.clerie.de/clerie/mu5001tool.git"
}, },

View File

@@ -7,6 +7,8 @@
serviceConfig = { serviceConfig = {
DynamicUser = true; DynamicUser = true;
LoadCredential = "zte-hypermobile-5g-password:${config.sops.secrets."zte-hypermobile-5g-password".path}"; LoadCredential = "zte-hypermobile-5g-password:${config.sops.secrets."zte-hypermobile-5g-password".path}";
Restart = "on-failure";
RestartSec = "15s";
}; };
script = '' script = ''
${lib.getExe pkgs.mu5001tool} --password-file ''${CREDENTIALS_DIRECTORY}/zte-hypermobile-5g-password prometheus-exporter --listen-port 9242 ${lib.getExe pkgs.mu5001tool} --password-file ''${CREDENTIALS_DIRECTORY}/zte-hypermobile-5g-password prometheus-exporter --listen-port 9242

View File

@@ -10,6 +10,7 @@ writeShellApplication {
text = builtins.readFile ./grow-last-partition-and-filesystem.sh; text = builtins.readFile ./grow-last-partition-and-filesystem.sh;
runtimeInputs = [ runtimeInputs = [
e2fsprogs e2fsprogs
gptfdisk
jq jq
parted parted
]; ];

View File

@@ -11,6 +11,9 @@ fi
DEVICE="$1" DEVICE="$1"
echo "Move GTP backup header to end of disk"
sgdisk "${DEVICE}" --move-second-header
PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)" PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)"
PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')" PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')"
PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')" PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')"