···45 </listitem>
46 <listitem>
47 <para>
00000000048 Postgresql for NixOS service now defaults to v11.
49 </para>
50 </listitem>
···45 </listitem>
46 <listitem>
47 <para>
48+ Grub is updated to 2.04, adding support for booting from F2FS filesystems and
49+ Btrfs volumes using zstd compression. Note that some users have been unable
50+to boot after upgrading to 2.04 - for more information, please see <link
51+xlink:href="https://github.com/NixOS/nixpkgs/issues/61718#issuecomment-617618503">this
52+ discussion</link>.
53+ </para>
54+ </listitem>
55+ <listitem>
56+ <para>
57 Postgresql for NixOS service now defaults to v11.
58 </para>
59 </listitem>
···58 # "libgcc_s.so.1 must be installed for pthread_cancel to work".
5960 # don't have "libgcc_s.so.1" on darwin
61- LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
06263 configureFlags = [ "--with-libreadline-prefix=${readline.dev}" ]
64 ++ stdenv.lib.optionals stdenv.isSunOS [
···58 # "libgcc_s.so.1 must be installed for pthread_cancel to work".
5960 # don't have "libgcc_s.so.1" on darwin
61+ LDFLAGS = stdenv.lib.optionalString
62+ (!stdenv.isDarwin && !stdenv.hostPlatform.isStatic) "-lgcc_s";
6364 configureFlags = [ "--with-libreadline-prefix=${readline.dev}" ]
65 ++ stdenv.lib.optionals stdenv.isSunOS [
+6
pkgs/development/interpreters/wasmer/default.nix
···2223 nativeBuildInputs = [ cmake pkg-config ];
2400000025 LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
2627 meta = with lib; {
···2223 nativeBuildInputs = [ cmake pkg-config ];
2425+ # Since wasmer 0.17 no backends are enabled by default. Backends are now detected
26+ # using the [makefile](https://github.com/wasmerio/wasmer/blob/master/Makefile).
27+ # Enabling cranelift as this used to be the old default. At least one backend is
28+ # needed for the run subcommand to work.
29+ cargoBuildFlags = [ "--features 'backend-cranelift'" ];
30+31 LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
3233 meta = with lib; {
+26
pkgs/development/libraries/bashup-events/3.2.nix
···00000000000000000000000000
···1+{ callPackage, fetchFromGitHub }:
2+3+callPackage ./generic.nix {
4+ variant = "3.2";
5+ version = "2019-07-27";
6+ branch = "master";
7+ src = fetchFromGitHub {
8+ owner = "bashup";
9+ repo = "events";
10+ rev = "83744c21bf720afb8325343674c62ab46a8f3d94";
11+ hash = "sha256-0VDjd+1T1JBmSDGovWOOecUZmNztlwG32UcstfdigbI=";
12+ };
13+ fake = {
14+ # Note: __ev.encode is actually defined, but it happens in a
15+ # quoted arg to eval, which resholve currently doesn't (and may
16+ # never) parse into. See abathur/resholve/issues/2.
17+ function = [ "__ev.encode" ];
18+ };
19+ keep = {
20+ # allow vars in eval
21+ eval = [ "e" "f" "q" "r" ];
22+ # allow vars executed as commands
23+ "$f" = true;
24+ "$n" = true;
25+ };
26+}
···67> Fair warning: resholve does *not* aspire to resolving all valid Shell
8> scripts. It depends on the OSH/Oil parser, which aims to support most (but
9-> not all) Bash, and aims to be a ~90% sort of solution.
1011-Let's start with a simple example from one of my own projects:
00000000000000000001213```nix
14{ stdenv, lib, resholvePackage, fetchFromGitHub, bashup-events44, bashInteractive_5, doCheck ? true, shellcheck }:
···22 };
2324 solutions = {
0025 profile = {
26- # the only *required* arguments
000027 scripts = [ "bin/shellswain.bash" ];
0028 interpreter = "none";
0029 inputs = [ bashup-events44 ];
30 };
31 };
···39}
40```
4142-I'll focus on the `solutions` attribute, since this is the only part
43-that differs from other derivations.
44-45-Each "solution" (k=v pair)
46-describes one resholve invocation. For most shell packages, one
47-invocation will probably be enough. resholve will make you be very
48-explicit about your script's dependencies, and it may also need your
49-help sorting out some references or problems that it can't safely
50-handle on its own.
5152-If you have more than one script, and your scripts need conflicting
53-directives, you can specify more than one solution to resolve the
54-scripts separately, but still produce a single package.
5556-Let's take a closer look:
00000000005758-```nix
59- solutions = {
60- # each solution has a short name; this is what you'd use to
61- # override the settings of this solution, and it may also show up
62- # in (some) error messages.
63- profile = {
64- # specify one or more $out-relative script paths (unlike many
65- # builders, resholve will modify the output files during fixup
66- # to correctly resolve scripts that source within the package)
67- scripts = [ "bin/shellswain.bash" ];
68- # "none" for no shebang, "${bash}/bin/bash" for bash, etc.
69- interpreter = "none";
70- # packages resholve should resolve executables from
71- inputs = [ bashup-events44 ];
72- };
73- };
74-```
7576-resholve has a (growing) number of options for handling more complex
77-scripts. I won't cover these in excruciating detail here. You can find
78-more information about these in `man resholve` via `nixpkgs.resholve`.
0000000000000000007980-Instead, we'll look at the general form of the solutions attrset:
08182-```nix
83-solutions = {
84- shortname = {
85- # required
86- # $out-relative paths to try resolving
87- scripts = [ "bin/shunit2" ];
88- # packages to resolve executables from
89- inputs = [ coreutils gnused gnugrep findutils ];
90- # path for shebang, or 'none' to omit shebang
91- interpreter = "${bash}/bin/bash";
9293- # optional
94- fake = { fake directives };
95- fix = { fix directives };
96- keep = { keep directives };
97- # file to inject before first code-line of script
98- prologue = file;
99- # file to inject after last code-line of script
100- epilogue = file;
101- # extra command-line flags passed to resholve; generally this API
102- # should align with what resholve supports, but flags may help if
103- # you need to override the version of resholve.
104- flags = [ ];
105- };
106-};
107-```
108109-The main way you'll adjust how resholve handles your scripts are the
110-fake, fix, and keep directives. The manpage covers their purpose and
111-how to format them on the command-line, so I'll focus on how you'll
112-need to translate them into Nix types.
113114```nix
115# --fake 'f:setUp;tearDown builtin:setopt source:/etc/bashrc'
116fake = {
117- function = [ "setUp" "tearDown" ];
118- builtin = [ "setopt" ];
119- source = [ "/etc/bashrc" ];
00120};
121122# --fix 'aliases xargs:ls $GIT:gix'
123fix = {
124- # all single-word directives use `true` as value
125- aliases = true;
126- xargs = [ "ls" ];
127- "$GIT" = [ "gix" ];
128};
129130# --keep 'which:git;ls .:$HOME $LS:exa /etc/bashrc ~/.bashrc'
131keep = {
132- which = [ "git" "ls" ];
133- "." = [ "$HOME" ];
134- "$LS" = [ "exa" ];
135- "/etc/bashrc" = true;
136- "~/.bashrc" = true;
137};
138```
···67> Fair warning: resholve does *not* aspire to resolving all valid Shell
8> scripts. It depends on the OSH/Oil parser, which aims to support most (but
9+> not all) Bash. resholve aims to be a ~90% sort of solution.
1011+## API Concepts
12+13+The main difference between `resholvePackage` and other builder functions
14+is the `solutions` attrset, which describes which scripts to resolve and how.
15+Each "solution" (k=v pair) in this attrset describes one resholve invocation.
16+17+> NOTE: For most shell packages, one invocation will probably be enough:
18+> - Packages with a single script will only need one solution.
19+> - Packages with multiple scripts can still use one solution if the scripts
20+> don't require conflicting directives.
21+> - Packages with scripts that require conflicting directives can use multiple
22+> solutions to resolve the scripts separately, but produce a single package.
23+24+## Basic Example
25+26+Here's a simple example from one of my own projects, with annotations:
27+<!--
28+TODO: ideally this will use a nixpkgs example; but we don't have any IN yet
29+and the first package PR (bashup-events) is too complex for this context.
30+-->
3132```nix
33{ stdenv, lib, resholvePackage, fetchFromGitHub, bashup-events44, bashInteractive_5, doCheck ? true, shellcheck }:
···41 };
4243 solutions = {
44+ # Give each solution a short name. This is what you'd use to
45+ # override its settings, and it shows in (some) error messages.
46 profile = {
47+ # the only *required* arguments are the 3 below
48+49+ # Specify 1 or more $out-relative script paths. Unlike many
50+ # builders, resholvePackage modifies the output files during
51+ # fixup (to correctly resolve in-package sourcing).
52 scripts = [ "bin/shellswain.bash" ];
53+54+ # "none" for no shebang, "${bash}/bin/bash" for bash, etc.
55 interpreter = "none";
56+57+ # packages resholve should resolve executables from
58 inputs = [ bashup-events44 ];
59 };
60 };
···68}
69```
7071+## Options
000000007273+`resholvePackage` maps Nix types/idioms into the flags and environment variables
74+that the `resholve` CLI expects. Here's an overview:
07576+| Option | Type | Containing |
77+| ------------- | ------- | ----------------------------------------------------- |
78+| scripts | list | $out-relative string paths to resolve |
79+| inputs | list | packages to resolve executables from |
80+| interpreter | string | 'none' or abspath for shebang |
81+| prologue | file | text to insert before the first code-line |
82+| epilogue | file | text to isnert after the last code-line |
83+| flags | list | strings to pass as flags |
84+| fake | attrset | [directives](#controlling-resolution-with-directives) |
85+| fix | attrset | [directives](#controlling-resolution-with-directives) |
86+| keep | attrset | [directives](#controlling-resolution-with-directives) |
8788+## Controlling resolution with directives
00000000000000008990+In order to resolve a script, resholve will make you disambiguate how it should
91+handle any potential problems it encounters with directives. There are currently
92+3 types:
93+1. `fake` directives tell resholve to pretend it knows about an identifier
94+ such as a function, builtin, external command, etc. if there's a good reason
95+ it doesn't already know about it. Common examples:
96+ - builtins for a non-bash shell
97+ - loadable builtins
98+ - platform-specific external commands in cross-platform conditionals
99+2. `fix` directives give resholve permission to fix something that it can't
100+ safely fix automatically. Common examples:
101+ - resolving commands in aliases (this is appropriate for standalone scripts
102+ that use aliases non-interactively--but it would prevent profile/rc
103+ scripts from using the latest current-system symlinks.)
104+ - resolve commands in a variable definition
105+ - resolve an absolute command path from inputs as if it were a bare reference
106+3. `keep` directives tell resholve not to raise an error (i.e., ignore)
107+ something it would usually object to. Common examples:
108+ - variables used as/within the first word of a command
109+ - pre-existing absolute or user-relative (~) command paths
110+ - dynamic (variable) arguments to commands known to accept/run other commands
111112+> NOTE: resholve has a (growing) number of directives detailed in `man resholve`
113+> via `nixpkgs.resholve`.
114115+Each of these 3 types is represented by its own attrset, where you can think
116+of the key as a scope. The value should be:
117+- `true` for any directives that the resholve CLI accepts as a single word
118+- a list of strings for all other options
119+<!--
120+TODO: these should be fully-documented here, but I'm already maintaining
121+more copies of their specification/behavior than I like, and continuing to
122+add more at this early date will only ensure that I spend more time updating
123+docs and less time filling in feature gaps.
0124125+Full documentation may be greatly accellerated if someone can help me sort out
126+single-sourcing. See: https://github.com/abathur/resholve/issues/19
127+-->
000000000000128129+This will hopefully make more sense when you see it. Here are CLI examples
130+from the manpage, and the Nix equivalents:
00131132```nix
133# --fake 'f:setUp;tearDown builtin:setopt source:/etc/bashrc'
134fake = {
135+ # fake accepts the initial of valid identifier types as a CLI convienience.
136+ # Use full names in the Nix API.
137+ function = [ "setUp" "tearDown" ];
138+ builtin = [ "setopt" ];
139+ source = [ "/etc/bashrc" ];
140};
141142# --fix 'aliases xargs:ls $GIT:gix'
143fix = {
144+ # all single-word directives use `true` as value
145+ aliases = true;
146+ xargs = [ "ls" ];
147+ "$GIT" = [ "gix" ];
148};
149150# --keep 'which:git;ls .:$HOME $LS:exa /etc/bashrc ~/.bashrc'
151keep = {
152+ which = [ "git" "ls" ];
153+ "." = [ "$HOME" ];
154+ "$LS" = [ "exa" ];
155+ "/etc/bashrc" = true;
156+ "~/.bashrc" = true;
157};
158```