diff options
58 files changed, 258 insertions, 187 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2103.xml b/nixos/doc/manual/release-notes/rl-2103.xml index 24a0281310c6..f33b4ef919f0 100644 --- a/nixos/doc/manual/release-notes/rl-2103.xml +++ b/nixos/doc/manual/release-notes/rl-2103.xml @@ -479,6 +479,14 @@ self: super: <itemizedlist> <listitem> <para> + <literal>stdenv.lib</literal> has been deprecated and will break + eval in 21.11. Please use <literal>pkgs.lib</literal> instead. + See <link xlink:href="https://github.com/NixOS/nixpkgs/issues/108938">#108938</link> + for details. + </para> + </listitem> + <listitem> + <para> The Mailman NixOS module (<literal>services.mailman</literal>) has a new option <xref linkend="opt-services.mailman.enablePostfix" />, defaulting to true, that controls integration with Postfix. @@ -653,6 +661,11 @@ self: super: The <varname>platform</varname> grouping of these things never meant anything, and was just a historial/implementation artifact that was overdue removal. </para> </listitem> + <listitem> + <para> + <varname>services.restic</varname> now uses a dedicated cache directory for every backup defined in <varname>services.restic.backups</varname>. The old global cache directory, <literal>/root/.cache/restic</literal>, is now unused and can be removed to free up disk space. + </para> + </listitem> </itemizedlist> </section> </section> diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index 72eb9fcfaa60..97accc7b99a0 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -5,36 +5,17 @@ with lib; let - - drivers = config.services.xserver.videoDrivers; - - # FIXME: should introduce an option like - # ‘hardware.video.nvidia.package’ for overriding the default NVIDIA - # driver. - nvidiaForKernel = kernelPackages: - if elem "nvidia" drivers then - kernelPackages.nvidia_x11 - else if elem "nvidiaBeta" drivers then - kernelPackages.nvidia_x11_beta - else if elem "nvidiaVulkanBeta" drivers then - kernelPackages.nvidia_x11_vulkan_beta - else if elem "nvidiaLegacy304" drivers then - kernelPackages.nvidia_x11_legacy304 - else if elem "nvidiaLegacy340" drivers then - kernelPackages.nvidia_x11_legacy340 - else if elem "nvidiaLegacy390" drivers then - kernelPackages.nvidia_x11_legacy390 - else null; - - nvidia_x11 = nvidiaForKernel config.boot.kernelPackages; - nvidia_libs32 = - if versionOlder nvidia_x11.version "391" then - ((nvidiaForKernel pkgs.pkgsi686Linux.linuxPackages).override { libsOnly = true; kernel = null; }).out - else - (nvidiaForKernel config.boot.kernelPackages).lib32; + nvidia_x11 = let + drivers = config.services.xserver.videoDrivers; + isDeprecated = str: (hasPrefix "nvidia" str) && (str != "nvidia"); + hasDeprecated = drivers: any isDeprecated drivers; + in if (hasDeprecated drivers) then + throw '' + Selecting an nvidia driver has been modified for NixOS 19.03. The version is now set using `hardware.nvidia.package`. + '' + else if (elem "nvidia" drivers) then cfg.package else null; enabled = nvidia_x11 != null; - cfg = config.hardware.nvidia; pCfg = cfg.prime; @@ -170,6 +151,16 @@ in GPUs stay awake even during headless mode. ''; }; + + hardware.nvidia.package = lib.mkOption { + type = lib.types.package; + default = config.boot.kernelPackages.nvidiaPackages.stable; + defaultText = "config.boot.kernelPackages.nvidiaPackages.stable"; + description = '' + The NVIDIA X11 derivation to use. + ''; + example = "config.boot.kernelPackages.nvidiaPackages.legacy340"; + }; }; config = let @@ -271,9 +262,9 @@ in }; hardware.opengl.package = mkIf (!offloadCfg.enable) nvidia_x11.out; - hardware.opengl.package32 = mkIf (!offloadCfg.enable) nvidia_libs32; + hardware.opengl.package32 = mkIf (!offloadCfg.enable) nvidia_x11.lib32; hardware.opengl.extraPackages = optional offloadCfg.enable nvidia_x11.out; - hardware.opengl.extraPackages32 = optional offloadCfg.enable nvidia_libs32; + hardware.opengl.extraPackages32 = optional offloadCfg.enable nvidia_x11.lib32; environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ] ++ optionals nvidiaPersistencedEnabled [ nvidia_x11.persistenced ]; diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix index d869835bf07e..573f0efa9da4 100644 --- a/nixos/modules/services/backup/restic.nix +++ b/nixos/modules/services/backup/restic.nix @@ -243,9 +243,11 @@ in restartIfChanged = false; serviceConfig = { Type = "oneshot"; - ExecStart = [ "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${backupPaths}" ] ++ pruneCmd; + ExecStart = [ "${resticCmd} backup --cache-dir=%C/restic-backups-${name} ${concatStringsSep " " backup.extraBackupArgs} ${backupPaths}" ] ++ pruneCmd; User = backup.user; RuntimeDirectory = "restic-backups-${name}"; + CacheDirectory = "restic-backups-${name}"; + CacheDirectoryMode = "0700"; } // optionalAttrs (backup.s3CredentialsFile != null) { EnvironmentFile = backup.s3CredentialsFile; }; diff --git a/nixos/modules/services/x11/clight.nix b/nixos/modules/services/x11/clight.nix index 4daf6d8d9db7..873f425fb8be 100644 --- a/nixos/modules/services/x11/clight.nix +++ b/nixos/modules/services/x11/clight.nix @@ -11,14 +11,21 @@ let else if isBool v then boolToString v else if isString v then ''"${escape [''"''] v}"'' else if isList v then "[ " + concatMapStringsSep ", " toConf v + " ]" + else if isAttrs v then "\n{\n" + convertAttrs v + "\n}" else abort "clight.toConf: unexpected type (v = ${v})"; - clightConf = pkgs.writeText "clight.conf" - (concatStringsSep "\n" (mapAttrsToList - (name: value: "${toString name} = ${toConf value};") - (filterAttrs - (_: value: value != null) - cfg.settings))); + getSep = v: + if isAttrs v then ":" + else "="; + + convertAttrs = attrs: concatStringsSep "\n" (mapAttrsToList + (name: value: "${toString name} ${getSep value} ${toConf value};") + attrs); + + clightConf = pkgs.writeText "clight.conf" (convertAttrs + (filterAttrs + (_: value: value != null) + cfg.settings)); in { options.services.clight = { enable = mkOption { @@ -49,9 +56,10 @@ in { }; settings = let - validConfigTypes = with types; either int (either str (either bool float)); + validConfigTypes = with types; oneOf [ int str bool float ]; + collectionTypes = with types; oneOf [ validConfigTypes (listOf validConfigTypes) ]; in mkOption { - type = with types; attrsOf (nullOr (either validConfigTypes (listOf validConfigTypes))); + type = with types; attrsOf (nullOr (either collectionTypes (attrsOf collectionTypes))); default = {}; example = { captures = 20; gamma_long_transition = true; ac_capture_timeouts = [ 120 300 60 ]; }; description = '' @@ -69,10 +77,10 @@ in { services.upower.enable = true; services.clight.settings = { - gamma_temp = with cfg.temperature; mkDefault [ day night ]; + gamma.temp = with cfg.temperature; mkDefault [ day night ]; } // (optionalAttrs (config.location.provider == "manual") { - latitude = mkDefault config.location.latitude; - longitude = mkDefault config.location.longitude; + daytime.latitude = mkDefault config.location.latitude; + daytime.longitude = mkDefault config.location.longitude; }); services.geoclue2.appConfig.clightc = { diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index ed7226331d70..9287852bacfd 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -37,12 +37,10 @@ in boot.kernelPackages = mkOption { default = pkgs.linuxPackages; type = types.unspecified // { merge = mergeEqualOption; }; - apply = kernelPackages: kernelPackages.extend (self: super: { - kernel = super.kernel.override { - inherit randstructSeed; - kernelPatches = super.kernel.kernelPatches ++ kernelPatches; - features = lib.recursiveUpdate super.kernel.features features; - }; + apply = kernelPackages: pkgs.linuxPackagesFor (kernelPackages.kernel.override { + inherit randstructSeed; + kernelPatches = kernelPackages.kernel.kernelPatches ++ kernelPatches; + features = lib.recursiveUpdate kernelPackages.kernel.features features; }); # We don't want to evaluate all of linuxPackages for the manual # - some of it might not even evaluate correctly. diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index a055072f9c96..a9b5b134d889 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -7,8 +7,9 @@ let addCheckDesc = desc: elemType: check: types.addCheck elemType check // { description = "${elemType.description} (with check: ${desc})"; }; - nonEmptyStr = addCheckDesc "non-empty" types.str - (x: x != "" && ! (all (c: c == " " || c == "\t") (stringToCharacters x))); + + isNonEmpty = s: (builtins.match "[ \t\n]*" s) == null; + nonEmptyStr = addCheckDesc "non-empty" types.str isNonEmpty; fileSystems' = toposort fsBefore (attrValues config.fileSystems); @@ -28,10 +29,10 @@ let coreFileSystemOpts = { name, config, ... }: { options = { - mountPoint = mkOption { example = "/mnt/usb"; - type = nonEmptyStr; + type = addCheckDesc "non-empty without trailing slash" types.str + (s: isNonEmpty s && (builtins.match ".+/" s) == null); description = "Location of the mounted the file system."; }; diff --git a/pkgs/applications/blockchains/bitcoin-classic.nix b/pkgs/applications/blockchains/bitcoin-classic.nix index 796c48a7c58a..bd1c9611d561 100644 --- a/pkgs/applications/blockchains/bitcoin-classic.nix +++ b/pkgs/applications/blockchains/bitcoin-classic.nix @@ -7,13 +7,13 @@ with lib; stdenv.mkDerivation rec { name = "bitcoin" + (toString (optional (!withGui) "d")) + "-classic-" + version; - version = "1.3.8"; + version = "1.3.8uahf"; src = fetchFromGitHub { owner = "bitcoinclassic"; repo = "bitcoinclassic"; rev = "v${version}"; - sha256 = "06ij9v7zbdnhxq9429nnxiw655cp8idldj18l7fmj94gqx07n5vh"; + sha256 = "sha256-V1cOB5FLotGS5jup/aVaiDiyr/v2KJ2SLcIu/Hrjuwk="; }; nativeBuildInputs = [ pkg-config autoreconfHook ]; diff --git a/pkgs/applications/graphics/dia/CVE-2019-19451.patch b/pkgs/applications/graphics/dia/CVE-2019-19451.patch new file mode 100644 index 000000000000..28d6598330a3 --- /dev/null +++ b/pkgs/applications/graphics/dia/CVE-2019-19451.patch @@ -0,0 +1,11 @@ +diff -ru a/app/app_procs.c b/app/app_procs.c +--- a/app/app_procs.c 2021-01-30 11:09:52.000000000 -0500 ++++ b/app/app_procs.c 2021-01-30 11:11:05.000000000 -0500 +@@ -785,6 +785,7 @@ + + if (!filename) { + g_print (_("Filename conversion failed: %s\n"), filenames[i]); ++ ++i; + continue; + } + diff --git a/pkgs/applications/graphics/dia/default.nix b/pkgs/applications/graphics/dia/default.nix index 6fe8aed8f674..d9de3eb7fc12 100644 --- a/pkgs/applications/graphics/dia/default.nix +++ b/pkgs/applications/graphics/dia/default.nix @@ -13,6 +13,10 @@ stdenv.mkDerivation { sha256 = "1fyxfrzdcs6blxhkw3bcgkksaf3byrsj4cbyrqgb4869k3ynap96"; }; + patches = [ + ./CVE-2019-19451.patch + ]; + buildInputs = [ gtk2 libxml2 gettext python libxml2Python docbook5 libxslt docbook_xsl libart_lgpl ] diff --git a/pkgs/applications/misc/obsidian/default.nix b/pkgs/applications/misc/obsidian/default.nix index 0d10767e5b10..57400fe100c7 100644 --- a/pkgs/applications/misc/obsidian/default.nix +++ b/pkgs/applications/misc/obsidian/default.nix @@ -30,12 +30,12 @@ let in stdenv.mkDerivation rec { pname = "obsidian"; - version = "0.10.8"; + version = "0.10.11"; src = fetchurl { url = "https://github.com/obsidianmd/obsidian-releases/releases/download/v${version}/obsidian-${version}.asar.gz"; - sha256 = "M+iIvnenfe+4JUKLvGDJXub8d5t2BLoPTo5MrF+5xy4="; + sha256 = "RQdNTzorFq3W8clNObyOisKWUM/s+bE/CbpJ/8ABbrk="; }; nativeBuildInputs = [ makeWrapper graphicsmagick ]; diff --git a/pkgs/applications/misc/pdfsam-basic/default.nix b/pkgs/applications/misc/pdfsam-basic/default.nix index 2aeb3ba7f99f..37905b8e444a 100644 --- a/pkgs/applications/misc/pdfsam-basic/default.nix +++ b/pkgs/applications/misc/pdfsam-basic/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "pdfsam-basic"; - version = "4.2.1"; + version = "4.2.2"; src = fetchurl { url = "https://github.com/torakiki/pdfsam/releases/download/v${version}/pdfsam_${version}-1_amd64.deb"; - sha256 = "0d7pvl87ybkvcxk69fr35fz0w447hy2pm65bhvlril16ljm2izja"; + sha256 = "sha256-fbcU3NZdQ8NR5tLjEJyOPneVWNMBddLdttLeVwIUtpg="; }; unpackPhase = '' diff --git a/pkgs/applications/version-management/git-and-tools/git-big-picture/default.nix b/pkgs/applications/version-management/git-and-tools/git-big-picture/default.nix index 5f84d4235734..35aada8b870f 100644 --- a/pkgs/applications/version-management/git-and-tools/git-big-picture/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-big-picture/default.nix @@ -1,27 +1,20 @@ -{ fetchFromGitHub, python3Packages, lib, git, graphviz }: +{ python3Packages, lib, git, graphviz }: python3Packages.buildPythonApplication rec { pname = "git-big-picture"; - version = "1.0.0"; + version = "1.1.1"; + format = "wheel"; - src = fetchFromGitHub { - owner = "git-big-picture"; - repo = pname; - rev = "v${version}"; - sha256 = "14yf71iwgk78nw8w0bpijsnnl4vg3bvxsw3vvypxmbrc1nh0bdha"; + src = python3Packages.fetchPypi { + inherit format version; + pname = "git_big_picture"; # underscores needed for working download URL + python = "py3"; # i.e. no Python 2.7 + sha256 = "a20a480057ced1585c4c38497d27a5012f12dd29697313f0bb8fa6ddbb5c17d8"; }; - buildInputs = [ git graphviz ]; - - # NOTE: Tests are disabled due to unpackaged test dependency "Scruf". - # When bumping to 1.1.0, please re-enable and use: - #checkInputs = [ cram git pytest ]; - #checkPhase = "pytest test.py"; - doCheck = false; - postFixup = '' wrapProgram $out/bin/git-big-picture \ - --prefix PATH ":" ${ lib.makeBinPath buildInputs } + --prefix PATH ":" ${ lib.makeBinPath [ git graphviz ] } ''; meta = { diff --git a/pkgs/data/misc/osinfo-db/default.nix b/pkgs/data/misc/osinfo-db/default.nix index 36fc664a83bb..70224aaa8363 100644 --- a/pkgs/data/misc/osinfo-db/default.nix +++ b/pkgs/data/misc/osinfo-db/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "osinfo-db"; - version = "20201119"; + version = "20201218"; src = fetchurl { url = "https://releases.pagure.org/libosinfo/${pname}-${version}.tar.xz"; - sha256 = "1a0c42rh3anl3wy4hpg36s8k37y8zxpi5lc67wjwnj4j6mwi7w3l"; + sha256 = "sha256-APKuXWtnpF1r/q2MXddaDeBnBigx4hwMevPwx5uNq3k="; }; nativeBuildInputs = [ osinfo-db-tools gettext libxml2 ]; diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index 26e9f2b87e1a..530115602673 100644 --- a/pkgs/development/compilers/swift/default.nix |