From 8a1b029672ae04fc836cdfc468452c4e5615eefb Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Sun, 22 Jun 2025 08:52:39 -0500 Subject: [PATCH] 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 --- pkgs/development/misc/resholve/README.md | 92 +++++++++++-------- .../misc/resholve/resholve-utils.nix | 11 ++- pkgs/development/misc/resholve/source.nix | 4 +- pkgs/development/misc/resholve/test.nix | 3 +- 4 files changed, 67 insertions(+), 43 deletions(-) diff --git a/pkgs/development/misc/resholve/README.md b/pkgs/development/misc/resholve/README.md index 3d8ae6d966f3..4b317460b208 100644 --- a/pkgs/development/misc/resholve/README.md +++ b/pkgs/development/misc/resholve/README.md @@ -41,25 +41,20 @@ Here's a simple example of how `resholve.mkDerivation` is already used in nixpkg ```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" ]; }; diff --git a/pkgs/development/misc/resholve/resholve-utils.nix b/pkgs/development/misc/resholve/resholve-utils.nix index f024d04e0c2c..761e231babd6 100644 --- a/pkgs/development/misc/resholve/resholve-utils.nix +++ b/pkgs/development/misc/resholve/resholve-utils.nix @@ -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 = diff --git a/pkgs/development/misc/resholve/source.nix b/pkgs/development/misc/resholve/source.nix index 670010c83562..d3a10f305231 100644 --- a/pkgs/development/misc/resholve/source.nix +++ b/pkgs/development/misc/resholve/source.nix @@ -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="; }; } diff --git a/pkgs/development/misc/resholve/test.nix b/pkgs/development/misc/resholve/test.nix index a3a7d3a81244..73c2042415d7 100644 --- a/pkgs/development/misc/resholve/test.nix +++ b/pkgs/development/misc/resholve/test.nix @@ -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;