From 0f4872b4c471157e46feb3aad4e458d2aa988678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 25 Mar 2021 21:44:59 +0100 Subject: [PATCH 01/21] nixos/docker: re-add network.target Currently if docker starts concurrently with firewall.service/systemd-networkd it breaks both due to iptables/netlink logs. --- nixos/modules/virtualisation/docker.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index b1415bf021d..3eb0de3a855 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -157,6 +157,7 @@ in systemd.services.docker = { wantedBy = optional cfg.enableOnBoot "multi-user.target"; + after = [ "network.target" "docker.socket" ]; requires = [ "docker.socket" ]; environment = proxy_env; serviceConfig = { From f0b6a466e1ecc58694685fc453e78baf60ff5114 Mon Sep 17 00:00:00 2001 From: happysalada Date: Fri, 2 Apr 2021 09:53:14 +0900 Subject: [PATCH 02/21] beam-modules: format with nixpkgs-fmt --- pkgs/development/beam-modules/default.nix | 121 +++++++++++----------- 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix index 02877a95411..3dcdc8c28d2 100644 --- a/pkgs/development/beam-modules/default.nix +++ b/pkgs/development/beam-modules/default.nix @@ -3,7 +3,7 @@ let inherit (lib) makeExtensible; - lib' = pkgs.callPackage ./lib.nix {}; + lib' = pkgs.callPackage ./lib.nix { }; # FIXME: add support for overrideScope callPackageWithScope = scope: drv: args: lib.callPackageWith scope drv args; @@ -14,70 +14,71 @@ let defaultScope = mkScope self; callPackage = drv: args: callPackageWithScope defaultScope drv args; in - rec { - inherit callPackage erlang; - beamPackages = self; + rec { + inherit callPackage erlang; + beamPackages = self; - rebar = callPackage ../tools/build-managers/rebar { }; - rebar3 = callPackage ../tools/build-managers/rebar3 { }; + rebar = callPackage ../tools/build-managers/rebar { }; + rebar3 = callPackage ../tools/build-managers/rebar3 { }; - # rebar3 port compiler plugin is required by buildRebar3 - pc_1_6_0 = callPackage ./pc {}; - pc = pc_1_6_0; + # rebar3 port compiler plugin is required by buildRebar3 + pc_1_6_0 = callPackage ./pc { }; + pc = pc_1_6_0; - fetchHex = callPackage ./fetch-hex.nix { }; + fetchHex = callPackage ./fetch-hex.nix { }; - fetchRebar3Deps = callPackage ./fetch-rebar-deps.nix { }; - rebar3Relx = callPackage ./rebar3-release.nix { }; + fetchRebar3Deps = callPackage ./fetch-rebar-deps.nix { }; + rebar3Relx = callPackage ./rebar3-release.nix { }; - buildRebar3 = callPackage ./build-rebar3.nix {}; - buildHex = callPackage ./build-hex.nix {}; - buildErlangMk = callPackage ./build-erlang-mk.nix {}; - fetchMixDeps = callPackage ./fetch-mix-deps.nix { }; - buildMix = callPackage ./build-mix.nix {}; + buildRebar3 = callPackage ./build-rebar3.nix { }; + buildHex = callPackage ./build-hex.nix { }; + buildErlangMk = callPackage ./build-erlang-mk.nix { }; + fetchMixDeps = callPackage ./fetch-mix-deps.nix { }; + buildMix = callPackage ./build-mix.nix { }; - # BEAM-based languages. - elixir = elixir_1_11; + # BEAM-based languages. + elixir = elixir_1_11; - elixir_1_11 = lib'.callElixir ../interpreters/elixir/1.11.nix { - inherit erlang; - debugInfo = true; - }; - - elixir_1_10 = lib'.callElixir ../interpreters/elixir/1.10.nix { - inherit erlang; - debugInfo = true; - }; - - elixir_1_9 = lib'.callElixir ../interpreters/elixir/1.9.nix { - inherit erlang; - debugInfo = true; - }; - - elixir_1_8 = lib'.callElixir ../interpreters/elixir/1.8.nix { - inherit erlang; - debugInfo = true; - }; - - elixir_1_7 = lib'.callElixir ../interpreters/elixir/1.7.nix { - inherit erlang; - debugInfo = true; - }; - - # Remove old versions of elixir, when the supports fades out: - # https://hexdocs.pm/elixir/compatibility-and-deprecations.html - - lfe = lfe_1_3; - lfe_1_2 = lib'.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; }; - lfe_1_3 = lib'.callLFE ../interpreters/lfe/1.3.nix { inherit erlang buildRebar3 buildHex; }; - - # Non hex packages. Examples how to build Rebar/Mix packages with and - # without helper functions buildRebar3 and buildMix. - hex = callPackage ./hex {}; - webdriver = callPackage ./webdriver {}; - relxExe = callPackage ../tools/erlang/relx-exe {}; - - # An example of Erlang/C++ package. - cuter = callPackage ../tools/erlang/cuter {}; + elixir_1_11 = lib'.callElixir ../interpreters/elixir/1.11.nix { + inherit erlang; + debugInfo = true; }; -in makeExtensible packages + + elixir_1_10 = lib'.callElixir ../interpreters/elixir/1.10.nix { + inherit erlang; + debugInfo = true; + }; + + elixir_1_9 = lib'.callElixir ../interpreters/elixir/1.9.nix { + inherit erlang; + debugInfo = true; + }; + + elixir_1_8 = lib'.callElixir ../interpreters/elixir/1.8.nix { + inherit erlang; + debugInfo = true; + }; + + elixir_1_7 = lib'.callElixir ../interpreters/elixir/1.7.nix { + inherit erlang; + debugInfo = true; + }; + + # Remove old versions of elixir, when the supports fades out: + # https://hexdocs.pm/elixir/compatibility-and-deprecations.html + + lfe = lfe_1_3; + lfe_1_2 = lib'.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; }; + lfe_1_3 = lib'.callLFE ../interpreters/lfe/1.3.nix { inherit erlang buildRebar3 buildHex; }; + + # Non hex packages. Examples how to build Rebar/Mix packages with and + # without helper functions buildRebar3 and buildMix. + hex = callPackage ./hex { }; + webdriver = callPackage ./webdriver { }; + relxExe = callPackage ../tools/erlang/relx-exe { }; + + # An example of Erlang/C++ package. + cuter = callPackage ../tools/erlang/cuter { }; + }; +in +makeExtensible packages From 1b1af195bb1e02a5d0548d27a11a5e12d377d62a Mon Sep 17 00:00:00 2001 From: happysalada Date: Sat, 3 Apr 2021 09:30:31 +0900 Subject: [PATCH 03/21] beam-modules: remove unused pc versioning --- pkgs/development/beam-modules/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix index 3dcdc8c28d2..f78c66d3805 100644 --- a/pkgs/development/beam-modules/default.nix +++ b/pkgs/development/beam-modules/default.nix @@ -22,8 +22,7 @@ let rebar3 = callPackage ../tools/build-managers/rebar3 { }; # rebar3 port compiler plugin is required by buildRebar3 - pc_1_6_0 = callPackage ./pc { }; - pc = pc_1_6_0; + pc = callPackage ./pc { }; fetchHex = callPackage ./fetch-hex.nix { }; From 481832b32db4a9b1de5b5a04e9038520ff03fac3 Mon Sep 17 00:00:00 2001 From: happysalada Date: Thu, 8 Apr 2021 20:54:48 +0900 Subject: [PATCH 04/21] beam-modules: buildMix -> mixRelease --- doc/languages-frameworks/beam.section.md | 217 +++++++++++++++++- pkgs/development/beam-modules/build-mix.nix | 100 -------- pkgs/development/beam-modules/default.nix | 2 +- .../beam-modules/fetch-mix-deps.nix | 37 ++- pkgs/development/beam-modules/mix-bootstrap | 108 --------- pkgs/development/beam-modules/mix-release.nix | 106 +++++++++ 6 files changed, 341 insertions(+), 229 deletions(-) delete mode 100644 pkgs/development/beam-modules/build-mix.nix delete mode 100755 pkgs/development/beam-modules/mix-bootstrap create mode 100644 pkgs/development/beam-modules/mix-release.nix diff --git a/doc/languages-frameworks/beam.section.md b/doc/languages-frameworks/beam.section.md index ad3b94880b5..b5d39595c10 100644 --- a/doc/languages-frameworks/beam.section.md +++ b/doc/languages-frameworks/beam.section.md @@ -2,15 +2,15 @@ ## Introduction {#beam-introduction} -In this document and related Nix expressions, we use the term, *BEAM*, to describe the environment. BEAM is the name of the Erlang Virtual Machine and, as far as we're concerned, from a packaging perspective, all languages that run on the BEAM are interchangeable. That which varies, like the build system, is transparent to users of any given BEAM package, so we make no distinction. +In this document and related Nix expressions, we use the term, _BEAM_, to describe the environment. BEAM is the name of the Erlang Virtual Machine and, as far as we're concerned, from a packaging perspective, all languages that run on the BEAM are interchangeable. That which varies, like the build system, is transparent to users of any given BEAM package, so we make no distinction. ## Structure {#beam-structure} All BEAM-related expressions are available via the top-level `beam` attribute, which includes: - - `interpreters`: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (`beam.interpreters.erlangR19`, etc), Elixir (`beam.interpreters.elixir`) and LFE (`beam.interpreters.lfe`). +- `interpreters`: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (`beam.interpreters.erlangR19`, etc), Elixir (`beam.interpreters.elixir`) and LFE (Lisp Flavoured Erlang) (`beam.interpreters.lfe`). - - `packages`: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. `beam.packages.erlangR19`. +- `packages`: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. `beam.packages.erlangR19`. The default Erlang compiler, defined by `beam.interpreters.erlang`, is aliased as `erlang`. The default BEAM package set is defined by `beam.packages.erlang` and aliased at the top level as `beamPackages`. @@ -26,7 +26,9 @@ We provide a version of Rebar3, under `rebar3`. We also provide a helper to fetc ### Mix & Erlang.mk {#build-tools-other} -Both Mix and Erlang.mk work exactly as expected. There is a bootstrap process that needs to be run for both, however, which is supported by the `buildMix` and `buildErlangMk` derivations, respectively. +Erlang.mk works exactly as expected. There is a bootstrap process that needs to be run, which is supported by the `buildErlangMk` derivation. + +For Elixir applications use `mixRelease` to make a release. See examples for more details. ## How to Install BEAM Packages {#how-to-install-beam-packages} @@ -52,15 +54,150 @@ Erlang.mk functions similarly to Rebar3, except we use `buildErlangMk` instead o #### Mix Packages {#mix-packages} -Mix functions similarly to Rebar3, except we use `buildMix` instead of `buildRebar3`. +`mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `fetchMixDeps` and passed to it. -Alternatively, we can use `buildHex` as a shortcut: +#### mixRelease - Elixir Phoenix example + +Here is how your `default.nix` file would look. + +```nix +with import { }; + +let + packages = beam.packagesWith beam.interpreters.erlang; + src = builtins.fetchgit { + url = "ssh://git@github.com/your_id/your_repo"; + rev = "replace_with_your_commit"; + }; + + pname = "your_project"; + version = "0.0.1"; + mixEnv = "prod"; + + mixDeps = packages.fetchMixDeps { + pname = "mix-deps-${pname}"; + inherit src mixEnv version; + # nix will complain and tell you the right value to replace this with + sha256 = lib.fakeSha256; + # if you have build time environment variables add them here + MY_ENV_VAR="my_value"; + }; + + nodeDependencies = (pkgs.callPackage ./assets/default.nix { }).shell.nodeDependencies; + + frontEndFiles = stdenvNoCC.mkDerivation { + pname = "frontend-${pname}"; + + nativeBuildInputs = [ nodejs ]; + + inherit version src; + + buildPhase = '' + cp -r ./assets $TEMPDIR + + mkdir -p $TEMPDIR/assets/node_modules/.cache + cp -r ${nodeDependencies}/lib/node_modules $TEMPDIR/assets + export PATH="${nodeDependencies}/bin:$PATH" + + cd $TEMPDIR/assets + webpack --config ./webpack.config.js + cd .. + ''; + + installPhase = '' + cp -r ./priv/static $out/ + ''; + + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + # nix will complain and tell you the right value to replace this with + outputHash = lib.fakeSha256; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars; + }; + + +in packages.mixRelease { + inherit src pname version mixEnv mixDeps; + # if you have build time environment variables add them here + MY_ENV_VAR="my_value"; + preInstall = '' + mkdir -p ./priv/static + cp -r ${frontEndFiles} ./priv/static + ''; +} +``` + +Setup will require the following steps: + +- Move your secrets to runtime environment variables. For more information refer to the [runtime.exs docs](https://hexdocs.pm/mix/Mix.Tasks.Release.html#module-runtime-configuration). On a fresh Phoenix build that would mean that both `DATABASE_URL` and `SECRET_KEY` need to be moved to `runtime.exs`. +- `cd assets` and `nix-shell -p node2nix --run node2nix --development` will generate a Nix expression containing your frontend dependencies +- commit and push those changes +- you can now `nix-build .` +- To run the release, set the `RELEASE_TMP` environment variable to a directory that your program has write access to. It will be used to store the BEAM settings. + +#### Example of creating a service for an Elixir - Phoenix project + +In order to create a service with your release, you could add a `service.nix` +in your project with the following + +```nix +{config, pkgs, lib, ...}: + +let + release = pkgs.callPackage ./default.nix; + release_name = "app"; + working_directory = "/home/app"; +in +{ + systemd.services.${release_name} = { + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "postgresql.service" ]; + requires = [ "network-online.target" "postgresql.service" ]; + description = "my app"; + environment = { + # RELEASE_TMP is used to write the state of the + # VM configuration when the system is running + # it needs to be a writable directory + RELEASE_TMP = working_directory; + # can be generated in an elixir console with + # Base.encode32(:crypto.strong_rand_bytes(32)) + RELEASE_COOKIE = "my_cookie"; + MY_VAR = "my_var"; + }; + serviceConfig = { + Type = "exec"; + DynamicUser = true; + WorkingDirectory = working_directory; + # Implied by DynamicUser, but just to emphasize due to RELEASE_TMP + PrivateTmp = true; + ExecStart = '' + ${release}/bin/${release_name} start + ''; + ExecStop = '' + ${release}/bin/${release_name} stop + ''; + ExecReload = '' + ${release}/bin/${release_name} restart + ''; + Restart = "on-failure"; + RestartSec = 5; + StartLimitBurst = 3; + StartLimitInterval = 10; + }; + # disksup requires bash + path = [ pkgs.bash ]; + }; + + environment.systemPackages = [ release ]; +} +``` ## How to Develop {#how-to-develop} ### Creating a Shell {#creating-a-shell} -Usually, we need to create a `shell.nix` file and do our development inside of the environment specified therein. Just install your version of erlang and other interpreter, and then user your normal build tools. As an example with elixir: +Usually, we need to create a `shell.nix` file and do our development inside of the environment specified therein. Just install your version of Erlang and any other interpreters, and then use your normal build tools. As an example with Elixir: ```nix { pkgs ? import " {} }: @@ -79,6 +216,68 @@ mkShell { } ``` -#### Building in a Shell (for Mix Projects) {#building-in-a-shell} +#### Elixir - Phoenix project -Using a `shell.nix` as described (see ) should just work. +Here is an example `shell.nix`. + +```nix +with import { }; + +let + # define packages to install + basePackages = [ + git + # replace with beam.packages.erlang.elixir_1_11 if you need + beam.packages.erlang.elixir + nodejs-15_x + postgresql_13 + # only used for frontend dependencies + # you are free to use yarn2nix as well + nodePackages.node2nix + # formatting js file + nodePackages.prettier + ]; + + inputs = basePackages ++ lib.optionals stdenv.isLinux [ inotify-tools ] + ++ lib.optionals stdenv.isDarwin + (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]); + + # define shell startup command + hooks = '' + # this allows mix to work on the local directory + mkdir -p .nix-mix .nix-hex + export MIX_HOME=$PWD/.nix-mix + export HEX_HOME=$PWD/.nix-mix + export PATH=$MIX_HOME/bin:$HEX_HOME/bin:$PATH + # TODO: not sure how to make hex available without installing it afterwards. + mix local.hex --if-missing + export LANG=en_US.UTF-8 + export ERL_AFLAGS="-kernel shell_history enabled" + + # postges related + # keep all your db data in a folder inside the project + export PGDATA="$PWD/db" + + # phoenix related env vars + export POOL_SIZE=15 + export DB_URL="postgresql://postgres:postgres@localhost:5432/db" + export PORT=4000 + export MIX_ENV=dev + # add your project env vars here, word readable in the nix store. + export ENV_VAR="your_env_var" + ''; + +in mkShell { + buildInputs = inputs; + shellHook = hooks; +} +``` + +Initializing the project will require the following steps: + +- create the db directory `initdb ./db` (inside your mix project folder) +- create the postgres user `createuser postgres -ds` +- create the db `createdb db` +- start the postgres instance `pg_ctl -l "$PGDATA/server.log" start` +- add the `/db` folder to your `.gitignore` +- you can start your phoenix server and get a shell with `iex -S mix phx.server` diff --git a/pkgs/development/beam-modules/build-mix.nix b/pkgs/development/beam-modules/build-mix.nix deleted file mode 100644 index 45f5e367442..00000000000 --- a/pkgs/development/beam-modules/build-mix.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ stdenv, writeText, elixir, erlang, hex, lib }: - -{ name -, version -, src -, setupHook ? null -, buildInputs ? [] -, beamDeps ? [] -, postPatch ? "" -, compilePorts ? false -, installPhase ? null -, buildPhase ? null -, configurePhase ? null -, meta ? {} -, enableDebugInfo ? false -, ... }@attrs: - -with lib; - -let - - debugInfoFlag = lib.optionalString (enableDebugInfo || elixir.debugInfo) "--debug-info"; - - shell = drv: stdenv.mkDerivation { - name = "interactive-shell-${drv.name}"; - buildInputs = [ drv ]; - }; - - bootstrapper = ./mix-bootstrap; - - pkg = self: stdenv.mkDerivation ( attrs // { - name = "${name}-${version}"; - inherit version; - - dontStrip = true; - - inherit src; - - setupHook = if setupHook == null - then writeText "setupHook.sh" '' - addToSearchPath ERL_LIBS "$1/lib/erlang/lib" - '' - else setupHook; - - inherit buildInputs; - propagatedBuildInputs = [ hex elixir ] ++ beamDeps; - - configurePhase = if configurePhase == null - then '' - runHook preConfigure - ${erlang}/bin/escript ${bootstrapper} - runHook postConfigure - '' - else configurePhase ; - - - buildPhase = if buildPhase == null - then '' - runHook preBuild - - export HEX_OFFLINE=1 - export HEX_HOME=`pwd` - export MIX_ENV=prod - export MIX_NO_DEPS=1 - - mix compile ${debugInfoFlag} --no-deps-check - - runHook postBuild - '' - else buildPhase; - - installPhase = if installPhase == null - then '' - runHook preInstall - - MIXENV=prod - - if [ -d "_build/shared" ]; then - MIXENV=shared - fi - - mkdir -p "$out/lib/erlang/lib/${name}-${version}" - for reldir in src ebin priv include; do - fd="_build/$MIXENV/lib/${name}/$reldir" - [ -d "$fd" ] || continue - cp -Hrt "$out/lib/erlang/lib/${name}-${version}" "$fd" - success=1 - done - - runHook postInstall - '' - else installPhase; - - passthru = { - packageName = name; - env = shell self; - inherit beamDeps; - }; -}); -in fix pkg diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix index f78c66d3805..6e6da4fab03 100644 --- a/pkgs/development/beam-modules/default.nix +++ b/pkgs/development/beam-modules/default.nix @@ -33,7 +33,7 @@ let buildHex = callPackage ./build-hex.nix { }; buildErlangMk = callPackage ./build-erlang-mk.nix { }; fetchMixDeps = callPackage ./fetch-mix-deps.nix { }; - buildMix = callPackage ./build-mix.nix { }; + mixRelease = callPackage ./mix-release.nix { }; # BEAM-based languages. elixir = elixir_1_11; diff --git a/pkgs/development/beam-modules/fetch-mix-deps.nix b/pkgs/development/beam-modules/fetch-mix-deps.nix index 020a82ad70b..73365bd1a93 100644 --- a/pkgs/development/beam-modules/fetch-mix-deps.nix +++ b/pkgs/development/beam-modules/fetch-mix-deps.nix @@ -1,34 +1,49 @@ { stdenvNoCC, lib, elixir, hex, rebar, rebar3, cacert, git }: -{ name, version, sha256, src, mixEnv ? "prod", debug ? false, meta ? { } }: - -stdenvNoCC.mkDerivation ({ - name = "mix-deps-${name}-${version}"; +{ pname +, version +, sha256 +, src +, mixEnv ? "prod" +, debug ? false +, meta ? { } +, ... +}@attrs: +stdenvNoCC.mkDerivation (attrs // { nativeBuildInputs = [ elixir hex cacert git ]; - inherit src; - MIX_ENV = mixEnv; MIX_DEBUG = if debug then 1 else 0; DEBUG = if debug then 1 else 0; # for rebar3 + # the api with `mix local.rebar rebar path` makes a copy of the binary + MIX_REBAR = "${rebar}/bin/rebar"; + MIX_REBAR3 = "${rebar3}/bin/rebar3"; + # there is a persistent download failure with absinthe 1.6.3 + # those defaults reduce the failure rate + HEX_HTTP_CONCURRENCY = 1; + HEX_HTTP_TIMEOUT = 120; - configurePhase = '' + configurePhase = attrs.configurePhase or '' + runHook preConfigure export HEX_HOME="$TEMPDIR/.hex"; export MIX_HOME="$TEMPDIR/.mix"; - export MIX_DEPS_PATH="$out"; + export MIX_DEPS_PATH="$TEMPDIR/deps"; # Rebar - mix local.rebar rebar "${rebar}/bin/rebar" - mix local.rebar rebar3 "${rebar3}/bin/rebar3" export REBAR_GLOBAL_CONFIG_DIR="$TMPDIR/rebar3" export REBAR_CACHE_DIR="$TMPDIR/rebar3.cache" + runHook postConfigure ''; dontBuild = true; - installPhase = '' + installPhase = attrs.installPhase or '' + runHook preInstall mix deps.get --only ${mixEnv} + find "$TEMPDIR/deps" -path '*/.git/*' -a ! -name HEAD -exec rm -rf {} + + cp -r --no-preserve=mode,ownership,timestamps $TEMPDIR/deps $out + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/development/beam-modules/mix-bootstrap b/pkgs/development/beam-modules/mix-bootstrap deleted file mode 100755 index 7e31def71fa..00000000000 --- a/pkgs/development/beam-modules/mix-bootstrap +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- -%%! -smp enable -%%% --------------------------------------------------------------------------- -%%% @doc -%%% The purpose of this command is to prepare a mix project so that mix -%%% understands that the dependencies are all already installed. If you want a -%%% hygienic build on nix then you must run this command before running mix. I -%%% suggest that you add a `Makefile` to your project and have the bootstrap -%%% command be a dependency of the build commands. See the nix documentation for -%%% more information. -%%% -%%% This command designed to have as few dependencies as possible so that it can -%%% be a dependency of root level packages like mix. To that end it does many -%%% things in a fairly simplistic way. That is by design. -%%% -%%% ### Assumptions -%%% -%%% This command makes the following assumptions: -%%% -%%% * It is run in a nix-shell or nix-build environment -%%% * that all dependencies have been added to the ERL_LIBS -%%% Environment Variable - --record(data, {version - , erl_libs - , root - , name}). --define(LOCAL_HEX_REGISTRY, "registry.ets"). - -main(Args) -> - {ok, RequiredData} = gather_required_data_from_the_environment(Args), - ok = bootstrap_libs(RequiredData). - -%% @doc -%% This takes an app name in the standard OTP - format -%% and returns just the app name. Why? Because rebar doesn't -%% respect OTP conventions in some cases. --spec fixup_app_name(file:name()) -> string(). -fixup_app_name(Path) -> - BaseName = filename:basename(Path), - case string:split(BaseName, "-") of - [Name, _Version] -> Name; - Name -> Name - end. - - --spec gather_required_data_from_the_environment([string()]) -> {ok, #data{}}. -gather_required_data_from_the_environment(_) -> - {ok, #data{ version = guard_env("version") - , erl_libs = os:getenv("ERL_LIBS", []) - , root = code:root_dir() - , name = guard_env("name")}}. - --spec guard_env(string()) -> string(). -guard_env(Name) -> - case os:getenv(Name) of - false -> - stderr("Expected Environment variable ~s! Are you sure you are " - "running in a Nix environment? Either a nix-build, " - "nix-shell, etc?~n", [Name]), - erlang:halt(1); - Variable -> - Variable - end. - --spec bootstrap_libs(#data{}) -> ok. -bootstrap_libs(#data{erl_libs = ErlLibs}) -> - io:format("Bootstrapping dependent libraries~n"), - Target = "_build/prod/lib/", - Paths = string:tokens(ErlLibs, ":"), - CopiableFiles = - lists:foldl(fun(Path, Acc) -> - gather_directory_contents(Path) ++ Acc - end, [], Paths), - lists:foreach(fun (Path) -> - ok = link_app(Path, Target) - end, CopiableFiles). - --spec gather_directory_contents(string()) -> [{string(), string()}]. -gather_directory_contents(Path) -> - {ok, Names} = file:list_dir(Path), - lists:map(fun(AppName) -> - {filename:join(Path, AppName), fixup_app_name(AppName)} - end, Names). - -%% @doc -%% Makes a symlink from the directory pointed at by Path to a -%% directory of the same name in Target. So if we had a Path of -%% {`foo/bar/baz/bash`, `baz`} and a Target of `faz/foo/foos`, the symlink -%% would be `faz/foo/foos/baz`. --spec link_app({string(), string()}, string()) -> ok. -link_app({Path, TargetFile}, TargetDir) -> - Target = filename:join(TargetDir, TargetFile), - ok = make_symlink(Path, Target). - --spec make_symlink(string(), string()) -> ok. -make_symlink(Path, TargetFile) -> - file:delete(TargetFile), - ok = filelib:ensure_dir(TargetFile), - io:format("Making symlink from ~s to ~s~n", [Path, TargetFile]), - ok = file:make_symlink(Path, TargetFile). - -%% @doc -%% Write the result of the format string out to stderr. --spec stderr(string(), [term()]) -> ok. -stderr(FormatStr, Args) -> - io:put_chars(standard_error, io_lib:format(FormatStr, Args)). diff --git a/pkgs/development/beam-modules/mix-release.nix b/pkgs/development/beam-modules/mix-release.nix new file mode 100644 index 00000000000..320fcaa9c9b --- /dev/null +++ b/pkgs/development/beam-modules/mix-release.nix @@ -0,0 +1,106 @@ +{ stdenv, lib, elixir, erlang, findutils, hex, rebar, rebar3, fetchMixDeps, makeWrapper, git }: + +{ pname +, version +, src +, nativeBuildInputs ? [ ] +, meta ? { } +, enableDebugInfo ? false +, mixEnv ? "prod" +, compileFlags ? [ ] +, mixDeps ? null +, ... +}@attrs: +let + overridable = builtins.removeAttrs attrs [ "compileFlags" ]; + +in +stdenv.mkDerivation (overridable // { + nativeBuildInputs = nativeBuildInputs ++ [ erlang hex elixir makeWrapper git ]; + + MIX_ENV = mixEnv; + MIX_DEBUG = if enableDebugInfo then 1 else 0; + HEX_OFFLINE = 1; + DEBUG = if enableDebugInfo then 1 else 0; # for Rebar3 compilation + # the api with `mix local.rebar rebar path` makes a copy of the binary + MIX_REBAR = "${rebar}/bin/rebar"; + MIX_REBAR3 = "${rebar3}/bin/rebar3"; + + postUnpack = '' + export HEX_HOME="$TEMPDIR/hex" + export MIX_HOME="$TEMPDIR/mix" + # compilation of the dependencies will require + # that the dependency path is writable + # thus a copy to the TEMPDIR is inevitable here + export MIX_DEPS_PATH="$TEMPDIR/deps" + + # Rebar + export REBAR_GLOBAL_CONFIG_DIR="$TEMPDIR/rebar3" + export REBAR_CACHE_DIR="$TEMPDIR/rebar3.cache" + + ${lib.optionalString (mixDeps != null) '' + cp --no-preserve=mode -R "${mixDeps}" "$MIX_DEPS_PATH" + '' + } + + '' + (attrs.postUnpack or ""); + + configurePhase = attrs.configurePhase or '' + runHook preConfigure + + # this is needed for projects that have a specific compile step + # the dependency needs to be compiled in order for the task + # to be available + # Phoenix projects for example will need compile.phoenix + mix deps.compile --no-deps-check --skip-umbrella-children + + runHook postConfigure + ''; + + buildPhase = attrs.buildPhase or '' + runHook preBuild + + mix compile --no-deps-check ${lib.concatStringsSep " " compileFlags} + + runHook postBuild + ''; + + + installPhase = attrs.installPhase or '' + runHook preInstall + + mix release --no-deps-check --path "$out" + + runHook postInstall + ''; + + fixupPhase = '' + runHook preFixup + if [ -e "$out/bin/${pname}.bat" ]; then # absent in special cases, i.e. elixir-ls + rm "$out/bin/${pname}.bat" # windows file + fi + # contains secrets and should not be in the nix store + # TODO document how to handle RELEASE_COOKIE + # secrets should not be in the nix store. + # This is only used for connecting multiple nodes + if [ -e $out/releases/COOKIE ]; then # absent in special cases, i.e. elixir-ls + rm $out/releases/COOKIE + fi + # TODO remove the uneeded reference too erlang + # one possible way would be + # for f in $(${findutils}/bin/find $out -name start); do + # substituteInPlace $f \ + # --replace 'ROOTDIR=${erlang}/lib/erlang' 'ROOTDIR=""' + # done + # What is left to do is to check that erlang is not required on + # the host + + patchShebangs $out + runHook postFixup + ''; + # TODO figure out how to do a Fixed Output Derivation and add the output hash + # This doesn't play well at the moment with Phoenix projects + # for example that have frontend dependencies + + # disallowedReferences = [ erlang ]; +}) From b0339372cd28b7fbc24cb7be35cd5fc3bfbffaba Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 9 Apr 2021 01:02:38 +0200 Subject: [PATCH 05/21] home-assistant: 2021.4.0 -> 2021.4.1 --- pkgs/servers/home-assistant/component-packages.nix | 2 +- pkgs/servers/home-assistant/default.nix | 4 ++-- pkgs/servers/home-assistant/frontend.nix | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 7d5c6f29e02..5b7d21a16bf 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2,7 +2,7 @@ # Do not edit! { - version = "2021.4.0"; + version = "2021.4.1"; components = { "abode" = ps: with ps; [ abodepy ]; "accuweather" = ps: with ps; [ accuweather ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 0c58caa2922..c2987c19e6f 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -95,7 +95,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "2021.4.0"; + hassVersion = "2021.4.1"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -114,7 +114,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "1gkbkyxqsw3isdyskzi0ib07fgqvirnr20jkhrz86vl0k9ix8hwf"; + sha256 = "154bmbxhyfv1sxa6fk5vimqjmvci710bm5pj590blyzbr4nyci77"; }; # leave this in, so users don't have to constantly update their downstream patch handling diff --git a/pkgs/servers/home-assistant/frontend.nix b/pkgs/servers/home-assistant/frontend.nix index 72a1ea13e0d..54a01c87ce9 100644 --- a/pkgs/servers/home-assistant/frontend.nix +++ b/pkgs/servers/home-assistant/frontend.nix @@ -4,11 +4,11 @@ buildPythonPackage rec { # the frontend version corresponding to a specific home-assistant version can be found here # https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/frontend/manifest.json pname = "home-assistant-frontend"; - version = "20210407.1"; + version = "20210407.2"; src = fetchPypi { inherit pname version; - sha256 = "sha256-7kgL6Ixlc1OZ+3sUAuvJd7vgY6FBgPFEKi6xhq7fiBc="; + sha256 = "sha256-MxXeept0qwDIs9tFZCd1JfDY1Csl8gLWOhzW/Ihlbzw="; }; # there is nothing to strip in this package From 67b7e63d41f683cf7fcb87cdff6fc93886680c29 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 9 Apr 2021 01:25:49 +0200 Subject: [PATCH 06/21] python3Packages.speedtest-cli: 2.1.2 -> 2.1.3 --- pkgs/development/python-modules/speedtest-cli/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/speedtest-cli/default.nix b/pkgs/development/python-modules/speedtest-cli/default.nix index 7476a54a98b..b4842a54761 100644 --- a/pkgs/development/python-modules/speedtest-cli/default.nix +++ b/pkgs/development/python-modules/speedtest-cli/default.nix @@ -7,11 +7,11 @@ # required for home-assistant buildPythonPackage rec { pname = "speedtest-cli"; - version = "2.1.2"; + version = "2.1.3"; src = fetchPypi { inherit pname version; - sha256 = "0m1fpsb318mrpliw026a7nhx8iky306rmfi565734k7r49i3h7fg"; + sha256 = "1w4h7m0isbvfy4zx6m5j4594p5y4pjbpzsr0h4yzmdgd7hip69sy"; }; # tests require working internet connection From 00a1f645523fa4c491c003589f9a28d3edff7c0b Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Thu, 8 Apr 2021 20:06:18 -0400 Subject: [PATCH 07/21] tomcat-native: 1.2.26 -> 1.2.28 --- pkgs/servers/http/tomcat/tomcat-native.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/http/tomcat/tomcat-native.nix b/pkgs/servers/http/tomcat/tomcat-native.nix index 313066d30e1..c9c4453cf5f 100644 --- a/pkgs/servers/http/tomcat/tomcat-native.nix +++ b/pkgs/servers/http/tomcat/tomcat-native.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "tomcat-native"; - version = "1.2.26"; + version = "1.2.28"; src = fetchurl { url = "mirror://apache/tomcat/tomcat-connectors/native/${version}/source/${pname}-${version}-src.tar.gz"; - sha512 = "319lrb0b5vvm2m46rdz2zbicisijvim6948ghz0mypck6f419yjr68j8rpmxpckscaj0ghmbq3p28jpxbjpig84ygy0m63cvgpxknfa"; + sha512 = "16b8659dcd228ea153d05c9ae19e3d97add944315f3b8b42905162d0e4e8a28fd51a172d59d7da8508271ecad0b8ac025a386895565acaf8e2ba11fba77492bb"; }; sourceRoot = "${pname}-${version}-src/native"; From 40180ad725a77408bbbbb422315e9fb17858ac38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 8 Apr 2021 21:14:28 +0200 Subject: [PATCH 08/21] python38Packages.h5py: 3.1.0 -> 3.2.1 --- pkgs/development/python-modules/h5py/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/h5py/default.nix b/pkgs/development/python-modules/h5py/default.nix index c167e2115c6..9e5921bb412 100644 --- a/pkgs/development/python-modules/h5py/default.nix +++ b/pkgs/development/python-modules/h5py/default.nix @@ -8,13 +8,13 @@ let mpi = hdf5.mpi; mpiSupport = hdf5.mpiSupport; in buildPythonPackage rec { - version = "3.1.0"; + version = "3.2.1"; pname = "h5py"; disabled = isPy27; src = fetchPypi { inherit pname version; - sha256 = "1e2516f190652beedcb8c7acfa1c6fa92d99b42331cbef5e5c7ec2d65b0fc3c2"; + sha256 = "sha256-iUdL6RG/zbNMvw2YuOxItXjCeon9sa5O51E/HvjZJJ4="; }; # avoid strict pinning of numpy @@ -49,6 +49,7 @@ in buildPythonPackage rec { meta = with lib; { description = "Pythonic interface to the HDF5 binary data format"; homepage = "http://www.h5py.org/"; - license = licenses.bsd2; + license = licenses.bsd3; + maintainers = [ ]; }; } From 70d7233026552f0cb7bdfb21781aceb1688d49a7 Mon Sep 17 00:00:00 2001 From: JesusMtnez Date: Fri, 9 Apr 2021 05:45:49 +0200 Subject: [PATCH 09/21] vscx/ms-vsliveshare-vsliveshare: 1.0.4070 -> 1.0.4116 --- .../vscode-extensions/ms-vsliveshare-vsliveshare/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix b/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix index a307ed57019..3023642e77c 100644 --- a/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix +++ b/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix @@ -38,8 +38,8 @@ in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtens mktplcRef = { name = "vsliveshare"; publisher = "ms-vsliveshare"; - version = "1.0.4070"; - sha256 = "18dddaz5g0kbrmj9l9k0fivdj6p6y5a6iw24ikvzmypz8zql7gd5"; + version = "1.0.4116"; + sha256 = "1wrqmsrrc80agrw5ii4vcp2v6gzps9hvpjizwn30p0vf43mmw3mj"; }; }).overrideAttrs({ nativeBuildInputs ? [], buildInputs ? [], ... }: { nativeBuildInputs = nativeBuildInputs ++ [ From 01af3003e4a9a8d38cb09f1ed3ee12d744c873af Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Fri, 9 Apr 2021 04:20:00 +0000 Subject: [PATCH 10/21] shadowsocks-rust: 1.10.2 -> 1.10.3 https://github.com/shadowsocks/shadowsocks-rust/releases/tag/v1.10.3 --- pkgs/tools/networking/shadowsocks-rust/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/shadowsocks-rust/default.nix b/pkgs/tools/networking/shadowsocks-rust/default.nix index 54c5701b8ec..286b3207347 100644 --- a/pkgs/tools/networking/shadowsocks-rust/default.nix +++ b/pkgs/tools/networking/shadowsocks-rust/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "shadowsocks-rust"; - version = "1.10.2"; + version = "1.10.3"; src = fetchFromGitHub { rev = "v${version}"; owner = "shadowsocks"; repo = pname; - sha256 = "155v63v0wf0ky5nl2f1dvky8n9pdk40l1lqyz8l1i1kjcvvcmj26"; + sha256 = "1ds2270pw187hbg01lcqxw0631m0ypvbza47z5ndgn6dxprga9wk"; }; - cargoSha256 = "1vb6kis54g4lfc9d0h1961dclaqhq019iw509ydcsa1n7bp25caq"; + cargoSha256 = "0aarhv78ab3z893cgiixxjpxl6xcwi96saavnzw4zd68988lb24r"; RUSTC_BOOTSTRAP = 1; From 7a1e42a078bb4a935af6bd911f9a6c43ad724f95 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Fri, 9 Apr 2021 04:20:00 +0000 Subject: [PATCH 11/21] sops: 3.7.0 -> 3.7.1 https://github.com/mozilla/sops/releases/tag/v3.7.1 --- pkgs/tools/security/sops/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/sops/default.nix b/pkgs/tools/security/sops/default.nix index ec1ade20a19..1cf89143925 100644 --- a/pkgs/tools/security/sops/default.nix +++ b/pkgs/tools/security/sops/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "sops"; - version = "3.7.0"; + version = "3.7.1"; src = fetchFromGitHub { rev = "v${version}"; owner = "mozilla"; repo = pname; - sha256 = "1a0v1jgbz8n3dymzr2shg2ms9sxjwaci209ldzq8v4g737v10zgm"; + sha256 = "0z3jcyl245yjszzjf2h6l1dwa092vxzvfmnivmwi6jvpsdcv33h1"; }; - vendorSha256 = "1qaml2h3c8fhmi8ahp2fmd0hagqp5xqaf8jxjh4mfmbv2is3yz1l"; + vendorSha256 = "1mnwgsbpi56ql0lbpn7dkaps96x9b1lmhlk5cd6d40da7xj616n7"; doCheck = false; From aececed26bf9af077519f91cc1bb025b12fdbf17 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Fri, 9 Apr 2021 07:56:06 +0200 Subject: [PATCH 12/21] labgrid: 0.3.2 -> 0.3.3 --- pkgs/development/python-modules/labgrid/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/labgrid/default.nix b/pkgs/development/python-modules/labgrid/default.nix index e9f0eda56cc..86edc2f8d5e 100644 --- a/pkgs/development/python-modules/labgrid/default.nix +++ b/pkgs/development/python-modules/labgrid/default.nix @@ -22,13 +22,13 @@ buildPythonPackage rec { pname = "labgrid"; - version = "0.3.2"; + version = "0.3.3"; src = fetchFromGitHub { owner = "labgrid-project"; repo = "labgrid"; rev = "v${version}"; - sha256 = "sha256-wMYsgZXNP8kTt/x8c4e96BXrbjIZZ6RsH04BfD0zGwo="; + sha256 = "03dg0c5vahrdj1153pmd4653hjisq3cc6niqnwayjx5pjb15ikxk"; }; patches = [ From 89e0e50e19b009a59f936471e6b904c55b9f60da Mon Sep 17 00:00:00 2001 From: happysalada Date: Fri, 9 Apr 2021 15:45:17 +0900 Subject: [PATCH 13/21] zoxide: 0.5.0 -> 0.6.0; fix darwin build --- pkgs/tools/misc/zoxide/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/zoxide/default.nix b/pkgs/tools/misc/zoxide/default.nix index 1e1ec8723bf..5cad350f498 100644 --- a/pkgs/tools/misc/zoxide/default.nix +++ b/pkgs/tools/misc/zoxide/default.nix @@ -4,6 +4,7 @@ , rustPlatform , withFzf ? true , fzf +, libiconv # checkInputs , fish , powershell @@ -15,15 +16,17 @@ rustPlatform.buildRustPackage rec { pname = "zoxide"; - version = "0.5.0"; + version = "0.6.0"; src = fetchFromGitHub { owner = "ajeetdsouza"; repo = "zoxide"; rev = "v${version}"; - sha256 = "143lh94mw31pm9q7ib63h2k842g3h222mdabhf25hpb19lka2w5y"; + sha256 = "ZeGFsVBpEhKi4EIhpQlCuriFzmHAgLYw3qE/zqfyqgU="; }; + buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; + # tests are broken on darwin doCheck = !stdenv.isDarwin; @@ -46,7 +49,7 @@ rustPlatform.buildRustPackage rec { --replace '"fzf"' '"${fzf}/bin/fzf"' ''; - cargoSha256 = "05mp101yk1zkjj1gwbkldizq6f9f8089gqgvq42c4ngq88pc7v9a"; + cargoSha256 = "Hzn01+OhdBrZD1woXN4Pwf/S72Deln1gyyBOWyDC6iM="; meta = with lib; { description = "A fast cd command that learns your habits"; From 48491c72ce0189e81699c18553e471ff419d9fca Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 9 Apr 2021 08:57:05 +0200 Subject: [PATCH 14/21] python3Packages.twitterapi: 2.6.8 -> 2.6.10 --- pkgs/development/python-modules/twitterapi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/twitterapi/default.nix b/pkgs/development/python-modules/twitterapi/default.nix index b244167f88e..a53a3fda616 100644 --- a/pkgs/development/python-modules/twitterapi/default.nix +++ b/pkgs/development/python-modules/twitterapi/default.nix @@ -7,13 +7,13 @@ buildPythonPackage rec { pname = "twitterapi"; - version = "2.6.8"; + version = "2.6.10"; src = fetchFromGitHub { owner = "geduldig"; repo = "TwitterAPI"; rev = "v${version}"; - sha256 = "sha256-X/j+3bWLQ9b4q0k/JTE984o1VZS0KTQnC0AdZpNsksY="; + sha256 = "sha256-ylxjeIK9cjT4r71j+sULYs6yyYWfKDkpm0bESMo7s3o="; }; propagatedBuildInputs = [ From c3367cc4f70d32f64e7f2d473a4db1c20ced97f7 Mon Sep 17 00:00:00 2001 From: Robbert Gurdeep Singh Date: Fri, 9 Apr 2021 08:56:34 +0200 Subject: [PATCH 15/21] nextcloud: 21.0.0 -> 21.0.1 --- pkgs/servers/nextcloud/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/nextcloud/default.nix b/pkgs/servers/nextcloud/default.nix index 8205f4f860a..8c15ca57e15 100644 --- a/pkgs/servers/nextcloud/default.nix +++ b/pkgs/servers/nextcloud/default.nix @@ -58,7 +58,9 @@ in { }; nextcloud21 = generic { - version = "21.0.0"; - sha256 = "sha256-zq2u72doWhGvxbI7Coa6PHvQp7E41dHswFJiODZV8fA="; + version = "21.0.1"; + sha256 = "dd7c8ccc01547914a75b44bbf86028289c8919dc39f4e2e720147b6bd596aebe"; }; + # tip: get she sha with: + # curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256' } From 1faa5bf13c5a5f0a530825862e6b81454e25bb83 Mon Sep 17 00:00:00 2001 From: Nicolas M Date: Fri, 9 Apr 2021 09:13:58 +0200 Subject: [PATCH 16/21] glow: 1.4.0 -> 1.4.1 (#118871) --- pkgs/applications/editors/glow/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/glow/default.nix b/pkgs/applications/editors/glow/default.nix index 81cba221622..728f5e54a3c 100644 --- a/pkgs/applications/editors/glow/default.nix +++ b/pkgs/applications/editors/glow/default.nix @@ -2,20 +2,20 @@ buildGoModule rec { pname = "glow"; - version = "1.4.0"; + version = "1.4.1"; src = fetchFromGitHub { owner = "charmbracelet"; repo = "glow"; rev = "v${version}"; - sha256 = "13ip29yxjc2fhsk12m6hj6mswrgc9a4m8gf0hiffd1nh5313mqxi"; + sha256 = "0m673xf67q9gjhd98ysh3dvwiqbj6lgsbm20c4zxyz76vdn5k6x8"; }; - vendorSha256 = "0i49b1yq9x5n59k29yacxyif928r0w7hl6azfvr5k3rssg0y4l7f"; + vendorSha256 = "0ngasfcimizahm80gflxzz3cxz0ir10l62i03l73w8syx4wll0q4"; doCheck = false; - buildFlagsArray = [ "-ldflags=" "-X=main.Version=${version}" ]; + buildFlagsArray = [ "-ldflags= -s -w -X=main.Version=${version}" ]; meta = with lib; { description = "Render markdown on the CLI, with pizzazz!"; From 970b82e7d083553fa0b5dfd0c0e81825e4f276df Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Fri, 9 Apr 2021 00:52:35 +0700 Subject: [PATCH 17/21] coqtail-math: init at 20201124 --- .../coq-modules/coqtail-math/default.nix | 19 +++++++++++++++++++ pkgs/top-level/coq-packages.nix | 1 + 2 files changed, 20 insertions(+) create mode 100644 pkgs/development/coq-modules/coqtail-math/default.nix diff --git a/pkgs/development/coq-modules/coqtail-math/default.nix b/pkgs/development/coq-modules/coqtail-math/default.nix new file mode 100644 index 00000000000..891d1fae62c --- /dev/null +++ b/pkgs/development/coq-modules/coqtail-math/default.nix @@ -0,0 +1,19 @@ +{ lib, mkCoqDerivation, coq, version ? null }: + +with lib; + +mkCoqDerivation { + pname = "coqtail-math"; + owner = "coq-community"; + inherit version; + defaultVersion = if versions.range "8.11" "8.13" coq.coq-version then "20201124" else null; + release."20201124".rev = "5c22c3d7dcd8cf4c47cf84a281780f5915488e9e"; + release."20201124".sha256 = "sha256-wd+Lh7dpAD4zfpyKuztDmSFEZo5ZiFrR8ti2jUCVvoQ="; + + buildInputs = with coq.ocamlPackages; [ ocaml findlib ]; + + meta = { + license = licenses.lgpl3Only; + maintainers = [ maintainers.siraben ]; + }; +} diff --git a/pkgs/top-level/coq-packages.nix b/pkgs/top-level/coq-packages.nix index e15a1c3c876..44d7301c7b9 100644 --- a/pkgs/top-level/coq-packages.nix +++ b/pkgs/top-level/coq-packages.nix @@ -27,6 +27,7 @@ let coqeal = callPackage ../development/coq-modules/coqeal {}; coqhammer = callPackage ../development/coq-modules/coqhammer {}; coqprime = callPackage ../development/coq-modules/coqprime {}; + coqtail-math = callPackage ../development/coq-modules/coqtail-math {}; coquelicot = callPackage ../development/coq-modules/coquelicot {}; corn = callPackage ../development/coq-modules/corn {}; dpdgraph = callPackage ../development/coq-modules/dpdgraph {}; From 63d1bc7972b2dce1a2389005f36053bc8894d157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 9 Apr 2021 10:23:55 +0200 Subject: [PATCH 18/21] python3Packages.pyturbojpeg: 1.4.1 -> 1.4.2 https://github.com/lilohuang/PyTurboJPEG/releases/tag/v1.4.2 --- pkgs/development/python-modules/pyturbojpeg/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyturbojpeg/default.nix b/pkgs/development/python-modules/pyturbojpeg/default.nix index 1eebc05d89e..cb74224770d 100644 --- a/pkgs/development/python-modules/pyturbojpeg/default.nix +++ b/pkgs/development/python-modules/pyturbojpeg/default.nix @@ -10,12 +10,12 @@ buildPythonPackage rec { pname = "pyturbojpeg"; - version = "1.4.1"; + version = "1.4.2"; src = fetchPypi { pname = "PyTurboJPEG"; inherit version; - sha256 = "09688a93331281e566569b4d313e1d1a058ca32ccae1a2473847a10e4ca2f2a7"; + sha256 = "sha256-dWmj/huCkborcShf2BT+L3ybEfgdKVIGiJnkz755xwo="; }; patches = [ From 1d406295a3cff86d16bb27d3ae2b36021802ef1b Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 9 Apr 2021 16:27:57 +0800 Subject: [PATCH 19/21] lcdproc: do not show the GPL on every start (#118772) * lcdproc: do not show the GPL on every start --- pkgs/servers/monitoring/lcdproc/default.nix | 36 ++++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/monitoring/lcdproc/default.nix b/pkgs/servers/monitoring/lcdproc/default.nix index 551fa028811..bd0a7dc0dfb 100644 --- a/pkgs/servers/monitoring/lcdproc/default.nix +++ b/pkgs/servers/monitoring/lcdproc/default.nix @@ -1,14 +1,27 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, makeWrapper, pkg-config -, doxygen, freetype, libX11, libftdi, libusb-compat-0_1, libusb1, ncurses, perl }: +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, makeWrapper +, pkg-config +, doxygen +, freetype +, libX11 +, libftdi +, libusb-compat-0_1 +, libusb1 +, ncurses +, perl +}: stdenv.mkDerivation rec { pname = "lcdproc"; version = "0.5.9"; src = fetchFromGitHub { - owner = "lcdproc"; - repo = "lcdproc"; - rev = "v${version}"; + owner = "lcdproc"; + repo = "lcdproc"; + rev = "v${version}"; sha256 = "1r885zv1gsh88j43x6fvzbdgfkh712a227d369h4fdcbnnfd0kpm"; }; @@ -16,6 +29,12 @@ stdenv.mkDerivation rec { ./hardcode_mtab.patch ]; + # we don't need to see the GPL every time we launch lcdd in the foreground + postPatch = '' + substituteInPlace server/main.c \ + --replace 'output_GPL_notice();' '// output_GPL_notice();' + ''; + configureFlags = [ "--enable-lcdproc-menus" "--enable-drivers=all" @@ -23,6 +42,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ freetype libX11 libftdi libusb-compat-0_1 libusb1 ncurses ]; + nativeBuildInputs = [ autoreconfHook doxygen makeWrapper pkg-config ]; # In 0.5.9: gcc: error: libbignum.a: No such file or directory @@ -41,9 +61,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Client/server suite for controlling a wide variety of LCD devices"; - homepage = "http://lcdproc.org/"; - license = licenses.gpl2; + homepage = "http://lcdproc.org/"; + license = licenses.gpl2; maintainers = with maintainers; [ peterhoeg ]; - platforms = platforms.unix; + platforms = platforms.unix; }; } From 5f7aa7a97357f932e88b1667435317528e2b661e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Fri, 9 Apr 2021 09:17:54 +0200 Subject: [PATCH 20/21] systems: add appropriate rustc.config for android Rust doesn't like the `-unknown` vendor component in the target triple. --- lib/systems/examples.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 8a43b86db70..389c4eebcc8 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -60,6 +60,7 @@ rec { armv7a-android-prebuilt = { config = "armv7a-unknown-linux-androideabi"; + rustc.config = "armv7-linux-androideabi"; sdkVer = "29"; ndkVer = "21"; useAndroidPrebuilt = true; @@ -67,6 +68,7 @@ rec { aarch64-android-prebuilt = { config = "aarch64-unknown-linux-android"; + rustc.config = "aarch64-linux-android"; sdkVer = "29"; ndkVer = "21"; useAndroidPrebuilt = true; From ff0886337b7621bddb2b76fd86e4867a70571d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 9 Apr 2021 13:16:26 +0200 Subject: [PATCH 21/21] qutebrowser: don't crash on :version command (#118885) --- .../networking/browsers/qutebrowser/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix index 6cb947cb816..a94b7eb7605 100644 --- a/pkgs/applications/networking/browsers/qutebrowser/default.nix +++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchurl, fetchzip, python3 +{ lib, fetchpatch, fetchurl, fetchzip, python3 , mkDerivationWith, wrapQtAppsHook, wrapGAppsHook, qtbase, glib-networking , asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2 , libxslt, gst_all_1 ? null @@ -67,7 +67,15 @@ in mkDerivationWith python3Packages.buildPythonApplication rec { ++ lib.optional (pythonOlder "3.9") importlib-resources ); - patches = [ ./fix-restart.patch ]; + patches = [ + ./fix-restart.patch + (fetchpatch { + name = "fix-version-parsing.patch"; + url = "https://github.com/qutebrowser/qutebrowser/commit/c3d1b71c6f08607f47353f406aca0168bb3062a1.patch"; + excludes = [ "doc/changelog.asciidoc" ]; + sha256 = "1vm2yjvmrw4cyn8mpwfwvvcihn74f60ql3qh1rjj8n0wak8z1ir6"; + }) + ]; dontWrapGApps = true; dontWrapQtApps = true;