Add a generic fetch_git script.
New applications:
pal duplicity duply pdftk googler jrnl apg newsboat vcsh xmr-stak urlwatch pass
src = fetchFromGitHub json.github;
};
+ fetchedGit = path:
+ let
+ json = lib.importJSON path;
+ in rec {
+ version = json.tag;
+ name = "${json.meta.name}-${version}";
+ src = fetchgit json.git;
+ };
+
ledger = (nixpkgs.ledger.override { boost = boost166; }).overrideAttrs (oldAttrs:
fetchedGithub ./fetched/ledger.json // {
postInstall = "";
configureFlags = oldAttrs.configureFlags ++ [ "--with-slrnpull" ];
});
- ldapvi = nixpkgs.ldapvi.overrideAttrs (oldAttrs: rec {
- name = "ldapvi-${version}";
- version = "f1d42ba-master";
- src = fetchgit (lib.importJSON ./ldapvi.json);
- });
+ ldapvi = nixpkgs.ldapvi.overrideAttrs (oldAttrs: fetchedGit ./fetched/ldapvi.json);
+
+ nixos = import ./nixos_tools.nix {};
+
+ pass = nixpkgs.pass.overrideAttrs (oldAttrs:
+ fetchedGit ./fetched/pass.json // {
+ patches = oldAttrs.patches ++ [ ./patches/pass-fix-pass-init.patch ];
+ }
+ );
#weechat = callPackage nixpkgs.weechat { guileSupport = false; luaSupport = false; rubySupport = false; tclSupport = false; };
in
inherit slrn;
inherit sc-im;
inherit ldapvi;
+ inherit pal;
+ inherit duplicity duply;
+ inherit pdftk;
+ inherit googler;
+ inherit jrnl;
+ inherit apg;
+ inherit newsboat;
+ inherit vcsh;
+ inherit xmr-stak;
+ inherit urlwatch;
+ inherit pass;
+ #inherit nixos;
}
usage() {
echo "$0 file.json"
- echo "$0 [-n|--name name] [-b|--branch branch] [-h|--help] (-u|--url) url"
+ echo "$0 [-n|--name name] [-b|--branch branch] [-f|--file out_file] [-h|--help] (-u|--url) url"
exit
}
name="$(echo "$content" | jq -r ".meta.name")"
url="$(echo "$content" | jq -r ".meta.url")"
branch="$(echo "$content" | jq -r ".meta.branch")"
+ break
;;
-n|--name)
name=$1
branch=$1
shift
;;
+ -f|--file)
+ file=$1
+ shift
+ ;;
-h|--help)
usage
;;
tag=${rev:0:7}-$branch
}
-fetch_github 2>/dev/null
+function fetch_other () {
+ rev="$(git ls-remote --refs $url refs/heads/$branch | head -n1 | cut -f1)"
+ sha="$(nix-prefetch-git --url $url --rev refs/heads/$branch | jq -r '.sha256')"
+ tag=${rev:0:7}-$branch
+}
-owner=$(echo "$url" | cut -d"/" -f4)
-repo=$(echo "$url" | cut -d"/" -f5)
+case "$url" in
+ https://*github.com/*)
+ fetch_github 2>/dev/null
+ owner=$(echo "$url" | cut -d"/" -f4)
+ repo=$(echo "$url" | cut -d"/" -f5)
-F='{
- "tag": $tag,
- "meta": {
- "name": $name,
- "url": $url,
- "branch": $branch
- },
- "github": {
- "owner": $owner,
- "repo": $repo,
- "rev": $rev,
- "sha256": $sha,
- "fetchSubmodules": true
- }
-}'
+ F='{
+ "tag": $tag,
+ "meta": {
+ "name": $name,
+ "url": $url,
+ "branch": $branch
+ },
+ "github": {
+ "owner": $owner,
+ "repo": $repo,
+ "rev": $rev,
+ "sha256": $sha,
+ "fetchSubmodules": true
+ }
+ }'
+ ;;
+ *)
+ fetch_other 2>/dev/null
+ F='{
+ "tag": $tag,
+ "meta": {
+ "name": $name,
+ "url": $url,
+ "branch": $branch
+ },
+ "git": {
+ "url": $url,
+ "rev": $rev,
+ "sha256": $sha,
+ "fetchSubmodules": true
+ }
+ }'
+ ;;
+esac
jq -n \
--arg name "$name" \
--- /dev/null
+{
+ "tag": "f1d42ba-master",
+ "meta": {
+ "name": "ldapvi",
+ "url": "http://www.lichteblau.com/git/ldapvi.git",
+ "branch": "master"
+ },
+ "git": {
+ "url": "http://www.lichteblau.com/git/ldapvi.git",
+ "rev": "f1d42bad66cc4623d1ff21fbd5dddbf5009d3e40",
+ "sha256": "0c2h4b1spp9z6a16gy9azf0wyxq397yy7001x1zlvc7c60q11wry",
+ "fetchSubmodules": true
+ }
+}
--- /dev/null
+{
+ "tag": "d29a389-master",
+ "meta": {
+ "name": "password-store",
+ "url": "https://git.zx2c4.com/password-store/",
+ "branch": "master"
+ },
+ "git": {
+ "url": "https://git.zx2c4.com/password-store/",
+ "rev": "d29a389a40524c684595f51bb937f66958bc14ea",
+ "sha256": "17g43i0if9nggcq6005iyxxy9my8s15ihc2nzwjgqzhy3svh5xvn",
+ "fetchSubmodules": true
+ }
+}
+++ /dev/null
-{
- "url": "http://www.lichteblau.com/git/ldapvi.git",
- "rev": "f1d42bad66cc4623d1ff21fbd5dddbf5009d3e40",
- "sha256": "0c2h4b1spp9z6a16gy9azf0wyxq397yy7001x1zlvc7c60q11wry",
- "fetchSubmodules": false
-}
--- /dev/null
+_:
+with import <nixpkgs/nixos> { configuration = {}; };
+with config.system.build;
+ [ nixos-generate-config nixos-install nixos-enter manual.manpages ]
--- /dev/null
+From 33e8f1cd0065639a948d7b5ba3f93d43bdf7f3be Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= <ismael.bouya@normalesup.org>
+Date: Sun, 11 Nov 2018 19:47:33 +0100
+Subject: [PATCH] Fix pass init for some gpg keys
+
+This fixes the pass init for gpg keys which have their main key as
+encryption key. This may happen for instance with RSA keys and specific
+configuration.
+---
+ src/password-store.sh | 2 +-
+ tests/t0300-reencryption.sh | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/password-store.sh b/src/password-store.sh
+index d89d455..44d122e 100755
+--- a/src/password-store.sh
++++ b/src/password-store.sh
+@@ -124,7 +124,7 @@ reencrypt_path() {
+ IFS=";" eval 'GPG_RECIPIENTS+=( $group )' # http://unix.stackexchange.com/a/92190
+ unset "GPG_RECIPIENTS[$index]"
+ done
+- gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/^sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)"
++ gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/^[ps]ub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)"
+ fi
+ current_keys="$(LC_ALL=C $GPG $PASSWORD_STORE_GPG_OPTS -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$passfile" 2>&1 | sed -n 's/^gpg: public key is \([A-F0-9]\+\)$/\1/p' | LC_ALL=C sort -u)"
+
+diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh
+index 3c88987..57d873f 100755
+--- a/tests/t0300-reencryption.sh
++++ b/tests/t0300-reencryption.sh
+@@ -7,7 +7,7 @@ cd "$(dirname "$0")"
+ INITIAL_PASSWORD="will this password live? a big question indeed..."
+
+ canonicalize_gpg_keys() {
+- $GPG --list-keys --with-colons "$@" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u
++ $GPG --list-keys --with-colons "$@" | sed -n 's/[ps]ub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u
+ }
+ gpg_keys_from_encrypted_file() {
+ $GPG -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$1" 2>&1 | grep "public key is" | cut -d ' ' -f 5 | LC_ALL=C sort -u
+--
+2.19.1
+