resholve: 0.10.5 -> 0.10.6

Also:
- use nixfmt style for examples in README.md
- drop passthru consumer test for ix removed in #397949

Changed files
+67 -43
pkgs
development
+55 -37
pkgs/development/misc/resholve/README.md
···
<!-- TODO: figure out how to pull this externally? -->
```nix
-
{ lib
-
, fetchFromGitHub
-
, resholve
-
, bash
-
, coreutils
-
, goss
-
, which
}:
resholve.mkDerivation rec {
pname = "dgoss";
-
version = "0.4.2";
-
-
src = fetchFromGitHub {
-
owner = "goss-org";
-
repo = "goss";
-
rev = "refs/tags/v${version}";
-
hash = "sha256-FDn1OETkYIpMenk8QAAHvfNZcSzqGl5xrD0fAZPVmRM=";
-
};
dontConfigure = true;
dontBuild = true;
···
default = {
scripts = [ "bin/dgoss" ];
interpreter = "${bash}/bin/bash";
-
inputs = [ coreutils which ];
keep = {
"$CONTAINER_RUNTIME" = true;
};
};
};
-
meta = with lib; {
homepage = "https://github.com/goss-org/goss/blob/v${version}/extras/dgoss/README.md";
changelog = "https://github.com/goss-org/goss/releases/tag/v${version}";
description = "Convenience wrapper around goss that aims to bring the simplicity of goss to docker containers";
-
license = licenses.asl20;
-
platforms = platforms.linux;
-
maintainers = with maintainers; [ hyzual anthonyroussel ];
mainProgram = "dgoss";
};
}
···
```nix
{
-
resholvedScript = resholve.writeScript "name" {
-
inputs = [ file ];
-
interpreter = "${bash}/bin/bash";
-
} ''
-
echo "Hello"
-
file .
-
'';
-
resholvedScriptBin = resholve.writeScriptBin "name" {
-
inputs = [ file ];
-
interpreter = "${bash}/bin/bash";
-
} ''
-
echo "Hello"
-
file .
-
'';
}
```
···
trivial for now. If you have a real usage that you find helpful, please PR it.
```nix
-
{ stdenv, resholve, module1 }:
stdenv.mkDerivation {
# pname = "testmod3";
···
interpreter = "${bash}/bin/bash";
inputs = [ module1 ];
fake = {
-
external = [ "jq" "openssl" ];
};
}}
'';
···
fake = {
# fake accepts the initial of valid identifier types as a CLI convenience.
# Use full names in the Nix API.
-
function = [ "setUp" "tearDown" ];
builtin = [ "setopt" ];
source = [ "/etc/bashrc" ];
};
···
<!-- TODO: figure out how to pull this externally? -->
```nix
+
{
+
bash,
+
coreutils,
+
gnused,
+
goss,
+
lib,
+
resholve,
+
which,
}:
resholve.mkDerivation rec {
pname = "dgoss";
+
version = goss.version;
+
src = goss.src;
dontConfigure = true;
dontBuild = true;
···
default = {
scripts = [ "bin/dgoss" ];
interpreter = "${bash}/bin/bash";
+
inputs = [
+
coreutils
+
gnused
+
which
+
];
keep = {
"$CONTAINER_RUNTIME" = true;
};
};
};
+
meta = {
homepage = "https://github.com/goss-org/goss/blob/v${version}/extras/dgoss/README.md";
changelog = "https://github.com/goss-org/goss/releases/tag/v${version}";
description = "Convenience wrapper around goss that aims to bring the simplicity of goss to docker containers";
+
license = lib.licenses.asl20;
+
platforms = lib.platforms.linux;
+
maintainers = with lib.maintainers; [
+
hyzual
+
anthonyroussel
+
];
mainProgram = "dgoss";
};
}
···
```nix
{
+
resholvedScript =
+
resholve.writeScript "name"
+
{
+
inputs = [ file ];
+
interpreter = "${bash}/bin/bash";
+
}
+
''
+
echo "Hello"
+
file .
+
'';
+
resholvedScriptBin =
+
resholve.writeScriptBin "name"
+
{
+
inputs = [ file ];
+
interpreter = "${bash}/bin/bash";
+
}
+
''
+
echo "Hello"
+
file .
+
'';
}
```
···
trivial for now. If you have a real usage that you find helpful, please PR it.
```nix
+
{
+
stdenv,
+
resholve,
+
module1,
+
}:
stdenv.mkDerivation {
# pname = "testmod3";
···
interpreter = "${bash}/bin/bash";
inputs = [ module1 ];
fake = {
+
external = [
+
"jq"
+
"openssl"
+
];
};
}}
'';
···
fake = {
# fake accepts the initial of valid identifier types as a CLI convenience.
# Use full names in the Nix API.
+
function = [
+
"setUp"
+
"tearDown"
+
];
builtin = [ "setopt" ];
source = [ "/etc/bashrc" ];
};
+9 -2
pkgs/development/misc/resholve/resholve-utils.nix
···
else if builtins.isList val then
"${name}:${semicolons (map lib.escapeShellArg val)}"
else
-
nope [ solution env name ] "unexpected type: ${builtins.typeOf val}";
# Build fake/fix/keep directives from Nix types
phraseDirectives =
···
else if builtins.isAttrs val then
spaces (phraseDirectives solution env val)
else
-
nope [ solution env ] "unexpected type: ${builtins.typeOf val}";
# Shell-format each env value
shellEnv =
···
else if builtins.isList val then
"${name}:${semicolons (map lib.escapeShellArg val)}"
else
+
nope [
+
solution
+
env
+
name
+
] "unexpected type: ${builtins.typeOf val}";
# Build fake/fix/keep directives from Nix types
phraseDirectives =
···
else if builtins.isAttrs val then
spaces (phraseDirectives solution env val)
else
+
nope [
+
solution
+
env
+
] "unexpected type: ${builtins.typeOf val}";
# Shell-format each env value
shellEnv =
+2 -2
pkgs/development/misc/resholve/source.nix
···
}:
rec {
-
version = "0.10.5";
rSrc = fetchFromGitHub {
owner = "abathur";
repo = "resholve";
rev = "v${version}";
-
hash = "sha256-SzJbA0wLeSwvXnAE4bTNqh0tnpFPkn6N1hp7sZGAkB4=";
};
}
···
}:
rec {
+
version = "0.10.6";
rSrc = fetchFromGitHub {
owner = "abathur";
repo = "resholve";
rev = "v${version}";
+
hash = "sha256-iJEkfW60QO4nFp+ib2+DeDRsZviYFhWRQoBw1VAhzJY=";
};
}
+1 -2
pkgs/development/misc/resholve/test.nix
···
bashup-events32,
dgoss,
git-ftp,
-
ix,
lesspipe,
locate-dominating-file,
mons,
···
rlwrap
gnutar
bc
];
in
rec {
···
inherit bashup-events32;
inherit bats;
inherit git-ftp;
-
inherit ix;
inherit lesspipe;
inherit locate-dominating-file;
inherit mons;
···
bashup-events32,
dgoss,
git-ftp,
lesspipe,
locate-dominating-file,
mons,
···
rlwrap
gnutar
bc
+
msmtp
];
in
rec {
···
inherit bashup-events32;
inherit bats;
inherit git-ftp;
inherit lesspipe;
inherit locate-dominating-file;
inherit mons;