diff --git a/nixos/modules/services/misc/paperless.nix b/nixos/modules/services/misc/paperless.nix index afdc19532dce..0ecfcb895c0c 100644 --- a/nixos/modules/services/misc/paperless.nix +++ b/nixos/modules/services/misc/paperless.nix @@ -26,14 +26,11 @@ let lib.mapAttrs (_: toString) cfg.extraConfig ); - manage = - let - setupEnv = lib.concatStringsSep "\n" (mapAttrsToList (name: val: "export ${name}=\"${val}\"") env); - in - pkgs.writeShellScript "manage" '' - ${setupEnv} - exec ${pkg}/bin/paperless-ngx "$@" - ''; + manage = pkgs.writeShellScript "manage" '' + set -o allexport # Export the following env vars + ${lib.toShellVars env} + exec ${pkg}/bin/paperless-ngx "$@" + ''; # Secure the services defaultServiceConfig = { @@ -172,6 +169,7 @@ in description = lib.mdDoc "Web interface port."; }; + # FIXME this should become an RFC42-style settings attr extraConfig = mkOption { type = types.attrs; default = { }; @@ -180,11 +178,23 @@ in See [the documentation](https://paperless-ngx.readthedocs.io/en/latest/configuration.html) for available options. + + Note that some options such as `PAPERLESS_CONSUMER_IGNORE_PATTERN` expect JSON values. Use `builtins.toJSON` to ensure proper quoting. + ''; + example = literalExpression '' + { + PAPERLESS_OCR_LANGUAGE = "deu+eng"; + + PAPERLESS_DBHOST = "/run/postgresql"; + + PAPERLESS_CONSUMER_IGNORE_PATTERN = builtins.toJSON [ ".DS_STORE/*" "desktop.ini" ]; + + PAPERLESS_OCR_USER_ARGS = builtins.toJSON { + optimize = 1; + pdfa_image_compression = "lossless"; + }; + }; ''; - example = { - PAPERLESS_OCR_LANGUAGE = "deu+eng"; - PAPERLESS_DBHOST = "/run/postgresql"; - }; }; user = mkOption { diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 1229f6357523..031de1a15f2f 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -91,7 +91,7 @@ let # we just copy what we need from Glibc and use patchelf to make it # work. extraUtils = pkgs.runCommand "extra-utils" - { nativeBuildInputs = [pkgs.buildPackages.nukeReferences]; + { nativeBuildInputs = with pkgs.buildPackages; [ nukeReferences bintools ]; allowedReferences = [ "out" ]; # prevent accidents like glibc being included in the initrd } '' diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index dac6906762a4..590988d95986 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -422,6 +422,7 @@ let # The test cannot access the network, so any packages we # need must be included in the VM. system.extraDependencies = with pkgs; [ + bintools brotli brotli.dev brotli.lib diff --git a/pkgs/applications/radio/ax25-apps/default.nix b/pkgs/applications/radio/ax25-apps/default.nix index 4f9ecd3580f8..ea53d7c38b5a 100644 --- a/pkgs/applications/radio/ax25-apps/default.nix +++ b/pkgs/applications/radio/ax25-apps/default.nix @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--sysconfdir=/etc" + "--localstatedir=/var/lib" "--program-transform-name=s@^call$@ax&@;s@^listen$@ax&@" ]; diff --git a/pkgs/applications/radio/ax25-tools/default.nix b/pkgs/applications/radio/ax25-tools/default.nix index 0e806c1107e5..80c42da9a3d1 100644 --- a/pkgs/applications/radio/ax25-tools/default.nix +++ b/pkgs/applications/radio/ax25-tools/default.nix @@ -17,7 +17,10 @@ stdenv.mkDerivation rec { sha256 = "sha256-kqnLi1iobcufVWMPxUyaRsWKIPyTvtUkuMERGQs2qgY="; }; - configureFlags = [ "--sysconfdir=/etc" ]; + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var/lib" + ]; meta = with lib; { description = "Non-GUI tools used to configure an AX.25 enabled computer"; diff --git a/pkgs/development/ocaml-modules/dypgen/default.nix b/pkgs/development/ocaml-modules/dypgen/default.nix index f504e3d7ca46..d47b78307769 100644 --- a/pkgs/development/ocaml-modules/dypgen/default.nix +++ b/pkgs/development/ocaml-modules/dypgen/default.nix @@ -1,21 +1,26 @@ -{stdenv, lib, fetchurl, ocaml, findlib}: +{ stdenv, lib, fetchFromGitHub, fetchurl, ocaml, findlib }: -let - pname = "dypgen"; -in - -if lib.versionAtLeast ocaml.version "4.06" -then throw "${pname} is not available for OCaml ${ocaml.version}" -else +let params = + if lib.versionAtLeast ocaml.version "4.07" then rec { + version = "0.2"; + src = fetchFromGitHub { + owner = "grain-lang"; + repo = "dypgen"; + rev = version; + hash = "sha256-fKuO/e5YbA2B7XcghWl9pXxwvKw9YlhnmZDZcuKe3cs="; + }; + } else if lib.versionOlder ocaml.version "4.06" then { + version = "20120619-1"; + src = fetchurl { + url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2"; + sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97"; + }; + } else throw "dypgen is not available for OCaml ${ocaml.version}" +; in stdenv.mkDerivation rec { - name = "${pname}-${version}"; - version = "20120619-1"; - - src = fetchurl { - url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2"; - sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97"; - }; + pname = "ocaml${ocaml.version}-dypgen"; + inherit (params) src version; nativeBuildInputs = [ ocaml findlib ]; diff --git a/pkgs/os-specific/linux/firmware/linux-firmware/default.nix b/pkgs/os-specific/linux/firmware/linux-firmware/default.nix index a2229a0a60ce..b76a77fb3a60 100644 --- a/pkgs/os-specific/linux/firmware/linux-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/linux-firmware/default.nix @@ -11,7 +11,7 @@ stdenvNoCC.mkDerivation rec { version = source.version; src = fetchzip { - url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${version}.tar.gz"; + url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${source.revision}.tar.gz"; hash = source.sourceHash; }; diff --git a/pkgs/os-specific/linux/firmware/linux-firmware/source.nix b/pkgs/os-specific/linux/firmware/linux-firmware/source.nix index e1d77a03200f..7cd541402bd1 100644 --- a/pkgs/os-specific/linux/firmware/linux-firmware/source.nix +++ b/pkgs/os-specific/linux/firmware/linux-firmware/source.nix @@ -1,6 +1,7 @@ # This file is autogenerated! Run ./update.sh to regenerate. { - version = "20230515"; - sourceHash = "sha256-VcA873r9jVYqDqEcvz/PVGfCAhLXr0sMXQincWNLEIs="; - outputHash = "sha256-h3KDK3KiD88dvTvLlLL2XczY1ZeEVnYEzh9sqbo1dZ8="; + version = "unstable-2023-07-24"; + revision = "59fbffa9ec8e4b0b31d2d13e715cf6580ad0e99c"; + sourceHash = "sha256-WyO/+fxQljfo6OXLC8/BomGmKtUQaJ1Lt9V5Fdv172g="; + outputHash = "sha256-wHWPSyqxP+MGmerbc2v/hclFFJ7qKCDsupK5GASjp8s="; } diff --git a/pkgs/os-specific/linux/firmware/linux-firmware/update.sh b/pkgs/os-specific/linux/firmware/linux-firmware/update.sh index cd711db7de40..4b28d6e1374f 100755 --- a/pkgs/os-specific/linux/firmware/linux-firmware/update.sh +++ b/pkgs/os-specific/linux/firmware/linux-firmware/update.sh @@ -2,19 +2,31 @@ set -euo pipefail cd "$(dirname "$(readlink -f "$0")")" || exit -# step 1: figure out the latest version from the tags repo="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git" -latestTag="$(git ls-remote --refs --tags --sort refname "$repo" | tail -n1 | cut -f2 | cut -d '/' -f3)" + +# step 1: figure out the latest version from the tags +if [ -z "${1:-}" ]; then + revision="$(git ls-remote --refs --tags --sort refname "$repo" | tail -n1 | cut -f2 | cut -d '/' -f3)" + version=$revision +else + revision=$1 + if [ -z "${2:-}" ]; then + version="unstable-$(date "+%Y-%m-%d")" + else + version=$2 + fi +fi # step 2: prefetch the source tarball -snapshotUrl="$repo/snapshot/linux-firmware-$latestTag.tar.gz" +snapshotUrl="$repo/snapshot/linux-firmware-$revision.tar.gz" hash="$(nix-prefetch-url --unpack "$snapshotUrl")" sriHash="$(nix --experimental-features nix-command hash to-sri "sha256:$hash")" # step 3: rebuild as a non-FO derivation to get the right hash cat > source.nix << EOF { - version = "$latestTag"; + version = "$version"; + revision = "$revision"; sourceHash = "$sriHash"; outputHash = null; } @@ -27,7 +39,8 @@ outHash="$(nix --experimental-features nix-command hash path "$outPath")" cat > source.nix << EOF # This file is autogenerated! Run ./update.sh to regenerate. { - version = "$latestTag"; + version = "$version"; + revision = "$revision"; sourceHash = "$sriHash"; outputHash = "$outHash"; } diff --git a/pkgs/os-specific/linux/kernel/linux-4.19.nix b/pkgs/os-specific/linux/kernel/linux-4.19.nix index 47c8cc9cbe05..e71cdee98da8 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.19.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.19.nix @@ -3,7 +3,7 @@ with lib; buildLinux (args // rec { - version = "4.19.288"; + version = "4.19.289"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = versions.pad 3 version; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "1sz3jp6kx0axdwp0wsq903q1090rbav9d12m5128335m8p2d1srk"; + sha256 = "1cx33aa9v2071gixvp68pqpp4vxcx61dqg04rf6xns1qg48p93qi"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix index f550778eac90..cf7390609895 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -3,7 +3,7 @@ with lib; buildLinux (args // rec { - version = "5.10.186"; + version = "5.10.187"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = versions.pad 3 version; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "1qqv91r13akgik1q4jybf8czskxxizk6lpv4rsvjn9sx2dm2jq0y"; + sha256 = "1fwbz5xg3jxfzji9jlxqwf5rz9acgn4sm2inp3l017iy1chm957n"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-5.15.nix b/pkgs/os-specific/linux/kernel/linux-5.15.nix index 3bf19de28338..8c66af32b442 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.15.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.15.nix @@ -3,7 +3,7 @@ with lib; buildLinux (args // rec { - version = "5.15.121"; + version = "5.15.122"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = versions.pad 3 version; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "07f3a68r1yb4p19z1azjwp2vhjb3ayh31hz9hfb4a98dn2ywxq07"; + sha256 = "0b9ljdi9vgwzw4wa8gx1ia5fmb1pm8lnslx0q2l2kqhwrl0mhx9q"; }; } // (args.argsOverride or { })) diff --git a/pkgs/os-specific/linux/kernel/linux-5.4.nix b/pkgs/os-specific/linux/kernel/linux-5.4.nix index 99205ad33962..daa4385b7614 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.4.nix @@ -3,7 +3,7 @@ with lib; buildLinux (args // rec { - version = "5.4.249"; + version = "5.4.250"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = versions.pad 3 version; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "079mylc5j7hk5xn59q3z2xydyh88pq7yipn67x3y7nvf5i35hm6w"; + sha256 = "1ywil04x3mw62n53pkrkxrhkg1xyi3g9ssvg6igbyqk0a9v8hnqg"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-6.1.nix b/pkgs/os-specific/linux/kernel/linux-6.1.nix index c8ecfc95f355..7fade741a748 100644 --- a/pkgs/os-specific/linux/kernel/linux-6.1.nix +++ b/pkgs/os-specific/linux/kernel/linux-6.1.nix @@ -3,7 +3,7 @@ with lib; buildLinux (args // rec { - version = "6.1.40"; + version = "6.1.41"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = versions.pad 3 version; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz"; - sha256 = "1w474pia4pxz4qbfai27ary1y1h2fnn7kvx7yz7wszd0jwhzrsj3"; + sha256 = "1dqbawgcpwxszqqnf7a66db8xlldxnr4f3sqlq42l1gaiskhja1i"; }; } // (args.argsOverride or { })) diff --git a/pkgs/os-specific/linux/kernel/linux-6.4.nix b/pkgs/os-specific/linux/kernel/linux-6.4.nix index b87269589ae3..aaa568ff2b32 100644 --- a/pkgs/os-specific/linux/kernel/linux-6.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-6.4.nix @@ -3,7 +3,7 @@ with lib; buildLinux (args // rec { - version = "6.4.5"; + version = "6.4.6"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = versions.pad 3 version; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz"; - sha256 = "1dz9inr1bf7jx5s9n0dfa0srfzrwnz1zmdq42bbxyl9w8q3jqkip"; + sha256 = "192ya79h3lw781ka22ibgbvdcx6maa74nyk0lqjsz2n4xybc9v71"; }; } // (args.argsOverride or { }))