···68686969`mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `fetchMixDeps` and passed to it.
70707171-#### mixRelease - Elixir Phoenix example {#mixrelease---elixir-phoenix-example}
7171+#### mixRelease - Elixir Phoenix example {#mix-release-elixir-phoenix-example}
7272+7373+there are 3 steps, frontend dependencies (javascript), backend dependencies (elixir) and the final derivation that puts both of those together
7474+7575+##### mixRelease - Frontend dependencies (javascript) {#mix-release-javascript-deps}
7676+7777+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)
7878+7979+##### mixRelease - backend dependencies (mix) {#mix-release-mix-deps}
8080+8181+There are 2 ways to package backend dependencies. With mix2nix and with a fixed-output-derivation (FOD).
8282+8383+###### mix2nix {#mix2nix}
8484+8585+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.
8686+8787+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.
8888+8989+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.
9090+9191+practical steps:
9292+9393+- run `mix2nix > mix_deps.nix` in the upstream repo.
9494+- pass `mixNixDeps = with pkgs; import ./mix_deps.nix { inherit lib beamPackages; };` as an argument to mixRelease.
9595+9696+If there are git depencencies.
9797+9898+- 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`.
9999+- From the mix_deps.nix file, remove the dependencies that had git versions and pass them as an override to the import function.
100100+101101+```nix
102102+ mixNixDeps = import ./mix.nix {
103103+ inherit beamPackages lib;
104104+ overrides = (final: prev: {
105105+ # mix2nix does not support git dependencies yet,
106106+ # so we need to add them manually
107107+ prometheus_ex = beamPackages.buildMix rec {
108108+ name = "prometheus_ex";
109109+ version = "3.0.5";
110110+111111+ # Change the argument src with the git src that you actually need
112112+ src = fetchFromGitLab {
113113+ domain = "git.pleroma.social";
114114+ group = "pleroma";
115115+ owner = "elixir-libraries";
116116+ repo = "prometheus.ex";
117117+ rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5";
118118+ sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk";
119119+ };
120120+ # you can re-use the same beamDeps argument as generated
121121+ beamDeps = with final; [ prometheus ];
122122+ };
123123+ });
124124+};
125125+```
126126+127127+You will need to run the build process once to fix the sha256 to correspond to your new git src.
128128+129129+###### FOD {#fixed-output-derivation}
130130+131131+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.
132132+133133+Practical steps
134134+135135+- start with the following argument to mixRelease
136136+137137+```nix
138138+ mixFodDeps = fetchMixDeps {
139139+ pname = "mix-deps-${pname}";
140140+ inherit src version;
141141+ sha256 = lib.fakeSha256;
142142+ };
143143+```
144144+145145+The first build will complain about the sha256 value, you can replace with the suggested value after that.
146146+147147+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.
721487373-Here is how your `default.nix` file would look.
149149+##### mixRelease - example {#mix-release-example}
150150+151151+Here is how your `default.nix` file would look for a phoenix project.
7415275153```nix
76154with import <nixpkgs> { };
7715578156let
157157+ # beam.interpreters.erlangR23 is available if you need a particular version
79158 packages = beam.packagesWith beam.interpreters.erlang;
159159+160160+ pname = "your_project";
161161+ version = "0.0.1";
162162+80163 src = builtins.fetchgit {
81164 url = "ssh://git@github.com/your_id/your_repo";
82165 rev = "replace_with_your_commit";
83166 };
841678585- pname = "your_project";
8686- version = "0.0.1";
8787- mixEnv = "prod";
8888-168168+ # if using mix2nix you can use the mixNixDeps attribute
89169 mixFodDeps = packages.fetchMixDeps {
90170 pname = "mix-deps-${pname}";
9191- inherit src mixEnv version;
171171+ inherit src version;
92172 # nix will complain and tell you the right value to replace this with
93173 sha256 = lib.fakeSha256;
94174 # if you have build time environment variables add them here
···9717798178 nodeDependencies = (pkgs.callPackage ./assets/default.nix { }).shell.nodeDependencies;
99179100100- frontEndFiles = stdenvNoCC.mkDerivation {
101101- pname = "frontend-${pname}";
102102-103103- nativeBuildInputs = [ nodejs ];
104104-105105- inherit version src;
106106-107107- buildPhase = ''
108108- cp -r ./assets $TEMPDIR
109109-110110- mkdir -p $TEMPDIR/assets/node_modules/.cache
111111- cp -r ${nodeDependencies}/lib/node_modules $TEMPDIR/assets
112112- export PATH="${nodeDependencies}/bin:$PATH"
113113-114114- cd $TEMPDIR/assets
115115- webpack --config ./webpack.config.js
116116- cd ..
117117- '';
118118-119119- installPhase = ''
120120- cp -r ./priv/static $out/
121121- '';
122122-123123- outputHashAlgo = "sha256";
124124- outputHashMode = "recursive";
125125- # nix will complain and tell you the right value to replace this with
126126- outputHash = lib.fakeSha256;
127127-128128- impureEnvVars = lib.fetchers.proxyImpureEnvVars;
129129- };
130130-131131-132180in packages.mixRelease {
133133- inherit src pname version mixEnv mixFodDeps;
181181+ inherit src pname version mixFodDeps;
134182 # if you have build time environment variables add them here
135183 MY_ENV_VAR="my_value";
136136- preInstall = ''
137137- mkdir -p ./priv/static
138138- cp -r ${frontEndFiles} ./priv/static
184184+185185+ postBuild = ''
186186+ ln -sf ${nodeDependencies}/lib/node_modules assets/node_modules
187187+ npm run deploy --prefix ./assets
188188+189189+ # for external task you need a workaround for the no deps check flag
190190+ # https://github.com/phoenixframework/phoenix/issues/2690
191191+ mix do deps.loadpaths --no-deps-check, phx.digest
192192+ mix phx.digest --no-deps-check
139193 '';
140194}
141195```
···165219 systemd.services.${release_name} = {
166220 wantedBy = [ "multi-user.target" ];
167221 after = [ "network.target" "postgresql.service" ];
222222+ # note that if you are connecting to a postgres instance on a different host
223223+ # postgresql.service should not be included in the requires.
168224 requires = [ "network-online.target" "postgresql.service" ];
169225 description = "my app";
170226 environment = {
···201257 path = [ pkgs.bash ];
202258 };
203259260260+ # in case you have migration scripts or you want to use a remote shell
204261 environment.systemPackages = [ release ];
205262}
206263```
···215272{ pkgs ? import <nixpkgs> {} }:
216273217274with pkgs;
218218-219275let
220220-221221- elixir = beam.packages.erlangR22.elixir_1_9;
222222-276276+ elixir = beam.packages.erlangR24.elixir_1_12;
223277in
224278mkShell {
225279 buildInputs = [ elixir ];
226226-227227- ERL_INCLUDE_PATH="${erlang}/lib/erlang/usr/include";
228280}
229281```
230282···264316 # TODO: not sure how to make hex available without installing it afterwards.
265317 mix local.hex --if-missing
266318 export LANG=en_US.UTF-8
319319+ # keep your shell history in iex
267320 export ERL_AFLAGS="-kernel shell_history enabled"
268321269322 # postges related
···2222 </listitem>
2323 <listitem>
2424 <para>
2525- kOps now defaults to 1.21.0, which uses containerd as the
2525+ kOps now defaults to 1.21.1, which uses containerd as the
2626 default runtime.
2727 </para>
2828 </listitem>
+2-1
nixos/doc/manual/release-notes/rl-2111.section.md
···77## Highlights {#sec-release-21.11-highlights}
8899- PHP now defaults to PHP 8.0, updated from 7.4.
1010-- kOps now defaults to 1.21.0, which uses containerd as the default runtime.
1010+1111+- kOps now defaults to 1.21.1, which uses containerd as the default runtime.
11121213- `python3` now defaults to Python 3.9, updated from Python 3.8.
1314
···8484</para>
85858686 </section>
8787- <section xml:id="module-services-nextcloud-pitfalls-during-upgrade">
8888- <title>Pitfalls</title>
89879090- <para>
9191- Unfortunately Nextcloud appears to be very stateful when it comes to
9292- managing its own configuration. The config file lives in the home directory
9393- of the <literal>nextcloud</literal> user (by default
9494- <literal>/var/lib/nextcloud/config/config.php</literal>) and is also used to
9595- track several states of the application (e.g. whether installed or not).
9696- </para>
9797-9898- <para>
9999- All configuration parameters are also stored in
100100- <literal>/var/lib/nextcloud/config/override.config.php</literal> which is generated by
101101- the module and linked from the store to ensure that all values from <literal>config.php</literal>
102102- can be modified by the module.
103103- However <literal>config.php</literal> manages the application's state and shouldn't be touched
104104- manually because of that.
105105- </para>
106106-107107- <warning>
108108- <para>Don't delete <literal>config.php</literal>! This file
109109- tracks the application's state and a deletion can cause unwanted
110110- side-effects!</para>
111111- </warning>
112112-113113- <warning>
114114- <para>Don't rerun <literal>nextcloud-occ
115115- maintenance:install</literal>! This command tries to install the application
116116- and can cause unwanted side-effects!</para>
117117- </warning>
8888+ <section xml:id="module-services-nextcloud-pitfalls-during-upgrade">
8989+ <title>Common problems</title>
9090+ <itemizedlist>
9191+ <listitem>
9292+ <formalpara>
9393+ <title>General notes</title>
9494+ <para>
9595+ Unfortunately Nextcloud appears to be very stateful when it comes to
9696+ managing its own configuration. The config file lives in the home directory
9797+ of the <literal>nextcloud</literal> user (by default
9898+ <literal>/var/lib/nextcloud/config/config.php</literal>) and is also used to
9999+ track several states of the application (e.g., whether installed or not).
100100+ </para>
101101+ </formalpara>
102102+ <para>
103103+ All configuration parameters are also stored in
104104+ <filename>/var/lib/nextcloud/config/override.config.php</filename> which is generated by
105105+ the module and linked from the store to ensure that all values from
106106+ <filename>config.php</filename> can be modified by the module.
107107+ However <filename>config.php</filename> manages the application's state and shouldn't be
108108+ touched manually because of that.
109109+ </para>
110110+ <warning>
111111+ <para>Don't delete <filename>config.php</filename>! This file
112112+ tracks the application's state and a deletion can cause unwanted
113113+ side-effects!</para>
114114+ </warning>
118115119119- <para>
120120- Nextcloud doesn't allow to move more than one major-version forward. If you're e.g. on
121121- <literal>v16</literal>, you cannot upgrade to <literal>v18</literal>, you need to upgrade to
122122- <literal>v17</literal> first. This is ensured automatically as long as the
123123- <link linkend="opt-system.stateVersion">stateVersion</link> is declared properly. In that case
124124- the oldest version available (one major behind the one from the previous NixOS
125125- release) will be selected by default and the module will generate a warning that reminds
126126- the user to upgrade to latest Nextcloud <emphasis>after</emphasis> that deploy.
127127- </para>
116116+ <warning>
117117+ <para>Don't rerun <literal>nextcloud-occ
118118+ maintenance:install</literal>! This command tries to install the application
119119+ and can cause unwanted side-effects!</para>
120120+ </warning>
121121+ </listitem>
122122+ <listitem>
123123+ <formalpara>
124124+ <title>Multiple version upgrades</title>
125125+ <para>
126126+ Nextcloud doesn't allow to move more than one major-version forward. E.g., if you're on
127127+ <literal>v16</literal>, you cannot upgrade to <literal>v18</literal>, you need to upgrade to
128128+ <literal>v17</literal> first. This is ensured automatically as long as the
129129+ <link linkend="opt-system.stateVersion">stateVersion</link> is declared properly. In that case
130130+ the oldest version available (one major behind the one from the previous NixOS
131131+ release) will be selected by default and the module will generate a warning that reminds
132132+ the user to upgrade to latest Nextcloud <emphasis>after</emphasis> that deploy.
133133+ </para>
134134+ </formalpara>
135135+ </listitem>
136136+ <listitem>
137137+ <formalpara>
138138+ <title><literal>Error: Command "upgrade" is not defined.</literal></title>
139139+ <para>
140140+ This error usually occurs if the initial installation
141141+ (<command>nextcloud-occ maintenance:install</command>) has failed. After that, the application
142142+ is not installed, but the upgrade is attempted to be executed. Further context can
143143+ be found in <link xlink:href="https://github.com/NixOS/nixpkgs/issues/111175">NixOS/nixpkgs#111175</link>.
144144+ </para>
145145+ </formalpara>
146146+ <para>
147147+ First of all, it makes sense to find out what went wrong by looking at the logs
148148+ of the installation via <command>journalctl -u nextcloud-setup</command> and try to fix
149149+ the underlying issue.
150150+ </para>
151151+ <itemizedlist>
152152+ <listitem>
153153+ <para>
154154+ If this occurs on an <emphasis>existing</emphasis> setup, this is most likely because
155155+ the maintenance mode is active. It can be deactivated by running
156156+ <command>nextcloud-occ maintenance:mode --off</command>. It's advisable though to
157157+ check the logs first on why the maintenance mode was activated.
158158+ </para>
159159+ </listitem>
160160+ <listitem>
161161+ <warning><para>Only perform the following measures on
162162+ <emphasis>freshly installed instances!</emphasis></para></warning>
163163+ <para>
164164+ A re-run of the installer can be forced by <emphasis>deleting</emphasis>
165165+ <filename>/var/lib/nextcloud/config/config.php</filename>. This is the only time
166166+ advisable because the fresh install doesn't have any state that can be lost.
167167+ In case that doesn't help, an entire re-creation can be forced via
168168+ <command>rm -rf ~nextcloud/</command>.
169169+ </para>
170170+ </listitem>
171171+ </itemizedlist>
172172+ </listitem>
173173+ </itemizedlist>
128174 </section>
129175130176 <section xml:id="module-services-nextcloud-httpd">
···44, curl, Cocoa, Foundation, libobjc, libcxx, tzdata
55, withRecommendedPackages ? true
66, enableStrictBarrier ? false
77+, enableMemoryProfiling ? false
78# R as of writing does not support outputting both .so and .a files; it outputs:
89# --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
910, static ? false
···5657 --with-libtiff
5758 --with-ICU
5859 ${lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
6060+ ${lib.optionalString enableMemoryProfiling "--enable-memory-profiling"}
5961 ${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
6062 AR=$(type -p ar)
6163 AWK=$(type -p gawk)
+36-6
pkgs/applications/science/math/sage/sage-src.nix
···1313 # Fetch a diff between `base` and `rev` on sage's git server.
1414 # Used to fetch trac tickets by setting the `base` to the last release and the
1515 # `rev` to the last commit of the ticket.
1616- fetchSageDiff = { base, name, rev, sha256, ...}@args: (
1616+ fetchSageDiff = { base, name, rev, sha256, squashed ? false, ...}@args: (
1717 fetchpatch ({
1818 inherit name sha256;
19192020- # We used to use
2121- # "https://git.sagemath.org/sage.git/patch?id2=${base}&id=${rev}"
2222- # but the former way does not squash multiple patches together.
2323- url = "https://github.com/sagemath/sage/compare/${base}...${rev}.diff";
2020+ # There are three places to get changes from:
2121+ #
2222+ # 1) From Sage's Trac. Contains all release tags (like "9.4") and all developer
2323+ # branches (wip patches from tickets), but exports each commit as a separate
2424+ # patch, so merge commits can lead to conflicts. Used if squashed == false.
2525+ #
2626+ # 2) From GitHub's sagemath/sage repo. This lets us use a GH feature that allows
2727+ # us to choose between a .patch file, with one patch per commit, or a .diff file,
2828+ # which squashes all commits into a single diff. This is used if squashed ==
2929+ # true. This repo has all release tags. However, it has no developer branches, so
3030+ # this option can't be used if a change wasn't yet shipped in a (possibly beta)
3131+ # release.
3232+ #
3333+ # 3) From GitHub's sagemath/sagetrac-mirror repo. Mirrors all developer branches,
3434+ # but has no release tags. The only use case not covered by 1 or 2 is when we need
3535+ # to apply a patch from an open ticket that contains merge commits.
3636+ #
3737+ # Item 3 could cover all use cases if the sagemath/sagetrack-mirror repo had
3838+ # release tags, but it requires a sha instead of a release number in "base", which
3939+ # is inconvenient.
4040+ urls = if squashed
4141+ then [
4242+ "https://github.com/sagemath/sage/compare/${base}...${rev}.diff"
4343+ "https://github.com/sagemath/sagetrac-mirror/compare/${base}...${rev}.diff"
4444+ ]
4545+ else [ "https://git.sagemath.org/sage.git/patch?id2=${base}&id=${rev}" ];
24462547 # We don't care about sage's own build system (which builds all its dependencies).
2648 # Exclude build system changes to avoid conflicts.
2749 excludes = [ "build/*" ];
2828- } // builtins.removeAttrs args [ "rev" "base" "sha256" ])
5050+ } // builtins.removeAttrs args [ "rev" "base" "sha256" "squashed" ])
2951 );
3052in
3153stdenv.mkDerivation rec {
···80102 # now set the cache dir to be within the .sage directory. This is not
81103 # strictly necessary, but keeps us from littering in the user's HOME.
82104 ./patches/sympow-cache.patch
105105+106106+ # https://trac.sagemath.org/ticket/32305
107107+ (fetchSageDiff {
108108+ base = "9.4";
109109+ name = "networkx-2.6-upgrade.patch";
110110+ rev = "9808325853ba9eb035115e5b056305a1c9d362a0";
111111+ sha256 = "sha256-gJSqycCtbAVr5qnVEbHFUvIuTOvaxFIeffpzd6nH4DE=";
112112+ })
83113 ];
8411485115 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
···77}:
8899{
1010-name ? "${attrs.pname}-${attrs.version}"
1111-1010+pname
1211, version
13121413# by default prefix `name` e.g. "lua5.2-${name}"
···6059# The two above arguments have access to builder variables -- e.g. to $out
61606261# relative to srcRoot, path to the rockspec to use when using rocks
6363-, rockspecFilename ? "../*.rockspec"
6262+, rockspecFilename ? null
6363+# relative to srcRoot, path to folder that contains the expected rockspec
6464+, rockspecDir ? "."
64656566# must be set for packages that don't have a rock
6667, knownRockspec ? null
···7172# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
72737374let
7575+ generatedRockspecFilename = "${rockspecDir}/${pname}-${version}.rockspec";
7676+7777+7478 # TODO fix warnings "Couldn't load rockspec for ..." during manifest
7579 # construction -- from initial investigation, appears it will require
7680 # upstream luarocks changes to fix cleanly (during manifest construction,
···144148toLuaModule ( lua.stdenv.mkDerivation (
145149builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // {
146150147147- name = namePrefix + name;
151151+ name = namePrefix + pname + "-" + version;
148152149153 buildInputs = [ wrapLua lua.pkgs.luarocks ]
150154 ++ buildInputs
···159163 # @-patterns do not capture formal argument default values, so we need to
160164 # explicitly inherit this for it to be available as a shell variable in the
161165 # builder
162162- inherit rockspecFilename;
163166 inherit rocksSubdir;
164167165165- # enabled only for src.rock
166166- setSourceRoot= let
167167- name_only= lib.getName name;
168168- in
169169- lib.optionalString (knownRockspec == null) ''
170170- # format is rockspec_basename/source_basename
171171- # rockspec can set it via spec.source.dir
172172- folder=$(find . -mindepth 2 -maxdepth 2 -type d -path '*${name_only}*/*'|head -n1)
173173- sourceRoot="$folder"
174174- '';
175175-176168 configurePhase = ''
177169 runHook preConfigure
178170···180172 ${luarocks_content}
181173 EOF
182174 export LUAROCKS_CONFIG="$PWD/${luarocks_config}";
175175+ ''
176176+ + lib.optionalString (rockspecFilename == null) ''
177177+ rockspecFilename="${generatedRockspecFilename}"
183178 ''
184179 + lib.optionalString (knownRockspec != null) ''
185180···192187 runHook postConfigure
193188 '';
194189190190+ # TODO could be moved to configurePhase
195191 buildPhase = ''
196192 runHook preBuild
197193
···1717 # Create the module.
1818 echo "Building linux driver against kernel: $kernel";
1919 cd kernel
2020- sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source)
2121- sysOut=$(echo $kernel/lib/modules/$kernelVersion/build)
2220 unset src # used by the nv makefile
2323- make IGNORE_PREEMPT_RT_PRESENCE=1 NV_BUILD_SUPPORTS_HMM=1 SYSSRC=$sysSrc SYSOUT=$sysOut module -j$NIX_BUILD_CORES
2121+ make $makeFlags -j $NIX_BUILD_CORES module
24222523 cd ..
2624 fi
+4-4
pkgs/os-specific/linux/nvidia-x11/default.nix
···1919 # Policy: use the highest stable version as the default (on our master).
2020 stable = if stdenv.hostPlatform.system == "x86_64-linux"
2121 then generic {
2222- version = "470.57.02";
2323- sha256_64bit = "sha256-VdeuEEgn+qeel1Mh/itg+d1C+/9lZCBTRDwOVv20xH0=";
2424- settingsSha256 = "sha256-DJg5QbyuKJmPpLQVYgTLvucI1e9YgQOO16690VXIWvk=";
2525- persistencedSha256 = "sha256-Cqv6oUFnsSi3S1sjplJKeq9bI2pqgBXPPb11HOJSlDo=";
2222+ version = "470.63.01";
2323+ sha256_64bit = "sha256:057dsc0j3136r5gc08id3rwz9c0x7i01xkcwfk77vqic9b6486kg";
2424+ settingsSha256 = "sha256:0lizp4hn49yvca2yd76yh3awld98pkaa35a067lpcld35vb5brgv";
2525+ persistencedSha256 = "sha256:1f3gdpa23ipjy2xwf7qnxmw7w8xxhqy25rmcz34xkngjf4fn4pbs";
2626 }
2727 else legacy_390;
2828
···11{ elk7Version
22, enableUnfree ? true
33-, lib, stdenv
33+, lib
44+, stdenv
45, fetchurl
56, makeWrapper
67, nixosTests
···9101011with lib;
11121212-let this = stdenv.mkDerivation rec {
1313- version = elk7Version;
1414- name = "logstash-${optionalString (!enableUnfree) "oss-"}${version}";
1313+let
1414+ info = splitString "-" stdenv.hostPlatform.system;
1515+ arch = elemAt info 0;
1616+ plat = elemAt info 1;
1717+ shas =
1818+ if enableUnfree
1919+ then {
2020+ x86_64-linux = "sha256-5qv4fbFpLf6aduD7wyxXQ6FsCeUqrszRisNBx44vbMY=";
2121+ x86_64-darwin = "sha256-7H+Xpo8qF1ZZMkR5n92PVplEN4JsBEYar91zHQhE+Lo=";
2222+ }
2323+ else {
2424+ x86_64-linux = "sha256-jiV2yGPwPgZ5plo3ftImVDLSOsk/XBzFkeeALSObLhU=";
2525+ x86_64-darwin = "sha256-UYG+GGr23eAc2GgNX/mXaGU0WKMjiQMPpD1wUvAVz0A=";
2626+ };
2727+ this = stdenv.mkDerivation rec {
2828+ version = elk7Version;
2929+ pname = "logstash${optionalString (!enableUnfree) "-oss"}";
15301616- src = fetchurl {
1717- url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz";
1818- sha256 =
1919- if enableUnfree
2020- then "01l6alwgsq6yf0z9d08i0hi8g708nph1vm78nl4xbpg8h964bybj"
2121- else "0nlwgaw6rmhp5b68zpp1pzsjs30b0bjzdg8f7xy6rarpk338s8yb";
2222- };
3131+ src = fetchurl {
3232+ url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}-${plat}-${arch}.tar.gz";
3333+ sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
3434+ };
23352424- dontBuild = true;
2525- dontPatchELF = true;
2626- dontStrip = true;
2727- dontPatchShebangs = true;
3636+ dontBuild = true;
3737+ dontPatchELF = true;
3838+ dontStrip = true;
3939+ dontPatchShebangs = true;
28402929- buildInputs = [
3030- makeWrapper jre
3131- ];
4141+ buildInputs = [
4242+ makeWrapper
4343+ jre
4444+ ];
32453333- installPhase = ''
3434- runHook preInstall
3535- mkdir -p $out
3636- cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
4646+ installPhase = ''
4747+ runHook preInstall
4848+ mkdir -p $out
4949+ cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
37503838- patchShebangs $out/bin/logstash
3939- patchShebangs $out/bin/logstash-plugin
5151+ patchShebangs $out/bin/logstash
5252+ patchShebangs $out/bin/logstash-plugin
40534141- wrapProgram $out/bin/logstash \
4242- --set JAVA_HOME "${jre}"
5454+ wrapProgram $out/bin/logstash \
5555+ --set JAVA_HOME "${jre}"
43564444- wrapProgram $out/bin/logstash-plugin \
4545- --set JAVA_HOME "${jre}"
4646- runHook postInstall
4747- '';
5757+ wrapProgram $out/bin/logstash-plugin \
5858+ --set JAVA_HOME "${jre}"
5959+ runHook postInstall
6060+ '';
48614949- meta = with lib; {
5050- description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
5151- homepage = "https://www.elastic.co/products/logstash";
5252- license = if enableUnfree then licenses.elastic else licenses.asl20;
5353- platforms = platforms.unix;
5454- maintainers = with maintainers; [ wjlroe offline basvandijk ];
6262+ meta = with lib; {
6363+ description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
6464+ homepage = "https://www.elastic.co/products/logstash";
6565+ license = if enableUnfree then licenses.elastic else licenses.asl20;
6666+ platforms = platforms.unix;
6767+ maintainers = with maintainers; [ wjlroe offline basvandijk ];
6868+ };
6969+ passthru.tests =
7070+ optionalAttrs (!enableUnfree) (
7171+ assert this.drvPath == nixosTests.elk.ELK-7.elkPackages.logstash.drvPath;
7272+ {
7373+ elk = nixosTests.elk.ELK-7;
7474+ }
7575+ );
5576 };
5656- passthru.tests =
5757- optionalAttrs (!enableUnfree) (
5858- assert this.drvPath == nixosTests.elk.ELK-7.elkPackages.logstash.drvPath;
5959- {
6060- elk = nixosTests.elk.ELK-7;
6161- }
6262- );
6363-};
6464-in this
7777+in
7878+this
+4-1
pkgs/tools/misc/markdown-anki-decks/default.nix
···29293030 postPatch = ''
3131 # No API changes.
3232- substituteInPlace pyproject.toml --replace 'python-frontmatter = "^0.5.0"' 'python-frontmatter = "^1.0.0"'
3232+ substituteInPlace pyproject.toml \
3333+ --replace 'python-frontmatter = "^0.5.0"' 'python-frontmatter = "^1.0.0"' \
3434+ --replace 'genanki = "^0.10.1"' 'genanki = "^0.11.0"' \
3535+ --replace 'typer = "^0.3.2"' 'typer = "^0.4.0"'
3336 '';
34373538 # No tests available on Pypi and there is only a failing version assertion test in the repo.
···11-{ writeText, lib, stdenv, fetchurl, ncurses }:
11+{ lib
22+, stdenv
33+, autoreconfHook
44+, fetchurl
55+, ncurses
66+}:
2733-let
44- version = "0.6.1";
55-in
68stdenv.mkDerivation rec {
79 pname = "bwm-ng";
88- inherit version;
1010+ version = "0.6.3";
9111012 src = fetchurl {
1113 url = "https://www.gropp.org/bwm-ng/${pname}-${version}.tar.gz";
1212- sha256 = "1w0dwpjjm9pqi613i8glxrgca3rdyqyp3xydzagzr5ndc34z6z02";
1414+ sha256 = "0ikzyvnb73msm9n7ripg1dsw9av1i0c7q2hi2173xsj8zyv559f1";
1315 };
14161515- buildInputs = [ ncurses ];
1616-1717- # gcc7 has some issues with inline functions
1818- patches = [
1919- (writeText "gcc7.patch"
2020- ''
2121- --- a/src/bwm-ng.c
2222- +++ b/src/bwm-ng.c
2323- @@ -27,5 +27,5 @@
2424- /* handle interrupt signal */
2525- void sigint(int sig) FUNCATTR_NORETURN;
2626- -inline void init(void);
2727- +static inline void init(void);
1717+ nativeBuildInputs = [
1818+ autoreconfHook
1919+ ];
28202929- /* clear stuff and exit */
3030- --- a/src/options.c
3131- +++ b/src/options.c
3232- @@ -35,5 +35,5 @@
3333- inline int str2output_type(char *optarg);
3434- #endif
3535- -inline int str2out_method(char *optarg);
3636- +static inline int str2out_method(char *optarg);
3737- inline int str2in_method(char *optarg);
3838-3939- '')
2121+ buildInputs = [
2222+ ncurses
4023 ];
41244242-4343- # This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline
4444- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=gnu89";
4545-4625 meta = with lib; {
4726 description = "A small and simple console-based live network and disk io bandwidth monitor";
4827 homepage = "http://www.gropp.org/?id=projects&sub=bwm-ng";
4949- license = licenses.gpl2;
2828+ license = licenses.gpl2Plus;
5029 platforms = platforms.unix;
5151-3030+ maintainers = with maintainers; [ ];
5231 longDescription = ''
5353- Features
5454-5555- supports /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats /proc/partitions, IOKit, devstat and libstatgrab
5656- unlimited number of interfaces/devices supported
5757- interfaces/devices are added or removed dynamically from list
5858- white-/blacklist of interfaces/devices
5959- output of KB/s, Kb/s, packets, errors, average, max and total sum
6060- output in curses, plain console, CSV or HTML
6161- configfile
6262-6363- Short list of changes since 0.5 (for full list read changelog):
6464-6565- curses2 output, a nice bar chart
6666- disk input for bsd/macosx/linux/solaris
6767- win32 network bandwidth support
6868- moved to autotools
6969- alot fixes
7070-7171- Info
7272- 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.
7373-7474- 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.
7575-7676- (from homepage)
3232+ bwm-ng supports:
3333+ - /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats /proc/partitions, IOKit,
3434+ devstat and libstatgrab
3535+ - unlimited number of interfaces/devices
3636+ - interfaces/devices are added or removed dynamically from list
3737+ - white-/blacklist of interfaces/devices
3838+ - output of KB/s, Kb/s, packets, errors, average, max and total sum
3939+ - output in curses, plain console, CSV or HTML
7740 '';
7841 };
7942}
···1515 # Utility functions, could just import but passing in for efficiency
1616 lib
17171818-, # Use to reevaluate Nixpkgs; a dirty hack that should be removed
1818+, # Use to reevaluate Nixpkgs
1919 nixpkgsFun
20202121 ## Other parameters
···218218 appendOverlays = extraOverlays:
219219 if extraOverlays == []
220220 then self
221221- else import ./stage.nix (args // { overlays = args.overlays ++ extraOverlays; });
221221+ else nixpkgsFun { overlays = args.overlays ++ extraOverlays; };
222222223223 # NOTE: each call to extend causes a full nixpkgs rebuild, adding ~130MB
224224 # of allocations. DO NOT USE THIS IN NIXPKGS.