diff options
53 files changed, 1401 insertions, 352 deletions
diff --git a/lib/generators.nix b/lib/generators.nix index 501a23599f45..9546f5b5b0ab 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -236,12 +236,17 @@ rec { + libStr.concatMapStringsSep introSpace (go (indent + " ")) v + outroSpace + "]" else if isFunction v then - let fna = lib.functionArgs v; + # functionArgs throws in case of (partially applied) builtins + # on nix before commit b2748c6e99239ff6803ba0da76c362790c8be192 + # which includes current nix stable + # TODO remove tryEval workaround when the issue is resolved on nix stable + let fna = builtins.tryEval (lib.functionArgs v); showFnas = concatStringsSep ", " (libAttr.mapAttrsToList (name: hasDefVal: if hasDefVal then name + "?" else name) - fna); - in if fna == {} then "<function>" - else "<function, args: {${showFnas}}>" + fna.value); + in if !fna.success || fna.value == {} + then "<function>" + else "<function, args: {${showFnas}}>" else if isAttrs v then # apply pretty values if allowed if attrNames v == [ "__pretty" "val" ] && allowPrettyValues diff --git a/lib/types.nix b/lib/types.nix index 77245158d9f8..d0a8e96149d7 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -454,7 +454,8 @@ rec { }; functionTo = elemType: mkOptionType { - name = "function that evaluates to a(n) ${elemType.name}"; + name = "functionTo"; + description = "function that evaluates to a(n) ${elemType.name}"; check = isFunction; merge = loc: defs: fnArgs: (mergeDefinitions (loc ++ [ "[function body]" ]) elemType (map (fn: { inherit (fn) file; value = fn.value fnArgs; }) defs)).mergedValue; diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index a7313e8fdfae..a6c6c547aedc 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -868,6 +868,12 @@ githubId = 706854; name = "Etienne Laurin"; }; + attila-lendvai = { + name = "Attila Lendvai"; + email = "attila@lendvai.name"; + github = "attila-lendvai"; + githubId = 840345; + }; auntie = { email = "auntieNeo@gmail.com"; github = "auntieNeo"; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index f64f2dbb2cb2..30fdde780098 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -609,6 +609,8 @@ ./services/networking/atftpd.nix ./services/networking/avahi-daemon.nix ./services/networking/babeld.nix + ./services/networking/bee.nix + ./services/networking/bee-clef.nix ./services/networking/biboumi.nix ./services/networking/bind.nix ./services/networking/bitcoind.nix diff --git a/nixos/modules/services/backup/mysql-backup.nix b/nixos/modules/services/backup/mysql-backup.nix index 31d606b141a8..506ded5e9e8c 100644 --- a/nixos/modules/services/backup/mysql-backup.nix +++ b/nixos/modules/services/backup/mysql-backup.nix @@ -48,6 +48,7 @@ in }; user = mkOption { + type = types.str; default = defaultUser; description = '' User to be used to perform backup. @@ -56,12 +57,14 @@ in databases = mkOption { default = []; + type = types.listOf types.str; description = '' List of database names to dump. ''; }; location = mkOption { + type = types.path; default = "/var/backup/mysql"; description = '' Location to put the gzipped MySQL database dumps. @@ -70,6 +73,7 @@ in singleTransaction = mkOption { default = false; + type = types.bool; description = '' Whether to create database dump in a single transaction ''; diff --git a/nixos/modules/services/backup/postgresql-backup.nix b/nixos/modules/services/backup/postgresql-backup.nix index 428861a7598a..f4bd3aa447e5 100644 --- a/nixos/modules/services/backup/postgresql-backup.nix +++ b/nixos/modules/services/backup/postgresql-backup.nix @@ -48,6 +48,7 @@ in { startAt = mkOption { default = "*-*-* 01:15:00"; + type = types.str; description = '' This option defines (see <literal>systemd.time</literal> for format) when the databases should be dumped. @@ -70,6 +71,7 @@ in { databases = mkOption { default = []; + type = types.listOf types.str; description = '' List of database names to dump. ''; @@ -77,6 +79,7 @@ in { location = mkOption { default = "/var/backup/postgresql"; + type = types.path; description = '' Location to put the gzipped PostgreSQL database dumps. ''; diff --git a/nixos/modules/services/networking/bee-clef.nix b/nixos/modules/services/networking/bee-clef.nix new file mode 100644 index 000000000000..719714b28982 --- /dev/null +++ b/nixos/modules/services/networking/bee-clef.nix @@ -0,0 +1,107 @@ +{ config, lib, pkgs, ... }: + +# NOTE for now nothing is installed into /etc/bee-clef/. the config files are used as read-only from the nix store. + +with lib; +let + cfg = config.services.bee-clef; +in { + meta = { + maintainers = with maintainers; [ attila-lendvai ]; + }; + + ### interface + + options = { + services.bee-clef = { + enable = mkEnableOption "clef external signer instance for Ethereum Swarm Bee"; + + dataDir = mkOption { + type = types.nullOr types.str; + default = "/var/lib/bee-clef"; + description = '' + Data dir for bee-clef. Beware that some helper scripts may not work when changed! + The service itself should work fine, though. + ''; + }; + + passwordFile = mkOption { + type = types.nullOr types.str; + default = "/var/lib/bee-clef/password"; + description = "Password file for bee-clef."; + }; + + user = mkOption { + type = types.str; + default = "bee-clef"; + description = '' + User the bee-clef daemon should execute under. + ''; + }; + + group = mkOption { + type = types.str; + default = "bee-clef"; + description = '' + Group the bee-clef daemon should execute under. + ''; + }; + }; + }; + + ### implementation + + config = mkIf cfg.enable { + # if we ever want to have rules.js under /etc/bee-clef/ + # environment.etc."bee-clef/rules.js".source = ${pkgs.bee-clef}/rules.js + + systemd.packages = [ pkgs.bee-clef ]; # include the upstream bee-clef.service file + + systemd.tmpfiles.rules = [ + "d '${cfg.dataDir}/' 0750 ${cfg.user} ${cfg.group}" + "d '${cfg.dataDir}/keystore' 0700 ${cfg.user} ${cfg.group}" + ]; + + systemd.services.bee-clef = { + path = [ + # these are needed for the ensure-clef-account script + pkgs.coreutils + pkgs.gnused + pkgs.gawk + ]; + + wantedBy = [ "bee.service" "multi-user.target" ]; + + serviceConfig = { + User = cfg.user; + Group = cfg.group; + ExecStartPre = ''${pkgs.bee-clef}/share/bee-clef/ensure-clef-account "${cfg.dataDir}" "${pkgs.bee-clef}/share/bee-clef/"''; + ExecStart = [ + "" # this hides/overrides what's in the original entry + "${pkgs.bee-clef}/share/bee-clef/bee-clef-service start" + ]; + ExecStop = [ + "" # this hides/overrides what's in the original entry + "${pkgs.bee-clef}/share/bee-clef/bee-clef-service stop" + ]; + Environment = [ + "CONFIGDIR=${cfg.dataDir}" + "PASSWORD_FILE=${cfg.passwordFile}" + ]; + }; + }; + + users.users = optionalAttrs (cfg.user == "bee-clef") { + bee-clef = { + group = cfg.group; + home = cfg.dataDir; + isSystemUser = true; + description = "Daemon user for the bee-clef service"; + }; + }; + + users.groups = optionalAttrs (cfg.group == "bee-clef") { + bee-clef = {}; + }; + }; +} diff --git a/nixos/modules/services/networking/bee.nix b/nixos/modules/services/networking/bee.nix new file mode 100644 index 000000000000..8a77ce23ab4d --- /dev/null +++ b/nixos/modules/services/networking/bee.nix @@ -0,0 +1,149 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.services.bee; + format = pkgs.formats.yaml {}; + configFile = format.generate "bee.yaml" cfg.settings; +in { + meta = { + # doc = ./bee.xml; + maintainers = with maintainers; [ attila-lendvai ]; + }; + + ### interface + + options = { + services.bee = { + enable = mkEnableOption "Ethereum Swarm Bee"; + + package = mkOption { + type = types.package; + default = pkgs.bee; + defaultText = "pkgs.bee"; + example = "pkgs.bee-unstable"; + description = "The package providing the bee binary for the service."; + }; + + settings = mkOption { + type = format.type; + description = '' + Ethereum Swarm Bee configuration. Refer to + <link xlink:href="https://gateway.ethswarm.org/bzz/docs.swarm.eth/docs/installation/configuration/"/> + for details on supported values. + ''; + }; + + daemonNiceLevel = mkOption { + type = types.int; + default = 0; + description = '' + Daemon process priority for bee. + 0 is the default Unix process priority, 19 is the lowest. + ''; + }; + + user = mkOption { + type = types.str; + default = "bee"; + description = '' + User the bee binary should execute under. + ''; + }; + + group = mkOption { + type = types.str; + default = "bee"; + description = '' + Group the bee binary should execute under. + ''; + }; + }; + }; + + ### implementation + + config = mkIf cfg.enable { + assertions = [ + { assertion = (hasAttr "password" cfg.settings) != true; + message = '' + `services.bee.settings.password` is insecure. Use `services.bee.settings.password-file` or `systemd.services.bee.serviceConfig.EnvironmentFile` instead. + ''; + } + { assertion = (hasAttr "swap-endpoint" cfg.settings) || (cfg.settings.swap-enable or true == false); + message = '' + In a swap-enabled network a working Ethereum blockchain node is required. You must specify one using `services.bee.settings.swap-endpoint`, or disable `services.bee.settings.swap-enable` = false. + ''; + } + ]; + + warnings = optional (! config.services.bee-clef.enable) "The bee service requires an external signer. Consider setting `config.services.bee-clef.enable` = true"; + + services.bee.settings = { + data-dir = lib.mkDefault "/var/lib/bee"; + password-file = lib.mkDefault "/var/lib/bee/password"; + clef-signer-enable = lib.mkDefault true; + clef-signer-endpoint = lib.mkDefault "/var/lib/bee-clef/clef.ipc"; + swap-endpoint = lib.mkDefault "https://rpc.slock.it/goerli"; + }; + + systemd.packages = [ cfg.package ]; # include the upstream bee.service file + + systemd.tmpfiles.rules = [ + "d '${cfg.settings.data-dir}' 0750 ${cfg.user} ${cfg.group}" + ]; + + systemd.services.bee = { + requires = optional config.services.bee-clef.enable + "bee-clef.service"; + + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Nice = cfg.daemonNiceLevel; + User = cfg.user; + Group = cfg.group; + ExecStart = [ + "" # this hides/overrides what's in the original entry + "${cfg.package}/bin/bee --config=${configFile} start" + ]; + }; + + preStart = with cfg.settings; '' + if ! test -f ${password-file}; then + < /dev/urandom tr -dc _A-Z-a-z-0-9 2> /dev/null | head -c32 > ${password-file} + chmod 0600 ${password-file} + echo "Initialized ${password-file} from /dev/urandom" + fi + if [ ! -f ${data-dir}/keys/libp2p.key ]; then + ${cfg.package}/bin/bee init --config=${configFile} >/dev/null + echo " +Logs: journalctl -f -u bee.service + +Bee has SWAP enabled by default and it needs ethereum endpoint to operate. +It is recommended to use external signer with bee. +Check documentation for more info: +- SWAP https://docs.ethswarm.org/docs/installation/manual#swap-bandwidth-incentives +- External signer https://docs.ethswarm.org/docs/installation/bee-clef + +After you finish configuration run 'sudo bee-get-addr'." + fi + ''; + }; + + users.users = optionalAttrs (cfg.user == "bee") { + bee = { + group = cfg.group; + home = cfg.settings.data-dir; + isSystemUser = true; + description = "Daemon user for Ethereum Swarm Bee"; + extraGroups = optional config.services.bee-clef.enable + config.services.bee-clef.group; + }; + }; + + users.groups = optionalAttrs (cfg.group == "bee") { + bee = {}; + }; + }; +} diff --git a/pkgs/applications/audio/carla/default.nix b/pkgs/applications/audio/carla/default.nix index a4b68707ee7c..40fb0cfda596 100644 --- a/pkgs/applications/audio/carla/default.nix +++ b/pkgs/applications/audio/carla/default.nix @@ -34,11 +34,12 @@ stdenv.mkDerivation rec { buildInputs = [ file liblo alsaLib fluidsynth ffmpeg_3 jack2 libpulseaudio libsndfile - ] ++ pythonPath - ++ optional withQt qtbase + ] ++ optional withQt qtbase ++ optional withGtk2 gtk2 ++ optional withGtk3 gtk3; + propagatedBuildInputs = pythonPath; + enableParallelBuilding = true; installFlags = [ "PREFIX=$(out)" ]; @@ -53,6 +54,7 @@ stdenv.mkDerivation rec { patchPythonScript "$f" done patchPythonScript "$out/share/carla/carla_settings.py" + patchPythonScript "$out/share/carla/carla_database.py" for program in $out/bin/*; do wrapQtApp "$program" \ diff --git a/pkgs/applications/audio/plexamp/default.nix b/pkgs/applications/audio/plexamp/default.nix index 2c33584e3621..c484f6e19247 100644 --- a/pkgs/applications/audio/plexamp/default.nix +++ b/pkgs/applications/audio/plexamp/default.nix @@ -2,13 +2,13 @@ let pname = "plexamp"; - version = "3.3.1"; + version = "3.4.1"; name = "${pname}-${version}"; src = fetchurl { url = "https://plexamp.plex.tv/plexamp.plex.tv/desktop/Plexamp-${version}.AppImage"; name="${pname}-${version}.AppImage"; - sha256 = "6/asP8VR+rJ52lKKds46gSw1or9suUEmyR75pjdWHIQ="; + sha256 = "Vv+e1q5ThuXDPX8baSU+7/U63p6/dvh0ZvScO1Loj+U="; }; appimageContents = appimageTools.extractType2 { diff --git a/pkgs/applications/backup/vorta/default.nix b/pkgs/applications/backup/vorta/default.nix index fc7e6c0fc359..a1b5944a51e1 100644 --- a/pkgs/applications/backup/vorta/default.nix +++ b/pkgs/applications/backup/vorta/default.nix @@ -1,26 +1,27 @@ -{ buildPythonApplication, fetchFromGitHub, lib, paramiko, peewee, pyqt5 -, python-dateutil, APScheduler, psutil, qdarkstyle, secretstorage -, appdirs, setuptools, qt5 +{ lib +, python3 +, fetchFromGitHub +, wrapQtAppsHook }: -buildPythonApplication rec { +python3.pkgs.buildPythonApplication rec { pname = "vorta"; - version = "0.7.1"; + version = "0.7.2"; src = fetchFromGitHub { owner = "borgbase"; repo = "vorta"; rev = "v${version}"; - sha256 = "069fq5gv324l2ap3g6m6i12lhq1iqm27dsmaagyc3sva945j0gxw"; + sha256 = "1amq0fz3xrnxplzd6ih2azx6b4k1w496kcr7f8agfp617f5rkwa5"; }; postPatch = '' sed -i -e '/setuptools_git/d' -e '/pytest-runner/d' setup.cfg ''; - nativeBuildInputs = [ qt5.wrapQtAppsHook ]; + nativeBuildInputs = [ wrapQtAppsHook ]; - propagatedBuildInputs = [ + propagatedBuildInputs = with python3.pkgs; [ paramiko peewee pyqt5 python-dateutil APScheduler psutil qdarkstyle secretstorage appdirs setuptools ]; @@ -33,7 +34,7 @@ buildPythonApplication rec { ''; meta = with lib; { - license = licenses.gpl3; + license = licenses.gpl3Only; homepage = "https://vorta.borgbase.com/"; maintainers = with maintainers; [ ma27 ]; description = "Desktop Backup Client for Borg"; diff --git a/pkgs/applications/misc/octoprint/default.nix b/pkgs/applications/misc/octoprint/default.nix index f35d03c6d172..9f229e4821b7 100644 --- a/pkgs/applications/misc/octoprint/default.nix +++ b/pkgs/applications/misc/octoprint/default.nix @@ -3,6 +3,7 @@ , lib , fetchFromGitHub , python3 +, nix-update-script # To include additional plugins, pass them here as an overlay. , packageOverrides ? self: super: {} }: @@ -89,13 +90,13 @@ let self: super: { octoprint = self.buildPythonPackage rec { pname = "OctoPrint"; - version = "1.5.1"; + version = "1.5.3"; |