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
This commit is contained in:
Travis A. Everett
2025-06-22 08:58:20 -05:00
parent 39c0822892
commit 8a1b029672
4 changed files with 67 additions and 43 deletions
+55 -37
View File
@@ -41,25 +41,20 @@ Here's a simple example of how `resholve.mkDerivation` is already used in nixpkg
<!-- TODO: figure out how to pull this externally? -->
```nix
{ lib
, fetchFromGitHub
, resholve
, bash
, coreutils
, goss
, which
{
bash,
coreutils,
gnused,
goss,
lib,
resholve,
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=";
};
version = goss.version;
src = goss.src;
dontConfigure = true;
dontBuild = true;
@@ -73,20 +68,27 @@ resholve.mkDerivation rec {
default = {
scripts = [ "bin/dgoss" ];
interpreter = "${bash}/bin/bash";
inputs = [ coreutils which ];
inputs = [
coreutils
gnused
which
];
keep = {
"$CONTAINER_RUNTIME" = true;
};
};
};
meta = with lib; {
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 = licenses.asl20;
platforms = platforms.linux;
maintainers = with maintainers; [ hyzual anthonyroussel ];
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
hyzual
anthonyroussel
];
mainProgram = "dgoss";
};
}
@@ -101,20 +103,26 @@ trivial, so I'll also link to some real-world examples:
```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 .
'';
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 .
'';
}
```
@@ -125,7 +133,11 @@ This function has a similar API to `writeScript` and `writeScriptBin`, except it
trivial for now. If you have a real usage that you find helpful, please PR it.
```nix
{ stdenv, resholve, module1 }:
{
stdenv,
resholve,
module1,
}:
stdenv.mkDerivation {
# pname = "testmod3";
@@ -140,7 +152,10 @@ stdenv.mkDerivation {
interpreter = "${bash}/bin/bash";
inputs = [ module1 ];
fake = {
external = [ "jq" "openssl" ];
external = [
"jq"
"openssl"
];
};
}}
'';
@@ -220,7 +235,10 @@ from the manpage, and the Nix equivalents:
fake = {
# fake accepts the initial of valid identifier types as a CLI convenience.
# Use full names in the Nix API.
function = [ "setUp" "tearDown" ];
function = [
"setUp"
"tearDown"
];
builtin = [ "setopt" ];
source = [ "/etc/bashrc" ];
};
@@ -39,7 +39,11 @@ rec {
else if builtins.isList val then
"${name}:${semicolons (map lib.escapeShellArg val)}"
else
nope [ solution env name ] "unexpected type: ${builtins.typeOf val}";
nope [
solution
env
name
] "unexpected type: ${builtins.typeOf val}";
# Build fake/fix/keep directives from Nix types
phraseDirectives =
@@ -68,7 +72,10 @@ rec {
else if builtins.isAttrs val then
spaces (phraseDirectives solution env val)
else
nope [ solution env ] "unexpected type: ${builtins.typeOf val}";
nope [
solution
env
] "unexpected type: ${builtins.typeOf val}";
# Shell-format each env value
shellEnv =
+2 -2
View File
@@ -4,11 +4,11 @@
}:
rec {
version = "0.10.5";
version = "0.10.6";
rSrc = fetchFromGitHub {
owner = "abathur";
repo = "resholve";
rev = "v${version}";
hash = "sha256-SzJbA0wLeSwvXnAE4bTNqh0tnpFPkn6N1hp7sZGAkB4=";
hash = "sha256-iJEkfW60QO4nFp+ib2+DeDRsZviYFhWRQoBw1VAhzJY=";
};
}
+1 -2
View File
@@ -42,7 +42,6 @@
bashup-events32,
dgoss,
git-ftp,
ix,
lesspipe,
locate-dominating-file,
mons,
@@ -77,6 +76,7 @@ let
rlwrap
gnutar
bc
msmtp
];
in
rec {
@@ -326,7 +326,6 @@ rec {
inherit bashup-events32;
inherit bats;
inherit git-ftp;
inherit ix;
inherit lesspipe;
inherit locate-dominating-file;
inherit mons;