nmtrust: init at 0.1.0

This commit is contained in:
Brett Eisenberg
2026-04-16 17:28:00 -07:00
parent 94fab6ab70
commit 2fb2da4230
+70
View File
@@ -0,0 +1,70 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
shellcheck,
bash,
systemd,
coreutils,
gawk,
util-linux,
}:
stdenv.mkDerivation {
pname = "nmtrust";
version = "0.1.0";
strictDeps = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "brett";
repo = "nmtrust-nix";
rev = "v0.1.0";
hash = "sha256-7Cs00mCzByTKe7w5pnkkgqtZyUSaPa2r/5Uv133eZy0=";
};
nativeBuildInputs = [ makeWrapper ];
nativeCheckInputs = [ shellcheck ];
doCheck = true;
checkPhase = ''
runHook preCheck
shellcheck nmtrust.sh
runHook postCheck
'';
installPhase = ''
runHook preInstall
install -Dm755 nmtrust.sh $out/bin/nmtrust
wrapProgram $out/bin/nmtrust \
--prefix PATH : ${
lib.makeBinPath [
bash
systemd
coreutils
gawk
util-linux
]
}
runHook postInstall
'';
meta = {
description = "Declarative network trust management for NixOS";
longDescription = ''
nmtrust evaluates the trust state of active NetworkManager connections
and activates corresponding systemd targets. Services bound to these
targets start and stop automatically as you move between trusted,
untrusted, and offline networks.
A NixOS-native reimplementation of nmtrust by Peter Hogg (pigmonkey).
'';
homepage = "https://github.com/brett/nmtrust-nix";
license = lib.licenses.unlicense;
maintainers = [ lib.maintainers.brett ];
mainProgram = "nmtrust";
platforms = lib.platforms.linux;
};
}