From 16dba0e7e389319cec6967e628d85837f5d46915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 27 Jun 2022 21:55:07 +0200 Subject: nixos/machine/ridcully: update --- pkgs/luks-hw-password/default.nix | 20 ++++++++++++++++++++ pkgs/luks-hw-password/luks-hw-password.sh | 6 ++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/luks-hw-password/default.nix create mode 100755 pkgs/luks-hw-password/luks-hw-password.sh (limited to 'pkgs/luks-hw-password') diff --git a/pkgs/luks-hw-password/default.nix b/pkgs/luks-hw-password/default.nix new file mode 100644 index 0000000..9797735 --- /dev/null +++ b/pkgs/luks-hw-password/default.nix @@ -0,0 +1,20 @@ +{ lib, stdenvNoCC, makeWrapper +, dmidecode, coreutils +}: + +stdenvNoCC.mkDerivation { + pname = "luks-hw-password"; + version = "1.0"; + meta = with lib; { + license = licenses.gpl3; + platforms = platforms.linux; + }; + + nativeBuildInputs = [ makeWrapper ]; + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p $out/bin + makeWrapper ${./luks-hw-password.sh} $out/bin/luks-hw-password \ + --prefix PATH : ${lib.makeBinPath [ dmidecode coreutils ]} + ''; +} diff --git a/pkgs/luks-hw-password/luks-hw-password.sh b/pkgs/luks-hw-password/luks-hw-password.sh new file mode 100755 index 0000000..8ad64bb --- /dev/null +++ b/pkgs/luks-hw-password/luks-hw-password.sh @@ -0,0 +1,6 @@ +#!/bin/sh +{ + dmidecode -s system-uuid + dmidecode -s baseboard-serial-number + dmidecode -s processor-version +} | sha512sum | cut -f1 -d ' ' -- cgit v1.2.3