Compare commits
2 Commits
17e23895d9
...
d4a5eb5694
| Author | SHA1 | Date | |
|---|---|---|---|
|
d4a5eb5694
|
|||
|
786a2d4132
|
24
flake.lock
generated
24
flake.lock
generated
@@ -191,11 +191,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752208517,
|
"lastModified": 1752391422,
|
||||||
"narHash": "sha256-aRY1cYOdVdXdNjcL/Twpa27CknO7pVHxooPsBizDraE=",
|
"narHash": "sha256-ReX0NG6nIAEtQQjLqeu1vUU2jjZuMlpymNtb4VQYeus=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "c6a01e54af81b381695db796a43360bf6db5702f",
|
"rev": "c26266790678863cce8e7460fdbf0d80991b1906",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -238,11 +238,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752258421,
|
"lastModified": 1752399196,
|
||||||
"narHash": "sha256-NBKcNtJv78fv6HJp1peu3HRwdITUCgZoqKNMpiEnpR0=",
|
"narHash": "sha256-6g8BFnit2vPB4kPSio2WDqoIX5q799fOOw3Pn7pAXFw=",
|
||||||
"owner": "ggml-org",
|
"owner": "ggml-org",
|
||||||
"repo": "llama.cpp",
|
"repo": "llama.cpp",
|
||||||
"rev": "f5e96b368f1acc7f53c390001b936517c4d18999",
|
"rev": "e743cddb60dc3a8815b9de7dd7d5c491e61b2259",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -260,11 +260,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752286765,
|
"lastModified": 1752373696,
|
||||||
"narHash": "sha256-GtbDWVpILwZY1UDrDvdn06Q5W0CXkcJ0kEcOxT8cObk=",
|
"narHash": "sha256-xdjUzHG3sPAs3U1wVnx5hf1NrspCN+qtaBmAks+wnsM=",
|
||||||
"owner": "Infinidoge",
|
"owner": "Infinidoge",
|
||||||
"repo": "nix-minecraft",
|
"repo": "nix-minecraft",
|
||||||
"rev": "c1f8c5755d2107cdab536b5dff33239ce8df7e18",
|
"rev": "93ca1ac26dc85d8c34f838a5afb7138ff445d2bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -402,11 +402,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751564530,
|
"lastModified": 1752305350,
|
||||||
"narHash": "sha256-DybnqQMmkMEbNQhrbMGFijZCa9g5mtYIMPACVNMJ5u8=",
|
"narHash": "sha256-5sUt2hme7ReKCTUgcspIMnkZg80//zy8S6Yd27fKZJQ=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "srvos",
|
"repo": "srvos",
|
||||||
"rev": "6bb452f0b31058ffe64241bcf092ebf1c7758be1",
|
"rev": "c1229575cfc15ae7ad5d9f9bfa90c8a996a23d72",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
19
lib.nix
19
lib.nix
@@ -19,15 +19,30 @@ inputs.nixpkgs.lib.extend (
|
|||||||
gawk
|
gawk
|
||||||
coreutils
|
coreutils
|
||||||
];
|
];
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
zfs list -o mountpoint,mounted -H | awk '$2 == "yes" {print $1}' | grep -c '${lib.strings.concatStringsSep "\|" dirs}' | grep -Fq ${toString (lib.length dirs)}
|
|
||||||
|
TARGETS=$(echo "${lib.strings.concatStringsSep "\n" dirs}" | sort | uniq)
|
||||||
|
MOUNTED=$(zfs list -o mountpoint,mounted -H | awk '$2 == "yes" {print $1}' | sort | uniq)
|
||||||
|
NUM_MATCHED=$(echo "$MOUNTED" | grep -Ec '${lib.strings.concatStringsSep "\|" dirs}')
|
||||||
|
if [[ "$NUM_MATCHED" -eq "${toString (lib.length dirs)}" ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
FOUND=$(printf "%s\n%s" "$TARGETS" "$MOUNTED" | sort | uniq -c | awk '$1 == "2" {print $2}' | sort)
|
||||||
|
MISSING=$(printf "%s\n%s" "$FOUND" "$TARGETS" | sort | uniq -u | sort)
|
||||||
|
|
||||||
|
echo "FAILURE, missing: $MISSING" 1>&2
|
||||||
|
exit 1
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceMountDeps = serviceName: dirs: {
|
serviceMountDeps = serviceName: dirs: {
|
||||||
systemd.services."${serviceName}_mounts" = {
|
systemd.services."${serviceName}_mounts" = {
|
||||||
wants = [ "zfs.target" ];
|
wants = [ "zfs.target" ];
|
||||||
|
before = [ "${serviceName}.service" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
@@ -37,6 +52,8 @@ inputs.nixpkgs.lib.extend (
|
|||||||
|
|
||||||
systemd.services.${serviceName} = {
|
systemd.services.${serviceName} = {
|
||||||
wants = [ "${serviceName}_mounts.service" ];
|
wants = [ "${serviceName}_mounts.service" ];
|
||||||
|
after = [ "${serviceName}_mounts.service" ];
|
||||||
|
requires = [ "${serviceName}_mounts.service" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user