From 854bd37b06a4bddcf5d71e7c6a2264eaac66c928 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 4 Apr 2019 15:37:35 +0200 Subject: ma pkgs.bento4: rip (upstreamed) init-host: put into configs to still be able to push to NUR --- makefu/2configs/tools/init-host/default.nix | 47 +++++++++++++++++++++++++++++ makefu/5pkgs/bento4/default.nix | 29 ------------------ makefu/5pkgs/default.nix | 2 +- makefu/5pkgs/init-host/default.nix | 47 ----------------------------- 4 files changed, 48 insertions(+), 77 deletions(-) create mode 100644 makefu/2configs/tools/init-host/default.nix delete mode 100644 makefu/5pkgs/bento4/default.nix delete mode 100644 makefu/5pkgs/init-host/default.nix diff --git a/makefu/2configs/tools/init-host/default.nix b/makefu/2configs/tools/init-host/default.nix new file mode 100644 index 000000000..d1d3f7195 --- /dev/null +++ b/makefu/2configs/tools/init-host/default.nix @@ -0,0 +1,47 @@ +{ pkgs }: +pkgs.writeDashBin "generate-secrets" '' + set -euf + HOSTNAME="''${1?must provide hostname}" + TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d) + PASSWORD=$(${pkgs.pwgen}/bin/pwgen 25 1) + HASHED_PASSWORD=$(echo $PASSWORD | ${pkgs.hashPassword}/bin/hashPassword -s) > /dev/null + + ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f $TMPDIR/ssh.id_ed25519 -P "" -C "" >/dev/null + ${pkgs.openssl}/bin/openssl genrsa -out $TMPDIR/retiolum.rsa_key.priv 4096 2>/dev/null > /dev/null + ${pkgs.openssl}/bin/openssl rsa -in $TMPDIR/retiolum.rsa_key.priv -pubout -out $TMPDIR/retiolum.rsa_key.pub 2>/dev/null > /dev/null + cat < $TMPDIR/hashedPasswords.nix + { + root = "$HASHED_PASSWORD"; + } + EOF + + cd $TMPDIR + for x in *; do + ${pkgs.coreutils}/bin/cat $x | secrets insert -m $HOSTNAME/$x > /dev/null + done + echo $PASSWORD | secrets insert -m $HOSTNAME/root > /dev/null + + cat <; + ssh.pubkey = "$(cat $TMPDIR/ssh.id_ed25519.pub)"; + }; + EOF + + rm -rf $TMPDIR +'' + diff --git a/makefu/5pkgs/bento4/default.nix b/makefu/5pkgs/bento4/default.nix deleted file mode 100644 index 6f5f1deba..000000000 --- a/makefu/5pkgs/bento4/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv, fetchFromGitHub -, cmake -}: -stdenv.mkDerivation rec { - name = "bento4-${version}"; - version = "1.5.1-624"; - - src = fetchFromGitHub { - owner = "axiomatic-systems"; - repo = "Bento4"; - rev = "v${version}"; - sha256 = "1cq6vhrq3n3lc1n454slbc66qdyqam2srxgdhfpyfxbq5c4y06nf"; - }; - - nativeBuildInputs = [ cmake ]; - installPhase = '' - mkdir -p $out/{lib,bin} - find -iname '*.so' -exec mv --target-directory="$out/lib" {} \; - find -maxdepth 1 -executable -type f -exec mv --target-directory="$out/bin" {} \; - ''; - - meta = with stdenv.lib; { - description = "Full-featured MP4 format and MPEG DASH library and tools"; - homepage = http://bento4.com; - license = licenses.gpl3; - maintainers = with maintainers; [ makefu ]; - platforms = with platforms; linux; - }; -} diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index 8ae41427c..1ae10459f 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -1,4 +1,4 @@ -self: super: +self: super: with super.lib; with builtins; let # This callPackage will try to detect obsolete overrides. callPackage = path: args: let diff --git a/makefu/5pkgs/init-host/default.nix b/makefu/5pkgs/init-host/default.nix deleted file mode 100644 index d1d3f7195..000000000 --- a/makefu/5pkgs/init-host/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ pkgs }: -pkgs.writeDashBin "generate-secrets" '' - set -euf - HOSTNAME="''${1?must provide hostname}" - TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d) - PASSWORD=$(${pkgs.pwgen}/bin/pwgen 25 1) - HASHED_PASSWORD=$(echo $PASSWORD | ${pkgs.hashPassword}/bin/hashPassword -s) > /dev/null - - ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f $TMPDIR/ssh.id_ed25519 -P "" -C "" >/dev/null - ${pkgs.openssl}/bin/openssl genrsa -out $TMPDIR/retiolum.rsa_key.priv 4096 2>/dev/null > /dev/null - ${pkgs.openssl}/bin/openssl rsa -in $TMPDIR/retiolum.rsa_key.priv -pubout -out $TMPDIR/retiolum.rsa_key.pub 2>/dev/null > /dev/null - cat < $TMPDIR/hashedPasswords.nix - { - root = "$HASHED_PASSWORD"; - } - EOF - - cd $TMPDIR - for x in *; do - ${pkgs.coreutils}/bin/cat $x | secrets insert -m $HOSTNAME/$x > /dev/null - done - echo $PASSWORD | secrets insert -m $HOSTNAME/root > /dev/null - - cat <; - ssh.pubkey = "$(cat $TMPDIR/ssh.id_ed25519.pub)"; - }; - EOF - - rm -rf $TMPDIR -'' - -- cgit v1.2.3