From 22a171f3e0405d504e8c8c3b32f73a8087a5ed66 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 29 Aug 2015 00:36:50 +0200 Subject: krebs pkgs += charybdis lentil much While there, put everything into subdirectories. --- krebs/5pkgs/hashPassword/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 krebs/5pkgs/hashPassword/default.nix (limited to 'krebs/5pkgs/hashPassword') diff --git a/krebs/5pkgs/hashPassword/default.nix b/krebs/5pkgs/hashPassword/default.nix new file mode 100644 index 000000000..a10340cc4 --- /dev/null +++ b/krebs/5pkgs/hashPassword/default.nix @@ -0,0 +1,16 @@ +{ lib, pkgs, ... }: + +pkgs.writeScriptBin "hashPassword" '' + #! /bin/sh + # usage: hashPassword + set -euf + + export PATH=${lib.makeSearchPath "bin" (with pkgs; [ + coreutils + mkpasswd + openssl + ])} + + salt=$(openssl rand -base64 16 | tr -d '+=' | head -c 16) + exec mkpasswd -m sha-512 -S "$salt" +'' -- cgit v1.2.3 [cgit] Unable to lock slot /tmp/cgit/6c000000.lock: No such file or directory (2)