···6869`mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `fetchMixDeps` and passed to it.
7071-#### mixRelease - Elixir Phoenix example {#mixrelease---elixir-phoenix-example}
00000000000000000000000000000000000000000000000000000000000000000000000000007273-Here is how your `default.nix` file would look.
007475```nix
76with import <nixpkgs> { };
7778let
079 packages = beam.packagesWith beam.interpreters.erlang;
000080 src = builtins.fetchgit {
81 url = "ssh://git@github.com/your_id/your_repo";
82 rev = "replace_with_your_commit";
83 };
8485- pname = "your_project";
86- version = "0.0.1";
87- mixEnv = "prod";
88-89 mixFodDeps = packages.fetchMixDeps {
90 pname = "mix-deps-${pname}";
91- inherit src mixEnv version;
92 # nix will complain and tell you the right value to replace this with
93 sha256 = lib.fakeSha256;
94 # if you have build time environment variables add them here
···9798 nodeDependencies = (pkgs.callPackage ./assets/default.nix { }).shell.nodeDependencies;
99100- frontEndFiles = stdenvNoCC.mkDerivation {
101- pname = "frontend-${pname}";
102-103- nativeBuildInputs = [ nodejs ];
104-105- inherit version src;
106-107- buildPhase = ''
108- cp -r ./assets $TEMPDIR
109-110- mkdir -p $TEMPDIR/assets/node_modules/.cache
111- cp -r ${nodeDependencies}/lib/node_modules $TEMPDIR/assets
112- export PATH="${nodeDependencies}/bin:$PATH"
113-114- cd $TEMPDIR/assets
115- webpack --config ./webpack.config.js
116- cd ..
117- '';
118-119- installPhase = ''
120- cp -r ./priv/static $out/
121- '';
122-123- outputHashAlgo = "sha256";
124- outputHashMode = "recursive";
125- # nix will complain and tell you the right value to replace this with
126- outputHash = lib.fakeSha256;
127-128- impureEnvVars = lib.fetchers.proxyImpureEnvVars;
129- };
130-131-132in packages.mixRelease {
133- inherit src pname version mixEnv mixFodDeps;
134 # if you have build time environment variables add them here
135 MY_ENV_VAR="my_value";
136- preInstall = ''
137- mkdir -p ./priv/static
138- cp -r ${frontEndFiles} ./priv/static
000000139 '';
140}
141```
···165 systemd.services.${release_name} = {
166 wantedBy = [ "multi-user.target" ];
167 after = [ "network.target" "postgresql.service" ];
00168 requires = [ "network-online.target" "postgresql.service" ];
169 description = "my app";
170 environment = {
···201 path = [ pkgs.bash ];
202 };
2030204 environment.systemPackages = [ release ];
205}
206```
···215{ pkgs ? import <nixpkgs> {} }:
216217with pkgs;
218-219let
220-221- elixir = beam.packages.erlangR22.elixir_1_9;
222-223in
224mkShell {
225 buildInputs = [ elixir ];
226-227- ERL_INCLUDE_PATH="${erlang}/lib/erlang/usr/include";
228}
229```
230···264 # TODO: not sure how to make hex available without installing it afterwards.
265 mix local.hex --if-missing
266 export LANG=en_US.UTF-8
0267 export ERL_AFLAGS="-kernel shell_history enabled"
268269 # postges related
···6869`mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `fetchMixDeps` and passed to it.
7071+#### mixRelease - Elixir Phoenix example {#mix-release-elixir-phoenix-example}
72+73+there are 3 steps, frontend dependencies (javascript), backend dependencies (elixir) and the final derivation that puts both of those together
74+75+##### mixRelease - Frontend dependencies (javascript) {#mix-release-javascript-deps}
76+77+for phoenix projects, inside of nixpkgs you can either use yarn2nix (mkYarnModule) or node2nix. An example with yarn2nix can be found [here](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix#L39). An example with node2nix will follow. To package something outside of nixpkgs, you have alternatives like [npmlock2nix](https://github.com/nix-community/npmlock2nix) or [nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage)
78+79+##### mixRelease - backend dependencies (mix) {#mix-release-mix-deps}
80+81+There are 2 ways to package backend dependencies. With mix2nix and with a fixed-output-derivation (FOD).
82+83+###### mix2nix {#mix2nix}
84+85+mix2nix is a cli tool available in nixpkgs. it will generate a nix expression from a mix.lock file. It is quite standard in the 2nix tool series.
86+87+Note that currently mix2nix can't handle git dependencies inside the mix.lock file. If you have git dependencies, you can either add them manually (see [example](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/pleroma/default.nix#L20)) or use the FOD method.
88+89+The advantage of using mix2nix is that nix will know your whole dependency graph. On a dependency update, this won't trigger a full rebuild and download of all the dependencies, where FOD will do so.
90+91+practical steps:
92+93+- run `mix2nix > mix_deps.nix` in the upstream repo.
94+- pass `mixNixDeps = with pkgs; import ./mix_deps.nix { inherit lib beamPackages; };` as an argument to mixRelease.
95+96+If there are git depencencies.
97+98+- You'll need to fix the version artificially in mix.exs and regenerate the mix.lock with fixed version (on upstream). This will enable you to run `mix2nix > mix_deps.nix`.
99+- From the mix_deps.nix file, remove the dependencies that had git versions and pass them as an override to the import function.
100+101+```nix
102+ mixNixDeps = import ./mix.nix {
103+ inherit beamPackages lib;
104+ overrides = (final: prev: {
105+ # mix2nix does not support git dependencies yet,
106+ # so we need to add them manually
107+ prometheus_ex = beamPackages.buildMix rec {
108+ name = "prometheus_ex";
109+ version = "3.0.5";
110+111+ # Change the argument src with the git src that you actually need
112+ src = fetchFromGitLab {
113+ domain = "git.pleroma.social";
114+ group = "pleroma";
115+ owner = "elixir-libraries";
116+ repo = "prometheus.ex";
117+ rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5";
118+ sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk";
119+ };
120+ # you can re-use the same beamDeps argument as generated
121+ beamDeps = with final; [ prometheus ];
122+ };
123+ });
124+};
125+```
126+127+You will need to run the build process once to fix the sha256 to correspond to your new git src.
128+129+###### FOD {#fixed-output-derivation}
130+131+A fixed output derivation will download mix dependencies from the internet. To ensure reproducibility, a hash will be supplied. Note that mix is relatively reproducible. An FOD generating a different hash on each run hasn't been observed (as opposed to npm where the chances are relatively high). See [elixir_ls](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/beam-modules/elixir_ls.nix) for a usage example of FOD.
132+133+Practical steps
134+135+- start with the following argument to mixRelease
136+137+```nix
138+ mixFodDeps = fetchMixDeps {
139+ pname = "mix-deps-${pname}";
140+ inherit src version;
141+ sha256 = lib.fakeSha256;
142+ };
143+```
144+145+The first build will complain about the sha256 value, you can replace with the suggested value after that.
146+147+Note that if after you've replaced the value, nix suggests another sha256, then mix is not fetching the dependencies reproducibly. An FOD will not work in that case and you will have to use mix2nix.
148149+##### mixRelease - example {#mix-release-example}
150+151+Here is how your `default.nix` file would look for a phoenix project.
152153```nix
154with import <nixpkgs> { };
155156let
157+ # beam.interpreters.erlangR23 is available if you need a particular version
158 packages = beam.packagesWith beam.interpreters.erlang;
159+160+ pname = "your_project";
161+ version = "0.0.1";
162+163 src = builtins.fetchgit {
164 url = "ssh://git@github.com/your_id/your_repo";
165 rev = "replace_with_your_commit";
166 };
167168+ # if using mix2nix you can use the mixNixDeps attribute
000169 mixFodDeps = packages.fetchMixDeps {
170 pname = "mix-deps-${pname}";
171+ inherit src version;
172 # nix will complain and tell you the right value to replace this with
173 sha256 = lib.fakeSha256;
174 # if you have build time environment variables add them here
···177178 nodeDependencies = (pkgs.callPackage ./assets/default.nix { }).shell.nodeDependencies;
17900000000000000000000000000000000180in packages.mixRelease {
181+ inherit src pname version mixFodDeps;
182 # if you have build time environment variables add them here
183 MY_ENV_VAR="my_value";
184+185+ postBuild = ''
186+ ln -sf ${nodeDependencies}/lib/node_modules assets/node_modules
187+ npm run deploy --prefix ./assets
188+189+ # for external task you need a workaround for the no deps check flag
190+ # https://github.com/phoenixframework/phoenix/issues/2690
191+ mix do deps.loadpaths --no-deps-check, phx.digest
192+ mix phx.digest --no-deps-check
193 '';
194}
195```
···219 systemd.services.${release_name} = {
220 wantedBy = [ "multi-user.target" ];
221 after = [ "network.target" "postgresql.service" ];
222+ # note that if you are connecting to a postgres instance on a different host
223+ # postgresql.service should not be included in the requires.
224 requires = [ "network-online.target" "postgresql.service" ];
225 description = "my app";
226 environment = {
···257 path = [ pkgs.bash ];
258 };
259260+ # in case you have migration scripts or you want to use a remote shell
261 environment.systemPackages = [ release ];
262}
263```
···272{ pkgs ? import <nixpkgs> {} }:
273274with pkgs;
0275let
276+ elixir = beam.packages.erlangR24.elixir_1_12;
00277in
278mkShell {
279 buildInputs = [ elixir ];
00280}
281```
282···316 # TODO: not sure how to make hex available without installing it afterwards.
317 mix local.hex --if-missing
318 export LANG=en_US.UTF-8
319+ # keep your shell history in iex
320 export ERL_AFLAGS="-kernel shell_history enabled"
321322 # postges related
···22 </listitem>
23 <listitem>
24 <para>
25- kOps now defaults to 1.21.0, which uses containerd as the
26 default runtime.
27 </para>
28 </listitem>
···22 </listitem>
23 <listitem>
24 <para>
25+ kOps now defaults to 1.21.1, which uses containerd as the
26 default runtime.
27 </para>
28 </listitem>
+2-1
nixos/doc/manual/release-notes/rl-2111.section.md
···7## Highlights {#sec-release-21.11-highlights}
89- PHP now defaults to PHP 8.0, updated from 7.4.
10-- kOps now defaults to 1.21.0, which uses containerd as the default runtime.
01112- `python3` now defaults to Python 3.9, updated from Python 3.8.
13
···7## Highlights {#sec-release-21.11-highlights}
89- PHP now defaults to PHP 8.0, updated from 7.4.
10+11+- kOps now defaults to 1.21.1, which uses containerd as the default runtime.
1213- `python3` now defaults to Python 3.9, updated from Python 3.8.
14
···84</para>
8586 </section>
87- <section xml:id="module-services-nextcloud-pitfalls-during-upgrade">
88- <title>Pitfalls</title>
8990- <para>
91- Unfortunately Nextcloud appears to be very stateful when it comes to
92- managing its own configuration. The config file lives in the home directory
93- of the <literal>nextcloud</literal> user (by default
94- <literal>/var/lib/nextcloud/config/config.php</literal>) and is also used to
95- track several states of the application (e.g. whether installed or not).
96- </para>
97-98- <para>
99- All configuration parameters are also stored in
100- <literal>/var/lib/nextcloud/config/override.config.php</literal> which is generated by
101- the module and linked from the store to ensure that all values from <literal>config.php</literal>
102- can be modified by the module.
103- However <literal>config.php</literal> manages the application's state and shouldn't be touched
104- manually because of that.
105- </para>
106-107- <warning>
108- <para>Don't delete <literal>config.php</literal>! This file
109- tracks the application's state and a deletion can cause unwanted
110- side-effects!</para>
111- </warning>
112-113- <warning>
114- <para>Don't rerun <literal>nextcloud-occ
115- maintenance:install</literal>! This command tries to install the application
116- and can cause unwanted side-effects!</para>
117- </warning>
118119- <para>
120- Nextcloud doesn't allow to move more than one major-version forward. If you're e.g. on
121- <literal>v16</literal>, you cannot upgrade to <literal>v18</literal>, you need to upgrade to
122- <literal>v17</literal> first. This is ensured automatically as long as the
123- <link linkend="opt-system.stateVersion">stateVersion</link> is declared properly. In that case
124- the oldest version available (one major behind the one from the previous NixOS
125- release) will be selected by default and the module will generate a warning that reminds
126- the user to upgrade to latest Nextcloud <emphasis>after</emphasis> that deploy.
127- </para>
0000000000000000000000000000000000000000000000000128 </section>
129130 <section xml:id="module-services-nextcloud-httpd">
···84</para>
8586 </section>
008788+ <section xml:id="module-services-nextcloud-pitfalls-during-upgrade">
89+ <title>Common problems</title>
90+ <itemizedlist>
91+ <listitem>
92+ <formalpara>
93+ <title>General notes</title>
94+ <para>
95+ Unfortunately Nextcloud appears to be very stateful when it comes to
96+ managing its own configuration. The config file lives in the home directory
97+ of the <literal>nextcloud</literal> user (by default
98+ <literal>/var/lib/nextcloud/config/config.php</literal>) and is also used to
99+ track several states of the application (e.g., whether installed or not).
100+ </para>
101+ </formalpara>
102+ <para>
103+ All configuration parameters are also stored in
104+ <filename>/var/lib/nextcloud/config/override.config.php</filename> which is generated by
105+ the module and linked from the store to ensure that all values from
106+ <filename>config.php</filename> can be modified by the module.
107+ However <filename>config.php</filename> manages the application's state and shouldn't be
108+ touched manually because of that.
109+ </para>
110+ <warning>
111+ <para>Don't delete <filename>config.php</filename>! This file
112+ tracks the application's state and a deletion can cause unwanted
113+ side-effects!</para>
114+ </warning>
0115116+ <warning>
117+ <para>Don't rerun <literal>nextcloud-occ
118+ maintenance:install</literal>! This command tries to install the application
119+ and can cause unwanted side-effects!</para>
120+ </warning>
121+ </listitem>
122+ <listitem>
123+ <formalpara>
124+ <title>Multiple version upgrades</title>
125+ <para>
126+ Nextcloud doesn't allow to move more than one major-version forward. E.g., if you're on
127+ <literal>v16</literal>, you cannot upgrade to <literal>v18</literal>, you need to upgrade to
128+ <literal>v17</literal> first. This is ensured automatically as long as the
129+ <link linkend="opt-system.stateVersion">stateVersion</link> is declared properly. In that case
130+ the oldest version available (one major behind the one from the previous NixOS
131+ release) will be selected by default and the module will generate a warning that reminds
132+ the user to upgrade to latest Nextcloud <emphasis>after</emphasis> that deploy.
133+ </para>
134+ </formalpara>
135+ </listitem>
136+ <listitem>
137+ <formalpara>
138+ <title><literal>Error: Command "upgrade" is not defined.</literal></title>
139+ <para>
140+ This error usually occurs if the initial installation
141+ (<command>nextcloud-occ maintenance:install</command>) has failed. After that, the application
142+ is not installed, but the upgrade is attempted to be executed. Further context can
143+ be found in <link xlink:href="https://github.com/NixOS/nixpkgs/issues/111175">NixOS/nixpkgs#111175</link>.
144+ </para>
145+ </formalpara>
146+ <para>
147+ First of all, it makes sense to find out what went wrong by looking at the logs
148+ of the installation via <command>journalctl -u nextcloud-setup</command> and try to fix
149+ the underlying issue.
150+ </para>
151+ <itemizedlist>
152+ <listitem>
153+ <para>
154+ If this occurs on an <emphasis>existing</emphasis> setup, this is most likely because
155+ the maintenance mode is active. It can be deactivated by running
156+ <command>nextcloud-occ maintenance:mode --off</command>. It's advisable though to
157+ check the logs first on why the maintenance mode was activated.
158+ </para>
159+ </listitem>
160+ <listitem>
161+ <warning><para>Only perform the following measures on
162+ <emphasis>freshly installed instances!</emphasis></para></warning>
163+ <para>
164+ A re-run of the installer can be forced by <emphasis>deleting</emphasis>
165+ <filename>/var/lib/nextcloud/config/config.php</filename>. This is the only time
166+ advisable because the fresh install doesn't have any state that can be lost.
167+ In case that doesn't help, an entire re-creation can be forced via
168+ <command>rm -rf ~nextcloud/</command>.
169+ </para>
170+ </listitem>
171+ </itemizedlist>
172+ </listitem>
173+ </itemizedlist>
174 </section>
175176 <section xml:id="module-services-nextcloud-httpd">
···4, curl, Cocoa, Foundation, libobjc, libcxx, tzdata
5, withRecommendedPackages ? true
6, enableStrictBarrier ? false
07# R as of writing does not support outputting both .so and .a files; it outputs:
8# --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
9, static ? false
···56 --with-libtiff
57 --with-ICU
58 ${lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
059 ${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
60 AR=$(type -p ar)
61 AWK=$(type -p gawk)
···4, curl, Cocoa, Foundation, libobjc, libcxx, tzdata
5, withRecommendedPackages ? true
6, enableStrictBarrier ? false
7+, enableMemoryProfiling ? false
8# R as of writing does not support outputting both .so and .a files; it outputs:
9# --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
10, static ? false
···57 --with-libtiff
58 --with-ICU
59 ${lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
60+ ${lib.optionalString enableMemoryProfiling "--enable-memory-profiling"}
61 ${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
62 AR=$(type -p ar)
63 AWK=$(type -p gawk)
+36-6
pkgs/applications/science/math/sage/sage-src.nix
···13 # Fetch a diff between `base` and `rev` on sage's git server.
14 # Used to fetch trac tickets by setting the `base` to the last release and the
15 # `rev` to the last commit of the ticket.
16- fetchSageDiff = { base, name, rev, sha256, ...}@args: (
17 fetchpatch ({
18 inherit name sha256;
1920- # We used to use
21- # "https://git.sagemath.org/sage.git/patch?id2=${base}&id=${rev}"
22- # but the former way does not squash multiple patches together.
23- url = "https://github.com/sagemath/sage/compare/${base}...${rev}.diff";
00000000000000000000002425 # We don't care about sage's own build system (which builds all its dependencies).
26 # Exclude build system changes to avoid conflicts.
27 excludes = [ "build/*" ];
28- } // builtins.removeAttrs args [ "rev" "base" "sha256" ])
29 );
30in
31stdenv.mkDerivation rec {
···80 # now set the cache dir to be within the .sage directory. This is not
81 # strictly necessary, but keeps us from littering in the user's HOME.
82 ./patches/sympow-cache.patch
0000000083 ];
8485 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
···13 # Fetch a diff between `base` and `rev` on sage's git server.
14 # Used to fetch trac tickets by setting the `base` to the last release and the
15 # `rev` to the last commit of the ticket.
16+ fetchSageDiff = { base, name, rev, sha256, squashed ? false, ...}@args: (
17 fetchpatch ({
18 inherit name sha256;
1920+ # There are three places to get changes from:
21+ #
22+ # 1) From Sage's Trac. Contains all release tags (like "9.4") and all developer
23+ # branches (wip patches from tickets), but exports each commit as a separate
24+ # patch, so merge commits can lead to conflicts. Used if squashed == false.
25+ #
26+ # 2) From GitHub's sagemath/sage repo. This lets us use a GH feature that allows
27+ # us to choose between a .patch file, with one patch per commit, or a .diff file,
28+ # which squashes all commits into a single diff. This is used if squashed ==
29+ # true. This repo has all release tags. However, it has no developer branches, so
30+ # this option can't be used if a change wasn't yet shipped in a (possibly beta)
31+ # release.
32+ #
33+ # 3) From GitHub's sagemath/sagetrac-mirror repo. Mirrors all developer branches,
34+ # but has no release tags. The only use case not covered by 1 or 2 is when we need
35+ # to apply a patch from an open ticket that contains merge commits.
36+ #
37+ # Item 3 could cover all use cases if the sagemath/sagetrack-mirror repo had
38+ # release tags, but it requires a sha instead of a release number in "base", which
39+ # is inconvenient.
40+ urls = if squashed
41+ then [
42+ "https://github.com/sagemath/sage/compare/${base}...${rev}.diff"
43+ "https://github.com/sagemath/sagetrac-mirror/compare/${base}...${rev}.diff"
44+ ]
45+ else [ "https://git.sagemath.org/sage.git/patch?id2=${base}&id=${rev}" ];
4647 # We don't care about sage's own build system (which builds all its dependencies).
48 # Exclude build system changes to avoid conflicts.
49 excludes = [ "build/*" ];
50+ } // builtins.removeAttrs args [ "rev" "base" "sha256" "squashed" ])
51 );
52in
53stdenv.mkDerivation rec {
···102 # now set the cache dir to be within the .sage directory. This is not
103 # strictly necessary, but keeps us from littering in the user's HOME.
104 ./patches/sympow-cache.patch
105+106+ # https://trac.sagemath.org/ticket/32305
107+ (fetchSageDiff {
108+ base = "9.4";
109+ name = "networkx-2.6-upgrade.patch";
110+ rev = "9808325853ba9eb035115e5b056305a1c9d362a0";
111+ sha256 = "sha256-gJSqycCtbAVr5qnVEbHFUvIuTOvaxFIeffpzd6nH4DE=";
112+ })
113 ];
114115 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
···7}:
89{
10-name ? "${attrs.pname}-${attrs.version}"
11-12, version
1314# by default prefix `name` e.g. "lua5.2-${name}"
···60# The two above arguments have access to builder variables -- e.g. to $out
6162# relative to srcRoot, path to the rockspec to use when using rocks
63-, rockspecFilename ? "../*.rockspec"
006465# must be set for packages that don't have a rock
66, knownRockspec ? null
···71# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
7273let
00074 # TODO fix warnings "Couldn't load rockspec for ..." during manifest
75 # construction -- from initial investigation, appears it will require
76 # upstream luarocks changes to fix cleanly (during manifest construction,
···144toLuaModule ( lua.stdenv.mkDerivation (
145builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // {
146147- name = namePrefix + name;
148149 buildInputs = [ wrapLua lua.pkgs.luarocks ]
150 ++ buildInputs
···159 # @-patterns do not capture formal argument default values, so we need to
160 # explicitly inherit this for it to be available as a shell variable in the
161 # builder
162- inherit rockspecFilename;
163 inherit rocksSubdir;
164165- # enabled only for src.rock
166- setSourceRoot= let
167- name_only= lib.getName name;
168- in
169- lib.optionalString (knownRockspec == null) ''
170- # format is rockspec_basename/source_basename
171- # rockspec can set it via spec.source.dir
172- folder=$(find . -mindepth 2 -maxdepth 2 -type d -path '*${name_only}*/*'|head -n1)
173- sourceRoot="$folder"
174- '';
175-176 configurePhase = ''
177 runHook preConfigure
178···180 ${luarocks_content}
181 EOF
182 export LUAROCKS_CONFIG="$PWD/${luarocks_config}";
000183 ''
184 + lib.optionalString (knownRockspec != null) ''
185···192 runHook postConfigure
193 '';
1940195 buildPhase = ''
196 runHook preBuild
197
···7}:
89{
10+pname
011, version
1213# by default prefix `name` e.g. "lua5.2-${name}"
···59# The two above arguments have access to builder variables -- e.g. to $out
6061# relative to srcRoot, path to the rockspec to use when using rocks
62+, rockspecFilename ? null
63+# relative to srcRoot, path to folder that contains the expected rockspec
64+, rockspecDir ? "."
6566# must be set for packages that don't have a rock
67, knownRockspec ? null
···72# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
7374let
75+ generatedRockspecFilename = "${rockspecDir}/${pname}-${version}.rockspec";
76+77+78 # TODO fix warnings "Couldn't load rockspec for ..." during manifest
79 # construction -- from initial investigation, appears it will require
80 # upstream luarocks changes to fix cleanly (during manifest construction,
···148toLuaModule ( lua.stdenv.mkDerivation (
149builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // {
150151+ name = namePrefix + pname + "-" + version;
152153 buildInputs = [ wrapLua lua.pkgs.luarocks ]
154 ++ buildInputs
···163 # @-patterns do not capture formal argument default values, so we need to
164 # explicitly inherit this for it to be available as a shell variable in the
165 # builder
0166 inherit rocksSubdir;
16700000000000168 configurePhase = ''
169 runHook preConfigure
170···172 ${luarocks_content}
173 EOF
174 export LUAROCKS_CONFIG="$PWD/${luarocks_config}";
175+ ''
176+ + lib.optionalString (rockspecFilename == null) ''
177+ rockspecFilename="${generatedRockspecFilename}"
178 ''
179 + lib.optionalString (knownRockspec != null) ''
180···187 runHook postConfigure
188 '';
189190+ # TODO could be moved to configurePhase
191 buildPhase = ''
192 runHook preBuild
193
···121 sha256 = "0gfvvbri9kyzhvq3bvdbj2l6mwvlz040dk4mrd5m9gz79f7w109c";
122 })
123 ];
124+125+ # there is only a rockspec.in in the repo, the actual rockspec must be generated
126+ preConfigure = ''
127+ make rock
128+ '';
129 });
130131 lrexlib-gnu = super.lrexlib-gnu.override({
···144 buildInputs = [
145 pkgs.glibc.dev
146 ];
0000147 });
148149 lua-iconv = super.lua-iconv.override({
···349 '';
350 });
351352+ std-_debug = super.std-_debug.overrideAttrs(oa: {
353+ # run make to generate lib/std/_debug/version.lua
354+ preConfigure = ''
355+ make all
356+ '';
357+ });
358+359+ std-normalize = super.std-normalize.overrideAttrs(oa: {
360+ # run make to generate lib/std/_debug/version.lua
361+ preConfigure = ''
362+ make all
363+ '';
364+ });
365366 # aliases
367 cjson = super.lua-cjson;
···17 # Create the module.
18 echo "Building linux driver against kernel: $kernel";
19 cd kernel
20- sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source)
21- sysOut=$(echo $kernel/lib/modules/$kernelVersion/build)
22 unset src # used by the nv makefile
23- make IGNORE_PREEMPT_RT_PRESENCE=1 NV_BUILD_SUPPORTS_HMM=1 SYSSRC=$sysSrc SYSOUT=$sysOut module -j$NIX_BUILD_CORES
2425 cd ..
26 fi
···17 # Create the module.
18 echo "Building linux driver against kernel: $kernel";
19 cd kernel
0020 unset src # used by the nv makefile
21+ make $makeFlags -j $NIX_BUILD_CORES module
2223 cd ..
24 fi
+4-4
pkgs/os-specific/linux/nvidia-x11/default.nix
···19 # Policy: use the highest stable version as the default (on our master).
20 stable = if stdenv.hostPlatform.system == "x86_64-linux"
21 then generic {
22- version = "470.57.02";
23- sha256_64bit = "sha256-VdeuEEgn+qeel1Mh/itg+d1C+/9lZCBTRDwOVv20xH0=";
24- settingsSha256 = "sha256-DJg5QbyuKJmPpLQVYgTLvucI1e9YgQOO16690VXIWvk=";
25- persistencedSha256 = "sha256-Cqv6oUFnsSi3S1sjplJKeq9bI2pqgBXPPb11HOJSlDo=";
26 }
27 else legacy_390;
28
···19 # Policy: use the highest stable version as the default (on our master).
20 stable = if stdenv.hostPlatform.system == "x86_64-linux"
21 then generic {
22+ version = "470.63.01";
23+ sha256_64bit = "sha256:057dsc0j3136r5gc08id3rwz9c0x7i01xkcwfk77vqic9b6486kg";
24+ settingsSha256 = "sha256:0lizp4hn49yvca2yd76yh3awld98pkaa35a067lpcld35vb5brgv";
25+ persistencedSha256 = "sha256:1f3gdpa23ipjy2xwf7qnxmw7w8xxhqy25rmcz34xkngjf4fn4pbs";
26 }
27 else legacy_390;
28
+7
pkgs/os-specific/linux/nvidia-x11/generic.nix
···75 kernel = if libsOnly then null else kernel.dev;
76 kernelVersion = if libsOnly then null else kernel.modDirVersion;
77000000078 hardeningDisable = [ "pic" "format" ];
7980 dontStrip = true;
···210211 zfsUnstable = common {
212 # check the release notes for compatible kernels
213- kernelCompatible = kernel.kernelAtLeast "3.10" && kernel.kernelOlder "5.14";
214 latestCompatibleLinuxPackages = linuxPackages_5_13;
215216 # this package should point to a version / git revision compatible with the latest kernel release
217- version = "2.1.0";
0218219- sha256 = "sha256-YdY4SStXZGBBdAHdM3R/unco7ztxI3s0/buPSNSeh5o=";
220221 isUnstable = true;
222 };
···210211 zfsUnstable = common {
212 # check the release notes for compatible kernels
213+ kernelCompatible = kernel.kernelAtLeast "3.10" && kernel.kernelOlder "5.15";
214 latestCompatibleLinuxPackages = linuxPackages_5_13;
215216 # this package should point to a version / git revision compatible with the latest kernel release
217+ version = "unstable-2021-08-30";
218+ rev = "3b89d9518df2c7fd747e349873a3d4d498beb20e";
219220+ sha256 = "sha256-wVbjpVrPQmhJmMqdGUf0IwlCIoOsT7Zfj5lxSKcOsgg=";
221222 isUnstable = true;
223 };
···2930 postPatch = ''
31 # No API changes.
32- substituteInPlace pyproject.toml --replace 'python-frontmatter = "^0.5.0"' 'python-frontmatter = "^1.0.0"'
00033 '';
3435 # No tests available on Pypi and there is only a failing version assertion test in the repo.
···2930 postPatch = ''
31 # No API changes.
32+ substituteInPlace pyproject.toml \
33+ --replace 'python-frontmatter = "^0.5.0"' 'python-frontmatter = "^1.0.0"' \
34+ --replace 'genanki = "^0.10.1"' 'genanki = "^0.11.0"' \
35+ --replace 'typer = "^0.3.2"' 'typer = "^0.4.0"'
36 '';
3738 # No tests available on Pypi and there is only a failing version assertion test in the repo.
···1-{ writeText, lib, stdenv, fetchurl, ncurses }:
0000023-let
4- version = "0.6.1";
5-in
6stdenv.mkDerivation rec {
7 pname = "bwm-ng";
8- inherit version;
910 src = fetchurl {
11 url = "https://www.gropp.org/bwm-ng/${pname}-${version}.tar.gz";
12- sha256 = "1w0dwpjjm9pqi613i8glxrgca3rdyqyp3xydzagzr5ndc34z6z02";
13 };
1415- buildInputs = [ ncurses ];
16-17- # gcc7 has some issues with inline functions
18- patches = [
19- (writeText "gcc7.patch"
20- ''
21- --- a/src/bwm-ng.c
22- +++ b/src/bwm-ng.c
23- @@ -27,5 +27,5 @@
24- /* handle interrupt signal */
25- void sigint(int sig) FUNCATTR_NORETURN;
26- -inline void init(void);
27- +static inline void init(void);
2829- /* clear stuff and exit */
30- --- a/src/options.c
31- +++ b/src/options.c
32- @@ -35,5 +35,5 @@
33- inline int str2output_type(char *optarg);
34- #endif
35- -inline int str2out_method(char *optarg);
36- +static inline int str2out_method(char *optarg);
37- inline int str2in_method(char *optarg);
38-39- '')
40 ];
4142-43- # This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline
44- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=gnu89";
45-46 meta = with lib; {
47 description = "A small and simple console-based live network and disk io bandwidth monitor";
48 homepage = "http://www.gropp.org/?id=projects&sub=bwm-ng";
49- license = licenses.gpl2;
50 platforms = platforms.unix;
51-52 longDescription = ''
53- Features
54-55- supports /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats /proc/partitions, IOKit, devstat and libstatgrab
56- unlimited number of interfaces/devices supported
57- interfaces/devices are added or removed dynamically from list
58- white-/blacklist of interfaces/devices
59- output of KB/s, Kb/s, packets, errors, average, max and total sum
60- output in curses, plain console, CSV or HTML
61- configfile
62-63- Short list of changes since 0.5 (for full list read changelog):
64-65- curses2 output, a nice bar chart
66- disk input for bsd/macosx/linux/solaris
67- win32 network bandwidth support
68- moved to autotools
69- alot fixes
70-71- Info
72- This was influenced by the old bwm util written by Barney (barney@freewill.tzo.com) which had some issues with faster interfaces and was very simple. Since i had almost all code done anyway for other projects, i decided to create my own version.
73-74- I actually don't know if netstat input is useful at all. I saw this elsewhere, so i added it. Its target is "netstat 1.42 (2001-04-15)" linux or Free/Open/netBSD. If there are other formats i would be happy to add them.
75-76- (from homepage)
77 '';
78 };
79}
···1+{ lib
2+, stdenv
3+, autoreconfHook
4+, fetchurl
5+, ncurses
6+}:
70008stdenv.mkDerivation rec {
9 pname = "bwm-ng";
10+ version = "0.6.3";
1112 src = fetchurl {
13 url = "https://www.gropp.org/bwm-ng/${pname}-${version}.tar.gz";
14+ sha256 = "0ikzyvnb73msm9n7ripg1dsw9av1i0c7q2hi2173xsj8zyv559f1";
15 };
1617+ nativeBuildInputs = [
18+ autoreconfHook
19+ ];
00000000002021+ buildInputs = [
22+ ncurses
00000000023 ];
24000025 meta = with lib; {
26 description = "A small and simple console-based live network and disk io bandwidth monitor";
27 homepage = "http://www.gropp.org/?id=projects&sub=bwm-ng";
28+ license = licenses.gpl2Plus;
29 platforms = platforms.unix;
30+ maintainers = with maintainers; [ ];
31 longDescription = ''
32+ bwm-ng supports:
33+ - /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats /proc/partitions, IOKit,
34+ devstat and libstatgrab
35+ - unlimited number of interfaces/devices
36+ - interfaces/devices are added or removed dynamically from list
37+ - white-/blacklist of interfaces/devices
38+ - output of KB/s, Kb/s, packets, errors, average, max and total sum
39+ - output in curses, plain console, CSV or HTML
000000000000000040 '';
41 };
42}
···15 # Utility functions, could just import but passing in for efficiency
16 lib
1718-, # Use to reevaluate Nixpkgs; a dirty hack that should be removed
19 nixpkgsFun
2021 ## Other parameters
···218 appendOverlays = extraOverlays:
219 if extraOverlays == []
220 then self
221- else import ./stage.nix (args // { overlays = args.overlays ++ extraOverlays; });
222223 # NOTE: each call to extend causes a full nixpkgs rebuild, adding ~130MB
224 # of allocations. DO NOT USE THIS IN NIXPKGS.
···15 # Utility functions, could just import but passing in for efficiency
16 lib
1718+, # Use to reevaluate Nixpkgs
19 nixpkgsFun
2021 ## Other parameters
···218 appendOverlays = extraOverlays:
219 if extraOverlays == []
220 then self
221+ else nixpkgsFun { overlays = args.overlays ++ extraOverlays; };
222223 # NOTE: each call to extend causes a full nixpkgs rebuild, adding ~130MB
224 # of allocations. DO NOT USE THIS IN NIXPKGS.