-# When installed as a channel, this is not an environment.
-#
-# This file exists to stop getAllExprs() in nix/src/nix-env/nix-env.cc from recursing around in here and getting confused.
+{ pkgs ? import <nixpkgs> { }, }:
-{}
+pkgs.lib.makeScope pkgs.newScope (self:
+ with self; {
+
+ homeless-gpg = callPackage ./pkgs/homeless-gpg.nix { };
+
+ keyed-gpg = callPackage ./pkgs/keyed-gpg.nix { };
+
+ })
{ config, lib, pkgs, ... }:
with lib;
let
+ local-pkgs = import ../. { inherit pkgs; };
cfg = config.system.autoUpgradeWithPinch;
pull-repo-script = pkgs.writeShellScript "pull-repo" ''
set -eo pipefail
if [[ "$(prop requireSignature)" == true ]]; then
${pkgs.polite-merge}/bin/polite-merge \
- -c gpg.program=${escapeShellArg (pkgs.keyedgpg cfg.signingKeys)} \
+ -c gpg.program=${escapeShellArg (local-pkgs.keyed-gpg cfg.signingKeys)} \
merge --ff-only --verify-signatures
else
${pkgs.polite-merge}/bin/polite-merge merge --ff-only
'';
nixpkgs.overlays = [
- (import ../overlays/keyedgpg.nix)
(import ../overlays/pinch.nix)
(import ../overlays/polite-merge.nix)
(self: super: {
+++ /dev/null
-# Following the instructions at https://tribut.de/blog/git-commit-signatures-trusted-keys
-# Use with git with -c gpg.program='keyedgpg /path/to/keyfile.asc'
-
-self: super:
-let
- homelessGPG = super.writeShellScript "homeless-gpg" ''
- set -eo pipefail
-
- export GNUPGHOME=$(${self.coreutils}/bin/mktemp -d)
- trap '${self.coreutils}/bin/rm -r "$GNUPGHOME"' EXIT
- ${self.gnupg}/bin/gpg --no-default-keyring "$@"
- '';
-in {
- keyedgpg = keyfiles: super.writeShellScript "keyed-gpg" ''
- set -eo pipefail
-
- keyring=$(${self.coreutils}/bin/mktemp)
- cleanup() { ${self.coreutils}/bin/rm "$keyring"; }
- trap cleanup EXIT
- ${homelessGPG} --keyring="$keyring" --import ${self.lib.escapeShellArgs keyfiles}
-
- trusted_key_args=()
- while read keyid;do
- trusted_key_args+=( --trusted-key "$keyid" )
- done < <(
- ${homelessGPG} --with-colons --show-keys ${self.lib.escapeShellArgs keyfiles} |
- ${self.gawk}/bin/awk -F: '$1 == "pub" { print $5 }')
-
- ${homelessGPG} --keyring="$keyring" "''${trusted_key_args[@]}" "$@"
- '';
-}
--- /dev/null
+{ coreutils, gnupg, writeShellScript }:
+writeShellScript "homeless-gpg" ''
+ set -eo pipefail
+
+ export GNUPGHOME=$(${coreutils}/bin/mktemp -d)
+ trap '${coreutils}/bin/rm -r "$GNUPGHOME"' EXIT
+ ${gnupg}/bin/gpg --no-default-keyring "$@"
+''
--- /dev/null
+# Following the instructions at https://tribut.de/blog/git-commit-signatures-trusted-keys
+# Use with git with -c gpg.program='keyedgpg /path/to/keyfile.asc'
+
+{ coreutils, gawk, homeless-gpg, lib, writeShellScript, }:
+keyfiles:
+writeShellScript "keyed-gpg" ''
+ set -eo pipefail
+
+ keyring=$(${coreutils}/bin/mktemp)
+ cleanup() { ${coreutils}/bin/rm "$keyring"; }
+ trap cleanup EXIT
+ ${homeless-gpg} --keyring="$keyring" --import ${lib.escapeShellArgs keyfiles}
+
+ trusted_key_args=()
+ while read keyid;do
+ trusted_key_args+=( --trusted-key "$keyid" )
+ done < <(
+ ${homeless-gpg} --with-colons --show-keys ${lib.escapeShellArgs keyfiles} |
+ ${gawk}/bin/awk -F: '$1 == "pub" { print $5 }')
+
+ ${homeless-gpg} --keyring="$keyring" "''${trusted_key_args[@]}" "$@"
+''
+