allow customizing ageBin

This commit is contained in:
Chuang Zhu 2021-12-06 07:08:18 +08:00
parent 52ea2f8c32
commit c2f6bd077c
No known key found for this signature in database
GPG key ID: C564F033729E65FD
2 changed files with 14 additions and 6 deletions

View file

@ -10,7 +10,7 @@ let
if lib.versionOlder pkgs.rage.version "0.5.0"
then pkgs.callPackage ../pkgs/rage.nix { }
else pkgs.rage;
ageBin = "${rage}/bin/rage";
ageBin = config.age.ageBin;
users = config.users.users;
@ -96,6 +96,13 @@ let
in
{
options.age = {
ageBin = mkOption {
type = types.str;
default = "${rage}/bin/rage";
description = ''
The age executable to use.
'';
};
secrets = mkOption {
type = types.attrsOf secretType;
default = { };

View file

@ -8,13 +8,14 @@
nix,
mktemp,
diffutils,
ageBin ? "${
# we need at least rage 0.5.0 to support ssh keys
if rage.version < "0.5.0"
then callPackage ./rage.nix {}
else rage
}/bin/rage"
} :
let
# we need at least rage 0.5.0 to support ssh keys
rageToUse = if rage.version < "0.5.0"
then callPackage ./rage.nix {}
else rage;
ageBin = "${rageToUse}/bin/rage";
sedBin = "${gnused}/bin/sed";
nixInstantiate = "${nix}/bin/nix-instantiate";
mktempBin = "${mktemp}/bin/mktemp";