diff options
42 files changed, 950 insertions, 377 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index e0b4a6b2ef3f9..95c01820e7e69 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -840,6 +840,23 @@ environment.systemPackages = [ default in the CLI tooling which in turn enables us to use <literal>unbound-control</literal> without passing a custom configuration location. </para> + + <para> + The module has also been reworked to be <link + xlink:href="https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md">RFC + 0042</link> compliant. As such, + <option>sevices.unbound.extraConfig</option> has been removed and replaced + by <xref linkend="opt-services.unbound.settings"/>. <option>services.unbound.interfaces</option> + has been renamed to <option>services.unbound.settings.server.interface</option>. + </para> + + <para> + <option>services.unbound.forwardAddresses</option> and + <option>services.unbound.allowedAccess</option> have also been changed to + use the new settings interface. You can follow the instructions when + executing <literal>nixos-rebuild</literal> to upgrade your configuration to + use the new interface. + </para> </listitem> <listitem> <para> diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index cbe90ff4cbfca..6497b897eafd3 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -54,8 +54,13 @@ rec { }; # Run an automated test suite in the given virtual network. - # `driver' is the script that runs the network. - runTests = { driver, pos }: + runTests = { + # the script that runs the network + driver, + # a source position in the format of builtins.unsafeGetAttrPos + # for meta.position + pos, + }: stdenv.mkDerivation { name = "vm-test-run-${driver.testName}"; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 08eb308ec6f70..95c35cb898b71 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -114,6 +114,9 @@ ./programs/autojump.nix ./programs/bandwhich.nix ./programs/bash/bash.nix + ./programs/bash/bash-completion.nix + ./programs/bash/ls-colors.nix + ./programs/bash/undistract-me.nix ./programs/bash-my-aws.nix ./programs/bcc.nix ./programs/browserpass.nix diff --git a/nixos/modules/programs/bash/bash-completion.nix b/nixos/modules/programs/bash/bash-completion.nix new file mode 100644 index 0000000000000..f07b1b636ef92 --- /dev/null +++ b/nixos/modules/programs/bash/bash-completion.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + enable = config.programs.bash.enableCompletion; +in +{ + options = { + programs.bash.enableCompletion = mkEnableOption "Bash completion for all interactive bash shells" // { + default = true; + }; + }; + + config = mkIf enable { + programs.bash.promptPluginInit = '' + # Check whether we're running a version of Bash that has support for + # programmable completion. If we do, enable all modules installed in + # the system and user profile in obsolete /etc/bash_completion.d/ + # directories. Bash loads completions in all + # $XDG_DATA_DIRS/bash-completion/completions/ + # on demand, so they do not need to be sourced here. + if shopt -q progcomp &>/dev/null; then + . "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh" + nullglobStatus=$(shopt -p nullglob) + shopt -s nullglob + for p in $NIX_PROFILES; do + for m in "$p/etc/bash_completion.d/"*; do + . $m + done + done + eval "$nullglobStatus" + unset nullglobStatus p m + fi + ''; + }; +} diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix index 1b3254b54a598..908ab34b08d0b 100644 --- a/nixos/modules/programs/bash/bash.nix +++ b/nixos/modules/programs/bash/bash.nix @@ -11,31 +11,6 @@ let cfg = config.programs.bash; - bashCompletion = optionalString cfg.enableCompletion '' - # Check whether we're running a version of Bash that has support for - # programmable completion. If we do, enable all modules installed in - # the system and user profile in obsolete /etc/bash_completion.d/ - # directories. Bash loads completions in all - # $XDG_DATA_DIRS/bash-completion/completions/ - # on demand, so they do not need to be sourced here. - if shopt -q progcomp &>/dev/null; then - . "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh" - nullglobStatus=$(shopt -p nullglob) - shopt -s nullglob - for p in $NIX_PROFILES; do - for m in "$p/etc/bash_completion.d/"*; do - . $m - done - done - eval "$nullglobStatus" - unset nullglobStatus p m - fi - ''; - - lsColors = optionalString cfg.enableLsColors '' - eval "$(${pkgs.coreutils}/bin/dircolors -b)" - ''; - bashAliases = concatStringsSep "\n" ( mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}") (filterAttrs (k: v: v != null) cfg.shellAliases) @@ -123,20 +98,13 @@ in type = types.lines; }; - enableCompletion = mkOption { - default = true; - description = '' - Enable Bash completion for all interactive bash shells. - ''; - type = types.bool; - }; - - enableLsColors = mkOption { - default = true; + promptPluginInit = mkOption { + default = ""; description = '' - Enable extra colors in directory listings. + Shell script code used to initialise bash prompt plugins. ''; - type = types.bool; + type = types.lines; + internal = true; }; }; @@ -167,8 +135,7 @@ in set +h ${cfg.promptInit} - ${bashCompletion} - ${lsColors} + ${cfg.promptPluginInit} ${bashAliases} ${cfge.interactiveShellInit} diff --git a/nixos/modules/programs/bash/ls-colors.nix b/nixos/modules/programs/bash/ls-colors.nix new file mode 100644 index 0000000000000..254ee14c477d6 --- /dev/null +++ b/nixos/modules/programs/bash/ls-colors.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + enable = config.programs.bash.enableLsColors; +in +{ + options = { + programs.bash.enableLsColors = mkEnableOption "extra colors in directory listings" // { + default = true; + }; + }; + + config = mkIf enable { + programs.bash.promptPluginInit = '' + eval "$(${pkgs.coreutils}/bin/dircolors -b)" + ''; + }; +} diff --git a/nixos/modules/programs/bash/undistract-me.nix b/nixos/modules/programs/bash/undistract-me.nix new file mode 100644 index 0000000000000..378144f598b56 --- /dev/null +++ b/nixos/modules/programs/bash/undistract-me.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.bash.undistractMe; +in +{ + options = { + programs.bash.undistractMe = { + enable = mkEnableOption "notifications when long-running terminal commands complete"; + + playSound = mkEnableOption "notification sounds when long-running terminal commands complete"; + + timeout = mkOption { + default = 10; + description = '' + Number of seconds it would take for a command to be considered long-running. + ''; + type = types.int; + }; + }; + }; + + config = mkIf cfg.enable { + programs.bash.promptPluginInit = '' + export LONG_RUNNING_COMMAND_TIMEOUT=${toString cfg.timeout} + export UDM_PLAY_SOUND=${if cfg.playSound then "1" else "0"} + . "${pkgs.undistract-me}/etc/profile.d/undistract-me.sh" + ''; + }; + + meta = { + maintainers = with maintainers; [ metadark ]; + }; +} diff --git a/nixos/modules/services/misc/airsonic.nix b/nixos/modules/services/misc/airsonic.nix index 5cc2ff7f4bd12..a572f1f6d6f5a 100644 --- a/nixos/modules/services/misc/airsonic.nix +++ b/nixos/modules/services/misc/airsonic.nix @@ -118,7 +118,7 @@ in { ''; serviceConfig = { ExecStart = '' - ${pkgs.jre}/bin/java -Xmx${toString cfg.maxMemory}m \ + ${pkgs.jre8}/bin/java -Xmx${toString cfg.maxMemory}m \ -Dairsonic.home=${cfg.home} \ -Dserver.address=${cfg.listenAddress} \ -Dserver.port=${toString cfg.port} \ diff --git a/nixos/modules/services/networking/bind.nix b/nixos/modules/services/networking/bind.nix index e507e8ce9eebc..b73b2b6268590 100644 --- a/nixos/modules/services/networking/bind.nix +++ b/nixos/modules/services/networking/bind.nix @@ -8,32 +8,37 @@ let bindUser = "named"; - bindZoneOptions = { - name = mkOption { - type = types.str; - description = "Name of the zone."; - }; - master = mkOption { - description = "Master=false means slave server"; - type = types.bool; - }; - file = mkOption { - type = types.either types.str types.path; - description = "Zone file resource records contain columns of data, separated by whitespace, that define the record."; - }; - masters = mkOption { - type = types.listOf types.str; - description = "List of servers for inclusion in stub and secondary zones."; - }; - slaves = mkOption { - type = types.listOf types.str; - description = "Addresses who may request zone transfers."; - default = []; - }; - extraConfig = mkOption { - type = types.str; - description = "Extra zone config to be appended at the end of the zone section."; - default = ""; + bindZoneCoerce = list: builtins.listToAttrs (lib.forEach list (zone: { name = zone.name; value = zone; })); + + bindZoneOptions = { name, config, ... }: { + options = { + name = mkOption { + type = types.str; + default = name; + description = "Name of the zone."; + }; + master = mkOption { + description = "Master=false means slave server"; + type = types.bool; + }; + file = mkOption { + type = types.either types.str types.path; + description = "Zone file resource records contain columns of data, separated by whitespace, that define the record."; + }; + masters = mkOption { + type = types.listOf types.str; + description = "List of servers for inclusion in stub and secondary zones."; + }; + slaves = mkOption { + type = types.listOf types.str; + description = "Addresses who may request zone transfers."; + default = []; + }; + extraConfig = mkOption { + type = types.str; + description = "Extra zone config to be appended at the end of the zone section."; + default = ""; + }; }; }; @@ -84,7 +89,7 @@ let ${extraConfig} }; '') - cfg.zones } + (attrValues cfg.zones) } ''; in @@ -153,18 +158,19 @@ in zones = mkOption { default = []; - type = types.listOf (types.submodule [ { options = bindZoneOptions; } ]); + type = with types; coercedTo (listOf attrs) bindZoneCoerce (attrsOf (types.submodule bindZoneOptions)); description = " List of zones we claim authority over. "; - example = [{ - name = "example.com"; - master = false; - file = "/var/dns/example.com"; - masters = ["192.168.0.1"]; - slaves = []; - extraConfig = ""; - }]; + example = { + "example.com" = { + master = false; + file = "/var/dns/example.com"; + masters = ["192.168.0.1"]; + slaves = []; + extraConfig = ""; + }; + }; }; extraConfig = mkOption { diff --git a/nixos/modules/services/networking/unbound.nix b/nixos/modules/services/networking/unbound.nix index 622c3d8ea434f..a8747e244a9c7 100644 --- a/nixos/modules/services/networking/unbound.nix +++ b/nixos/modules/services/networking/unbound.nix @@ -4,51 +4,28 @@ with lib; let cfg = config.services.unbound; - stateDir = "/var/lib/unbound"; - - access = concatMapStringsSep "\n " (x: "access-control: ${x} allow") cfg.allowedAccess; - - interfaces = concatMapStringsSep "\n " (x: "interface: ${x}") cfg.interfaces; - - isLocalAddress = x: substring 0 3 x == "::1" || substring 0 9 x == "127.0.0.1"; - - forward = - optionalString (any isLocalAddress cfg.forwardAddresses) '' - do-not-query-localhost: no - '' - + optionalString (cfg.forwardAddresses != []) '' - forward-zone: - name: . - '' - + concatMapStringsSep "\n" (x: " forward-addr: ${x}") cfg.forwardAddresses; - - rootTrustAnchorFile = "${stateDir}/root.key"; - - trustAnchor = optionalString cfg.enableRootTrustAnchor - "auto-trust-anchor-file: ${rootTrustAnchorFile}"; - - confFile = pkgs.writeText "unbound.conf" '' - server: - ip-freebind: yes - directory: "${stateDir}" - username: unbound - chroot: "" - pidfile: "" - # when running under systemd there is no need to daemonize - do-daemonize: no - ${interfaces} - ${access} - ${trustAnchor} - ${lib.optionalString (cfg.localControlSocketPath != null) '' - remote-control: - control-enable: yes - control-interface: ${cfg.localControlSocketPath} - ''} - ${cfg.extraConfig} - ${forward} - ''; -in -{ + yesOrNo = v: if v then "yes" else "no"; + + toOption = indent: n: v: "${indent}${toString n}: ${v}"; + + toConf = indent: n: v: + if builtins.isFloat v then (toOption indent n (builtins.toJSON v)) + else if isInt v then (toOption indent n (toString v)) + else if isBool v then (toOption indent n (yesOrNo v)) + else if isString v then (toOption indent n v) + else if isList v then (concatMapStringsSep "\n" (toConf indent n) v) + else if isAttrs v then (concatStringsSep "\n" ( + ["${indent}${n}:"] ++ ( + mapAttrsToList (toConf "${indent} ") v + ) + )) + else throw (traceSeq v "services.unbound.settings: unexpected type"); + + confFile = pkgs.writeText "unbound.conf" (concatStringsSep "\n" ((mapAttrsToList (toConf "") cfg.settings) ++ [""])); + + rootTrustAnchorFile = "${cfg.stateDir}/root.key"; + +in { ###### interface @@ -64,25 +41,30 @@ in description = "The unbound package to use"; }; - allowedAccess = mkOption { - default = [ "127.0.0.0/24" ]; - type = types.listOf types.str; - description = "What networks are allowed to use unbound as a resolver."; + user = mkOption { + type = types.str; + default = "unbound"; + description = "User account under which unbound runs."; }; - interfaces = mkOption { - default = [ "127.0.0.1" ] ++ optional config.networking.enableIPv6 "::1"; - type = types.listOf types.str; - description = '' - What addresses the server should listen on. This supports the interface syntax documented in - <citerefentry><refentrytitle>unbound.conf</refentrytitle><manvolnum>8</manvolnum></citerefentry>. - ''; + group = mkOption { + type = types.str; + default = "unbound"; + description = "Group under which unbound runs."; }; - forwardAddresses = mkOption { - default = []; - type = types.listOf types.str; - description = "What servers to forward queries to."; + stateDir = mkOption { + default = "/var/lib/unbound"; + description = "Directory holding all state for unbound to run."; + }; + + resolveLocalQueries = mkOption { + type = types.bool; + default = true; + description = '' + Whether unbound should resolve local queries (i.e. add 127.0.0.1 to + /etc/resolv.conf). + ''; }; enableRootTrustAnchor = mkOption { @@ -106,23 +88,66 @@ in and group will be <literal>nogroup</literal>. Users that should be permitted to access the socket must be in the - <literal>unbound</literal> group. + <literal>config.services.unbound.group</literal> group. If this option is <literal>null</literal> remote control will not be - configured at all. Unbounds default values apply. + enabled. Unbounds default values apply. ''; }; - extraConfig = mkOption { - default = ""; - type = types.lines; + settings = mkOption { + default = {}; + type = with types; submodule { + + freeformType = let + validSettingsPrimitiveTypes = oneOf [ int str bool float ]; + validSettingsTypes = oneOf [ validSettingsPrimitiveTypes (listOf validSettingsPrimitiveTypes) ]; + settingsType = (attrsOf validSettingsTypes); + in attrsOf (oneOf [ string settingsType (listOf settingsType) ]) + // { description = '' + unbound.conf configuration type. The format consist of an attribute + set of settings. Each settings can be either one value, a list of + values or an attribute set. The allowed values are integers, + strings, booleans or floats. + ''; + }; + + options = { + remote-control.control-enable = mkOption { + type = bool; + default = false; + internal = true; + }; + }; + }; + example = literalExample '' + { + server = { + interface = [ "127.0.0.1" ]; + }; + forward-zone = [ + { + name = "."; + forward-addr = "1.1.1.1@853#cloudflare-dns.com"; + } + { + name = "example.org."; + forward-addr = [ + "1.1.1.1@853#cloudflare-dns.com" + "1.0.0.1@853#cloudflare-dns.com" + ]; + } + ]; + remote-control.control-enable = true; + }; + ''; description = '' - Extra unbound config. See - <citerefentry><refentrytitle>unbound.conf</refentrytitle><manvolnum>8 - </manvolnum></citerefentry>. + Declarative Unbound configuration + See the <citerefentry><refentrytitle>unbound.conf</refentrytitle> + <manvolnum>5</manvolnum></citerefentry> manpage for a list of + available options. ''; }; - }; }; @@ -130,23 +155,56 @@ in config = mkIf cfg.enable { + services.unbound.settings = { + server = { + directory = mkDefault cfg.stateDir; + username = cfg.user; + chroot = ''""''; + pidfile = ''""''; + # when running under systemd there is no need to daemonize + do-daemonize = false; + interface = mkDefault ([ "127.0.0.1" ] ++ (optional config.networking.enableIPv6 "::1")); + access-control = mkDefault ([ "127.0.0.0/8 allow" ] ++ (optional config.networking.enableIPv6 "::1/128 allow")); + auto-trust-anchor-file = mkIf cfg.enableRootTrustAnchor rootTrustAnchorFile; + tls-cert-bundle = mkDefault "/etc/ssl/certs/ca-certificates.crt"; + # prevent race conditions on system startup when interfaces are not yet + # configured + ip-freebind = mkDefault true; + }; + remote-control = { + control-enable = mkDefault false; + control-interface = mkDefault ([ "127.0.0.1" ] ++ (optional config.networking.enableIPv6 "::1")); + server-key-file = mkDefault "${cfg.stateDir}/unbound_server.key"; + server-cert-file = mkDefault "${cfg.stateDir}/unbound_server.pem"; + control-key-file = mkDefault "${cfg.stateDir}/unbound_control.key"; + control-cert-file = mkDefault "${cfg.stateDir}/unbound_control.pem"; + } // optionalAttrs (cfg.localControlSocketPath != null) { + control-enable = true; + control-interface = cfg.localControlSocketPath; + }; + }; + environment.systemPackages = [ cfg.package ]; - users.users.unbound = { - description = "unbound daemon user"; - isSystemUser = true; - group = lib.mkIf (cfg.localControlSocketPath != null) (lib.mkDefault "unbound"); + users.users = mkIf (cfg.user == "unbound") { + unbound = { + description = "unbound daemon user"; + isSystemUser = true; + group = cfg.group; + }; }; - # We need a group so that we can give users access to the configured - # control socket. Unbound allows access to the socket only to the unbound - # user and the primary group. - users.groups = lib.mkIf (cfg.localControlSocketPath != null) { + users.groups = mkIf (cfg.group == "unbound") { unbound = {}; }; - networking.resolvconf.useLocalResolver = mkDefault true; + networking = mkIf cfg.resolveLocalQueries { + resolvconf = { + useLocalResolver = mkDefault true; + }; + networkmanager.dns = "unbound"; + }; environment.etc."unbound/unbound.conf".source = confFile; @@ -156,8 +214,15 @@ in before = [ "nss-lookup.target" ]; wantedBy = [ "multi-user.target" "nss-lookup.target" ]; - preStart = lib.mkIf cfg.enableRootTrustAnchor '' - ${cfg.package}/bin/unbound-anchor -a ${rootTrustAnchorFile} || echo "Root anchor updated!" + path = mkIf cfg.settings.remote-control.control-enable [ pkgs.openssl ]; + + preStart = '' + ${optionalString cfg.enableRootTrustAnchor '' + ${cfg.package}/bin/unbound-anchor -a ${rootTrustAnchorFile} || echo "Root anchor updated!" + ''} + ${optionalString cfg.settings.remote-control.control-enable '' + ${cfg.package}/bin/unbound-control-setup -d ${cfg.stateDir} + ''} ''; restartTriggers = [ @@ -181,8 +246,8 @@ in "CAP_SYS_RESOURCE" ]; - User = "unbound"; - Group = lib.mkIf (cfg.localControlSocketPath != null) (lib.mkDefault "unbound"); + User = cfg.user; + Group = cfg.group; MemoryDenyWriteExecute = true; NoNewPrivileges = true; @@ -211,9 +276,29 @@ in RestrictNamespaces = true; LockPersonality = true; RestrictSUIDSGID = true; + + Restart = "on-failure"; + RestartSec = "5s"; }; }; - # If networkmanager is enabled, ask it to interface with unbound. - networking.networkmanager.dns = "unbound"; }; + + imports = [ + (mkRenamedOptionModule [ "services" "unbound" "interfaces" ] [ "services" "unbound" "settings" "server" "interface" ]) + (mkChangedOptionModule [ "services" "unbound" "allowedAccess" ] [ "services" "unbound" "settings" "server" "access-control" ] ( + config: map (value: "${value} allow") (getAttrFromPath [ "services" "unbound" "allowedAccess" ] config) + )) + (mkRemovedOptionModule [ "services" "unbound" "forwardAddresses" ] '' + Add a new setting: + services.unbound.settings.forward-zone = [{ + name = "."; + forward-addr = [ # Your current services.unbound.forwardAddresses ]; + }]; + If any of those addresses are local addresses (127.0.0.1 or ::1), you must + also set services.unbound.settings.server.do-not-query-localhost to false. + '') + (mkRemovedOptionModule [ "services" "unbound" "extraConfig" ] '' + You can use services.unbound.settings to add any configuration you want. + '') + ]; } diff --git a/nixos/modules/services/web-apps/bookstack.nix b/nixos/modules/services/web-apps/bookstack.nix index 83d05ffbad9a0..34a31af9c9da1 100644 --- a/nixos/modules/services/web-apps/bookstack.nix +++ b/nixos/modules/services/web-apps/bookstack.nix @@ -292,6 +292,8 @@ in { WorkingDirectory = "${bookstack}"; }; script = '' + # set permissions + umask 077 # create .env file echo " APP_KEY=base64:$(head -n1 ${cfg.appKeyFile}) @@ -317,13 +319,14 @@ in { ${optionalString (cfg.nginx.addSSL || cfg.nginx.forceSSL || cfg.nginx.onlySSL || cfg.nginx.enableACME) "SESSION_SECURE_COOKIE=true"} ${toString cfg.extraConfig} " > "${cfg.dataDir}/.env" - # set permissions - chmod 700 "${cfg.dataDir}/.env" # migrate db ${pkgs.php}/bin/php artisan migrate --force - # create caches + # clear & create caches (needed in case of update) + ${pkgs.php}/bin/php artisan cache:clear + ${pkgs.php}/bin/php artisan config:clear + ${pkgs.php}/bin/php artisan view:clear ${pkgs.php}/bin/php artisan config:cache ${pkgs.php}/bin/php artisan route:cache ${pkgs.php}/bin/php artisan view:cache diff --git a/nixos/tests/airsonic.nix b/nixos/tests/airsonic.nix new file mode 100644 index 0000000000000..59bd84877c61c --- /dev/null +++ b/nixos/tests/airsonic.nix @@ -0,0 +1,32 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + name = "airsonic"; + meta = with pkgs.lib.maintainers; { + maintainers = [ sumnerevans ]; + }; + + machine = + { pkgs, ... }: + { + services.airsonic = { + enable = true; + maxMemory = 800; + }; + + # Airsonic is a Java application, and unfortunately requires a significant + # amount of memory. + virtualisation.memorySize = 1024; + }; + + testScript = '' + def airsonic_is_up(_) -> bool: + return machine.succeed("curl --fail http://localhost:4040/login") + + + machine.start() + machine.wait_for_unit("airsonic.service") + machine.wait_for_open_port(4040) + + with machine.nested("Waiting for UI to work"): + retry(airsonic_is_up) + ''; +}) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 718bb622612c5..81feedf5c35b2 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -24,6 +24,7 @@ in _3proxy = handleTest ./3proxy.nix {}; acme = handleTest ./acme.nix {}; agda = handleTest ./agda.nix {}; + airsonic = handleTest ./airsonic.nix {}; amazon-init-shell = handleTest ./amazon-init-shell.nix {}; ammonite = handleTest ./ammonite.nix {}; apparmor = handleTest ./apparmor.nix {}; diff --git a/nixos/tests/jellyfin.nix b/nixos/tests/jellyfin.nix index 65360624d4875..f8c2429a7b8d8 100644 --- a/nixos/tests/jellyfin.nix +++ b/nixos/tests/jellyfin.nix @@ -1,16 +1,156 @@ -import ./make-test-python.nix ({ lib, ...}: - -{ - name = "jellyfin"; - meta.maintainers = with lib.maintainers; [ minijackson ]; - - machine = - { ... }: - { services.jellyfin.enable = true; }; - - testScript = '' - machine.wait_for_unit("jellyfin.service") - machine.wait_for_open_port(8096) - machine.succeed("curl --fail http://localhost:8096/") - ''; -}) +import ./make-test-python.nix ({ lib, pkgs, ... }: + + { + name = "jellyfin"; + meta.maintainers = with lib.maintainers; [ minijackson ]; + + machine = + { ... }: + { + services.jellyfin.enable = true; + environment.systemPackages = with pkgs; [ ffmpeg ]; + }; + + # Documentation of the Jellyfin API: https://api.jellyfin.org/ + # Beware, this link can be resource intensive + testScript = + let + payloads = { + auth = pkgs.writeText "auth.json" (builtins.toJSON { + Username = "jellyfin"; + }); + empty = pkgs.writeText "empty.json" (builtins.toJSON { }); + }; + in + '' + import json + import time + from urllib.parse import urlencode + + machine.wait_for_unit("jellyfin.service") + machine.wait_for_open_port(8096) + machine.succeed("curl --fail http://localhost:8096/") + + machine.wait_until_succeeds("curl --fail http://localhost:8096/health | grep Healthy") + + auth_header = 'MediaBrowser Client="NixOS Integration Tests", DeviceId="1337", Device="Apple II", Version="20.09"' + + + def api_get(path): + return f"curl --fail 'http://localhost:8096{path}' -H 'X-Emby-Authorization:{auth_header}'" + + + def api_post(path, json_file=None): + if json_file: + return f"curl --fail -X post 'http://localhost:8096{path}' -d '@{json_file}' -H Content-Type:application/json -H 'X-Emby-Authorization:{auth_header}'" + else: + return f"curl --fail -X post 'http://localhost:8096{path}' -H 'X-Emby-Authorization:{auth_header}'" + + + with machine.nested("Wizard completes"): + machine.wait_until_succeeds(api_get("/Startup/Configuration")) + machine.succeed(api_get("/Startup/FirstUser")) + machine.succeed(api_post("/Startup/Complete")) + + with machine.nested("Can login"): + auth_result = machine.succeed( + api_post( + "/Users/AuthenticateByName", + "${payloads.auth}", + ) + ) + auth_result = json.loads(auth_result) + auth_token = auth_result["AccessToken"] + auth_header += f", Token={auth_token}" + + sessions_result = machine.succeed(api_get("/Sessions")) + sessions_result = json.loads(sessions_result) + + this_session = [ + session for session in sessions_result if session["DeviceId"] == "1337" + ] + if len(this_session) != 1: + raise Exception("Session not created") + + me = machine.succeed(api_get("/Users/Me")) + me = json.loads(me)["Id"] + + with machine.nested("Can add library"): + tempdir = machine.succeed("mktemp -d -p /var/lib/jellyfin").strip() + machine.succeed(f"chmod 755 '{tempdir}'") + + # Generate a dummy video that we can test later + videofile = f"{tempdir}/Big Buck Bunny (2008) [1080p].mkv" + machine.succeed(f"ffmpeg -f lavfi -i testsrc2=duration=5 '{videofile}'") + + add_folder_query = urlencode( + { + "name": "My Library", + "collectionType": "Movies", + "paths": tempdir, + "refreshLibrary": "true", + } + ) + + machine.succeed( + api_post( + f"/Library/VirtualFolders?{add_folder_query}", + "${payloads.empty}", + ) + ) + + + def is_refreshed(_): + folders = machine.succeed(api_get(f"/Library/VirtualFolders")) + folders = json.loads(folders) + print(folders) + return all(folder["RefreshStatus"] == "Idle" for folder in folders) + + + retry(is_refreshed) + + with machine.nested("Can identify videos"): + items = [] + + # For some reason, having the folder refreshed doesn't mean the + # movie was scanned + def has_movie(_): + global items + + items = machine.succeed( + api_get(f"/Users/{me}/Items?IncludeItemTypes=Movie&Recursive=true") + ) + items = json.loads(items)["Items"] + + return len(items) == 1 + + retry(has_movie) + + video = items[0]["Id"] + + item_info = machine.succeed(api_get(f"/Users/{me}/Items/{video}")) + item_info = json.loads(item_info) + + if item_info["Name"] != "Big Buck Bunny": + raise Exception("Jellyfin failed to properly identify file") + + with machine.nested("Can read videos"): + media_source_id = item_info["MediaSources"][0]["Id"] + + machine.succeed( + "ffmpeg" + + f" -headers 'X-Emby-Authorization:{auth_header}'" + + f" -i http://localhost:8096/Videos/{video}/master.m3u8?mediaSourceId={media_source_id}" + + f" /tmp/test.mkv" + ) + + duration = machine.succeed( + "ffprobe /tmp/test.mkv" + + " -show_entries format=duration" + + " -of compact=print_section=0:nokey=1" + ) + + if duration.strip() != "5.000000": + raise Exception("Downloaded video has wrong duration") + ''; + }) diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 21419c0d081a3..2b17d0ff78ff9 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -334,13 +334,48 @@ let services.knot = { enable = true; extraArgs = [ "-v" ]; + extraConfig = '' + server: + listen: 127.0.0.1@53 + + template: + - id: default + global-module: mod-stats + dnssec-signing: off + zonefile-sync: -1 + journal-db: /var/lib/knot/journal + kasp-db: /var/lib/knot/kasp + timer-db: /var/lib/knot/timer + zonefile-load: difference + storage: ${pkgs.buildEnv { + name = "foo"; + paths = [ + (pkgs.writeTextDir "test.zone" '' + @ SOA ns.example.com. noc.example.com. 2019031301 86400 7200 3600000 172800 + @ NS ns1 + @ NS ns2 + ns1 A 192.168.0.1 + '') + ]; + }} + + mod-stats: + - id: custom + edns-presence: on + query-type: on + + zone: + - domain: test + file: test.zone + module: mod-stats/custom + ''; }; }; exporterTest = '' wait_for_unit("knot.service") wait_for_unit("prometheus-knot-exporter.service") wait_for_open_port(9433) - succeed("curl -sSf 'localhost:9433' | grep -q 'knot_server_zone_count 0.0'") + succeed("curl -sSf 'localhost:9433' | grep -q 'knot_server_zone_count 1.0'") ''; }; diff --git a/nixos/tests/unbound.nix b/nixos/tests/unbound.nix index ca9718ac633eb..e24c3ef6c99d2 100644 --- a/nixos/tests/unbound.nix +++ b/nixos/tests/unbound.nix @@ -61,13 +61,16 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: services.unbound = { enable = true; - interfaces = [ "192.168.0.1" "fd21::1" "::1" "127.0.0.1" ]; - allowedAccess = [ "192.168.0.0/24" "fd21::/64" "::1" "127.0.0.0/8" ]; - extraConfig = '' - server: - local-data: "example.local. IN A 1.2.3.4" - local-data: "example.local. IN AAAA abcd::eeff" - ''; + settings = { + server = { + interface = [ "192.168.0.1" "fd21::1" "::1" "127.0.0.1" ]; + access-control = [ "192.168.0.0/24 allow" "fd21::/64 allow" "::1 allow" "127.0.0.0/8 allow" ]; + local-data = [ + ''"example.local. IN A 1.2.3.4"'' + ''"example.local. IN AAAA abcd::eeff"'' + ]; + }; + }; }; }; @@ -90,19 +93,25 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: services.unbound = { enable = true; - allowedAccess = [ "192.168.0.0/24" "fd21::/64" "::1" "127.0.0.0/8" ]; - interfaces = [ "::1" "127.0.0.1" "192.168.0.2" "fd21::2" - "192.168.0.2@853" "fd21::2@853" "::1@853" "127.0.0.1@853" - "192.168.0.2@443" "fd21::2@443" "::1@443" "127.0.0.1@443" ]; - forwardAddresses = [ - (lib.head nodes.authoritative.config.networking.interfaces.eth1.ipv6.addresses).address - (lib.head nodes.authoritative.config.networking.interfaces.eth1.ipv4.addresses).address - ]; - extraConfig = '' - server: - tls-service-pem: ${cert}/cert.pem - tls-service-key: ${cert}/key.pem - ''; + settings = { + server = { + interface = [ "::1" "127.0.0.1" "192.168.0.2" "fd21::2" + "192.168.0.2@853" "fd21::2@853" "::1@853" "127.0.0.1@853" + "192.168.0.2@443" "fd21::2@443" "::1@443" "127.0.0.1@443" ]; + access-control = [ "192.168.0.0/24 allow" "fd21::/64 allow" "::1 allow" "127.0.0.0/8 allow" ]; + tls-service-pem = "${cert}/cert.pem"; + tls-service-key = "${cert}/key.pem"; + }; + forward-zone = [ + { + name = "."; + forward-addr = [ + (lib.head nodes.authoritative.config.networking.interfaces.eth1.ipv6.addresses).address + (lib.head nodes.authoritative.config.networking.interfaces.eth1.ipv4.addresses).address + ]; + } + ]; + }; }; }; @@ -122,12 +131,14 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: services.unbound = { enable = true; - allowedAccess = [ "::1" "127.0.0.0/8" ]; - interfaces = [ "::1" "127.0.0.1" ]; + settings = { + server = { + interface = [ "::1" "127.0.0.1" ]; + access-control = [ "::1 allow" "127.0.0.0/8 allow" ]; + }; + include = "/etc/unbound/extra*.conf"; + }; localControlSocketPath = "/run/unbound/unbound.ctl"; - extraConfig = '' - include: "/etc/unbound/extra*.conf" - ''; }; users.users = { @@ -143,12 +154,13 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: unauthorizeduser = { isSystemUser = true; }; }; + # Used for testing configuration reloading environment.etc = { "unbound-extra1.conf".text = '' forward-zone: - name: "example.local." - forward-addr: ${(lib.head nodes.resolver.config.networking.interfaces.eth1.ipv6.addresses).address} - forward-addr: ${(lib.head nodes.resolver.config.networking.interfaces.eth1.ipv4.addresses).address} + name: "example.local." + forward-addr: ${(lib.head nodes.resolver.config.networking.interfaces.eth1.ipv6.addresses).address} + forward-addr: ${(lib.head nodes.resolver.config.networking.interfaces.eth1.ipv4.addresses).address} ''; "unbound-extra2.conf".text = '' auth-zone: diff --git a/pkgs/applications/editors/emacs-modes/melpa-packages.nix b/pkgs/applications/editors/emacs-modes/melpa-packages.nix index e5e2bac964f37..5a1c9168bc471 100644 --- a/pkgs/applications/editors/emacs-modes/melpa-packages.nix +++ b/pkgs/applications/editors/emacs-modes/melpa-packages.nix @@ -362,6 +362,7 @@ let zmq = super.zmq.overrideAttrs (old: { stripDebugList = [ "share" ]; preBuild = '' + export EZMQ_LIBDIR=$(mktemp -d) make ''; nativeBuildInputs = [ @@ -372,7 +373,7 @@ let (pkgs.zeromq.override { enableDrafts = true; }) ]; postInstall = '' - mv $out/share/emacs/site-lisp/elpa/zmq-*/src/.libs/emacs-zmq.so $out/share/emacs/site-lisp/elpa/zmq-* + mv $EZMQ_LIBDIR/emacs-zmq.* $out/share/emacs/site-lisp/elpa/zmq-* rm -r $out/share/emacs/site-lisp/elpa/zmq-*/src rm $out/share/emacs/site-lisp/elpa/zmq-*/Makefile ''; diff --git a/pkgs/applications/misc/mako/default.nix b/pkgs/applications/misc/mako/default.nix index a845a767b2aa4..f28292cb2f16e 100644 --- a/pkgs/applications/misc/mako/default.nix +++ b/pkgs/applications/misc/mako/default.nix @@ -5,19 +5,22 @@ stdenv.mkDerivation rec { pname = "mako"; - version = "1.4.1"; + version = "1.5"; src = fetchFromGitHub { owner = "emersion"; repo = pname; rev = "v${version}"; - sha256 = "0hwvibpnrximb628w9dsfjpi30b5jy7nfkm4d94z5vhp78p43vxh"; + sha256 = "0f92krcgybl4113g2gawf7lcbh1fss7bq4cx81h1zyn7yvxlwx2b"; }; nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-protocols wrapGAppsHook ]; buildInputs = [ systemd pango cairo gdk-pixbuf wayland ]; - mesonFlags = [ "-Dzsh-completions=true" ]; + mesonFlags = [ + "-Dzsh-completions=true" + "-Dsd-bus-provider=libsystemd" + ]; meta = with lib; { description = "A lightweight Wayland notification daemon"; diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix index c4a5508b7537f..dcac873b849d6 100644 --- a/pkgs/applications/networking/browsers/chromium/browser.nix +++ b/pkgs/applications/networking/browsers/chromium/browser.nix @@ -85,6 +85,7 @@ mkChromiumDerivation (base: rec { else [ primeos thefloweringash bendlas ]; license = if enableWideVine then licenses.unfree else licenses.bsd3; platforms = platforms.linux; + mainProgram = "chromium"; hydraPlatforms = if (channel == "stable" || channel == "ungoogled-chromium") then ["aarch64-linux" "x86_64-linux"] else []; diff --git a/pkgs/applications/science/physics/xfitter/default.nix b/pkgs/applications/science/physics/xfitter/default.nix index d0a0585e69f18..4390826ccee02 100644 --- a/pkgs/applications/science/physics/xfitter/default.nix +++ b/pkgs/applications/science/physics/xfitter/default.nix @@ -39,9 +39,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ gfortran which ]; buildInputs = - [ apfel apfelgrid applgrid blas lhapdf lapack mela root5 qcdnum libtirpc ] + [ apfel apfelgrid applgrid blas lhapdf lapack mela root5 qcdnum ] # pdf2yaml requires fmemopen and open_memstream which are not readily available on Darwin ++ lib.optional (!stdenv.isDarwin) libyaml + ++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc ; propagatedBuildInputs = [ lynx ]; @@ -49,8 +50,8 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; - NIX_LDFLAGS = [ "-ltirpc" ]; + NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc"; + NIX_LDFLAGS = lib.optional (stdenv.hostPlatform.libc == "glibc") "-ltirpc"; meta = with lib; { description = "The xFitter project is an open source QCD fit framework ready to extract PDFs and assess the impact of new data"; diff --git a/pkgs/applications/version-management/git-and-tools/git-machete/default.nix b/pkgs/applications/version-management/git-and-tools/git-machete/default.nix index 99772f60bc50a..f93947d0515b7 100644 --- a/pkgs/applications/version-management/git-and-tools/git-machete/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-machete/default.nix @@ -4,11 +4,11 @@ buildPythonApplication rec { pname = "git-machete"; - version = "3.1.0"; + version = "3.1.1"; src = fetchPypi { inherit pname version; - sha256 = "0bb6ap8sdp4ad0xkh3y8vj46a363g5gdw0dzf9ycw0z9ah8ispfx"; + sha256 = "00f1rq80vya464dkvf3mzs9zpvkz15ki8srwg08snsm5kb7amwlm"; }; nativeBuildInputs = [ installShellFiles pbr ]; diff --git a/pkgs/applications/video/kodi-packages/inputstream-ffmpegdirect/default.nix b/pkgs/applications/video/kodi-packages/inputstream-ffmpegdirect/default.nix index f6ab6d2e95a9e..10912e489e278 100644 --- a/pkgs/applications/video/kodi-packages/inputstream-ffmpegdirect/default.nix +++ b/pkgs/applications/video/kodi-packages/inputstream-ffmpegdirect/default.nix @@ -3,13 +3,13 @@ buildKodiBinaryAddon rec { pname = "inputstream-ffmpegdirect"; namespace = "inputstream.ffmpegdirect"; - version = "1.21.1"; + version = "1.21.2"; src = fetchFromGitHub { owner = "xbmc"; repo = "inputstream.ffmpegdirect"; rev = "${version}-${rel}"; - sha256 = "1x5gj7iq74ysyfrzvp135m0pjz47zamcgw1v1334xd7xcx5q178p"; + sha256 = "sha256-FXtjR/4/f434gp78PBSt+QrYtMYcnljO3Htxss/wH7U="; }; extraBuildInputs = [ bzip2 zlib kodi.ffmpeg ]; diff --git a/pkgs/applications/video/kodi-packages/pvr-iptvsimple/default.nix b/pkgs/applications/video/kodi-packages/pvr-iptvsimple/default.nix index 74c5973da5401..67e7b8bbc2756 100644 --- a/pkgs/applications/video/kodi-packages/pvr-iptvsimple/default.nix +++ b/pkgs/applications/video/kodi-packages/pvr-iptvsimple/default.nix @@ -6,13 +6,13 @@ buildKodiBinaryAddon rec { pname = "pvr-iptvsimple"; namespace = "pvr.iptvsimple"; - version = "7.6.1"; + version = "7.6.2"; src = fetchFromGitHub { owner = "kodi-pvr"; repo = "pvr.iptvsimple"; rev = "${version}-${rel}"; - sha256 = "1g1ildl2l6nl63qbfhijcbmvr6z84nqhjsy2lgx3dy25cmcqzir9"; + sha256 = "sha256-MdgPUKkbqNt/WKUTrYNetlyUBQcYLSn0J8EHH2Z9I+g="; }; extraBuildInputs = [ diff --git a/pkgs/development/python-modules/authcaptureproxy/default.nix b/pkgs/development/python-modules/authcaptureproxy/default.nix new file mode 100644 index 0000000000000..0f1f6d046463a --- /dev/null +++ b/pkgs/development/python-modules/authcaptureproxy/default.nix @@ -0,0 +1,60 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, aiohttp +, beautifulsoup4 +, httpx +, importlib-metadata +, multidict +, typer +, yarl +, pytest-asyncio +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "authcaptureproxy"; + version = "1.0.1"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "alandtse"; + repo = "auth_capture_proxy"; + rev = "v${version}"; + sha256 = "1fbrmh6qa3dm3q3zdxaa0fls94wardbcvnjgwxk686wpjgs1xrs4"; + }; + + postPatch = '' + # https://github.com/alandtse/auth_capture_proxy/issues/14 + substituteInPlace pyproject.toml --replace \ + "poetry.masonry.api" \ + "poetry.core.masonry.api" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + beautifulsoup4 + httpx + importlib-metadata + multidict + typer + yarl + ]; + + checkInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + meta = with lib; { + description = "A proxy to capture authentication information from a webpage"; + homepage = "https://github.com/alandtse/auth_capture_proxy"; + license = licenses.asl20; + maintainers = with maintainers; [ graham33 hexa ]; + }; +} diff --git a/pkgs/development/python-modules/bellows/default.nix b/pkgs/development/python-modules/bellows/default.nix index 79bcaa91cbe7e..7df23d1a25aab 100644 --- a/pkgs/development/python-modules/bellows/default.nix +++ b/pkgs/development/python-modules/bellows/default.nix @@ -14,13 +14,13 @@ buildPythonPackage rec { pname = "bellows"; - version = "0.23.1"; + version = "0.24.0"; src = fetchFromGitHub { owner = "zigpy"; repo = "bellows"; rev = version; - sha256 = "sha256-c9rKRmGMlYrzVQmUuM9P3c/Jm4QVM2aBRSZ0OkyrPTY="; + sha256 = "00sa4x1qzv861z9d83lk4lp1g2pqiv9hpawj92w4qn1wnqxbz6rw"; }; prePatch = '' diff --git a/pkgs/development/python-modules/flask-httpauth/default.nix b/pkgs/development/python-modules/flask-httpauth/default.nix index e5d55a2b9b5f9..ba8e0d0f11e63 100644 --- a/pkgs/development/python-modules/flask-httpauth/default.nix +++ b/pkgs/development/python-modules/flask-httpauth/default.nix @@ -1,16 +1,22 @@ -{ lib, buildPythonPackage, fetchPypi, flask }: +{ lib, python, buildPythonPackage, fetchPypi, flask }: buildPythonPackage rec { pname = "Flask-HTTPAuth"; - version = "4.2.0"; + version = "4.3.0"; src = fetchPypi { inherit pname version; - sha256 = "8c7e49e53ce7dc14e66fe39b9334e4b7ceb8d0b99a6ba1c3562bb528ef9da84a"; + sha256 = "05j1mckwhgicrlj4j7ni2rhcf9w4i7phll06jbjjyvs3rj1l4q1f"; }; propagatedBuildInputs = [ flask ]; + pythonImportsCheck = [ "flask_httpauth" ]; + + checkPhase = '' + ${python.interpreter} -m unittest discover + ''; + meta = with lib; { description = "Extension that provides HTTP authentication for Flask routes"; homepage = "https://github.com/miguelgrinberg/Flask-HTTPAuth"; diff --git a/pkgs/development/python-modules/pysmappee/default.nix b/pkgs/development/python-modules/pysmappee/default.nix index c845f1bf5f0dd..c053e5592282d 100644 --- a/pkgs/development/python-modules/pysmappee/default.nix +++ b/pkgs/development/python-modules/pysmappee/default.nix @@ -11,14 +11,14 @@ buildPythonPackage rec { pname = "pysmappee"; - version = "0.2.24"; + version = "0.2.25"; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "smappee"; repo = pname; rev = version; - sha256 = "sha256-M1qzwGf8q4WgkEL0nK1yjn3JSBbP7mr75IV45Oa+ypM="; + sha256 = "0ld3pb86dq61fcvr6zigdz1vjjcwf7izzkajyg82nmb508a570d7"; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/pysonos/default.nix b/pkgs/development/python-modules/pysonos/default.nix index 308dd4e7f25b6..3219bd53ac1f4 100644 --- a/pkgs/development/python-modules/pysonos/default.nix +++ b/pkgs/development/python-modules/pysonos/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "pysonos"; - version = "0.0.43"; + version = "0.0.44"; disabled = !isPy3k; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "amelchio"; repo = pname; rev = "v${version}"; - sha256 = "sha256-OobKlAymXXvQH6m77Uqn2eoTlWgs8EBxYIDFJ5wwMKA="; + sha256 = "108818mkb037zs4ikilrskfppcbmqslsm6zaxmy8pphjh7c299mz"; }; propagatedBuildInputs = [ ifaddr requests xmltodict ]; diff --git a/pkgs/development/python-modules/simplisafe-python/default.nix b/pkgs/development/python-modules/simplisafe-python/default.nix index 5b8925b0a4c6a..9592d37fed0ad 100644 --- a/pkgs/development/python-modules/simplisafe-python/default.nix +++ b/pkgs/development/python-modules/simplisafe-python/default.nix @@ -18,7 +18,7 @@ buildPythonPackage rec { pname = "simplisafe-python"; - version = "9.6.9"; + version = "9.6.10"; format = "pyproject"; disabled = pythonOlder "3.6"; @@ -26,7 +26,7 @@ buildPythonPackage rec { owner = "bachya"; repo = pname; rev = version; - sha256 = "1q5w5pvrgj94bzd5wig79l4hipkfrcdah54rvwyi7b8q46gw77sg"; + sha256 = "0cc5kxxishxhkg1nqmgbh36yxs8yjfynmimzjnaqkqfrs9iq46mr"; }; nativeBuildInputs = [ poetry-core ]; diff --git a/pkgs/development/python-modules/teslajsonpy/default.nix b/pkgs/development/python-modules/teslajsonpy/default.nix index 59af2b33d2b9c..750b070804c31 100644 --- a/pkgs/development/python-modules/teslajsonpy/default.nix +++ b/pkgs/development/python-modules/teslajsonpy/default.nix @@ -1,10 +1,12 @@ { lib , aiohttp +, authcaptureproxy , backoff , beautifulsoup4 , buildPythonPackage , fetchFromGitHub , fetchpatch +, poetry-core , pytest-asyncio , pytestCheckHook , wrapt @@ -12,24 +14,22 @@ buildPythonPackage rec { pname = "teslajsonpy"; - version = "0.11.5"; + version = "0.18.3"; + format = "pyproject"; src = fetchFromGitHub { owner = "zabuldon"; repo = pname; rev = "v${version}"; - sha256 = "sha256-s0IZ1UNldYddaR3zJoYS6ey8Kjxd1fr4fOwf0gNNbow="; + sha256 = "1hdc5gm6dg1vw6qfs3z6mg2m94scrvjphj0lin6pi8n3zqj1h26k"; }; - patches = [ - (fetchpatch { - name = "dont-use-dummpy-module-bs4.patch"; - url = "https://github.com/zabuldon/teslajsonpy/pull/138/commits/f5a788e47d8338c8ebb06d954f802ba1ec614db3.patch"; - sha256 = "0rws7fhxmca8d5w0bkygx8scvzah3yvb3yfhn05qmp73mn3pmcb3"; - }) + nativeBuildInputs = [ + poetry-core ]; propagatedBuildInputs = [ + authcaptureproxy aiohttp backoff beautifulsoup4 diff --git a/pkgs/development/python-modules/yeelight/default.nix b/pkgs/development/python-modules/yeelight/default.nix index 9d435c1cce6b0..41ad75c59883b 100644 --- a/pkgs/development/python-modules/yeelight/default.nix +++ b/pkgs/development/python-modules/yeelight/default.nix @@ -9,14 +9,14 @@ buildPythonPackage rec { pname = "yeelight"; - version = "0.6.1"; + version = "0.6.2"; disabled = pythonOlder "3.4"; src = fetchFromGitLab { owner = "stavros"; repo = "python-yeelight"; rev = "v${version}"; - sha256 = "sha256-LB7A8E22hyqhVBElrOwtC3IPNkyQkU7ZJ1ScqaXQ6zs="; + sha256 = "0v0i0s8d5z6b63f2sy42wf85drdzrzswlm1hknzr7v6lfr52pwwm"; }; propagatedBuildInputs = [ @@ -35,7 +35,7 @@ buildPythonPackage rec { meta = with lib; { description = "Python library for controlling YeeLight RGB bulbs"; homepage = "https://gitlab.com/stavros/python-yeelight/"; - license = licenses.asl20; + license = licenses.bsd2; maintainers = with maintainers; [ nyanloutre ]; }; } diff --git a/pkgs/development/tools/rep/default.nix b/pkgs/development/tools/rep/default.nix index bc73c39277714..0b1294abd1efa 100644 --- a/pkgs/development/tools/rep/default.nix +++ b/pkgs/development/tools/rep/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "rep"; - version = "0.2.1"; + version = "0.2.2"; src = fetchFromGitHub { owner = "eraserhd"; repo = pname; rev = "v${version}"; - sha256 = "1p0dbaj7f4irzzw1m44x3b3j3jjij9i4rs83wkrpiamlq61077di"; + sha256 = "pqmISVm3rYGxRuwKieVpRwXE8ufWnBHEA6h2hrob51s="; }; nativeBuildInputs = [ diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 960535b5ec64b..c836d85ac9bdb 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -389,6 +389,7 @@ in with py.pkgs; buildPythonApplication rec { "tasmota" "tcp" "template" + "tesla" "threshold" "time_date" "timer" diff --git a/pkgs/servers/misc/airsonic/default.nix b/pkgs/servers/misc/airsonic/default.nix index bd8310bc74f7c..8fba050ffade9 100644 --- a/pkgs/servers/misc/airsonic/default.nix +++ b/pkgs/servers/misc/airsonic/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, nixosTests }: stdenv.mkDerivation rec { pname = "airsonic"; @@ -14,6 +14,10 @@ stdenv.mkDerivation rec { cp "$src" "$out/webapps/airsonic.war" ''; + passthru.tests = { + airsonic-starts = nixosTests.airsonic; + }; + meta = with lib; { description = "Personal media streamer"; homepage = "https://airsonic.github.io"; diff --git a/pkgs/servers/monitoring/prometheus/knot-exporter.nix b/pkgs/servers/monitoring/prometheus/knot-exporter.nix index 9d99685b5691b..42b6047d3d4fb 100644 --- a/pkgs/servers/monitoring/prometheus/knot-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/knot-exporter.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, lib, python3, nixosTests }: +{ stdenv, fetchFromGitHub, lib, python3, nixosTests, fetchpatch }: stdenv.mkDerivation rec { pname = "knot-exporter"; @@ -11,6 +11,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-4au4lpaq3jcqC2JXdCcf8h+YN8Nmm4eE0kZwA+1rWlc="; }; + patches = [ + # Fixes a crash with all metrics enabled. See + # https://github.com/ghedo/knot_exporter/pull/6 for further context. + (fetchpatch { + url = "https://github.com/ghedo/knot_exporter/commit/2317476e080369450ae51a707ccd30d4b89d680f.patch"; + sha256 = "sha256-yEPu8EE1V/draNx9DeMrPj+bMfJRxauweo33dITl4AA="; + }) + ]; + dontBuild = true; nativeBuildInputs = [ python3.pkgs.wrapPython ]; diff --git a/pkgs/servers/web-apps/bookstack/default.nix b/pkgs/servers/web-apps/bookstack/default.nix index 9ab47ace6ad62..761738ca85451 100644 --- a/pkgs/servers/web-apps/bookstack/default.nix +++ b/pkgs/servers/web-apps/bookstack/default.nix @@ -15,13 +15,13 @@ let in package.override rec { name = "bookstack"; - version = "0.31.7"; + version = "21.04.3"; src = fetchFromGitHub { owner = "bookstackapp"; repo = name; rev = "v${version}"; - sha256 = "1jak6g2q4zbr0gxqj0bqhks687whmmw8ylzwm4saws7ikcxkwna4"; + sha256 = "1vkl0v3c5q0734xvvqinq4zikhy37wjys6nj1h9qdbbka0h39592"; }; meta = with lib; { diff --git a/pkgs/servers/web-apps/bookstack/php-packages.nix b/pkgs/servers/web-apps/bookstack/php-packages.nix index 5edd0b68e8681..8791a4293e83f 100644 --- a/pkgs/servers/web-apps/bookstack/php-packages.nix +++ b/pkgs/servers/web-apps/bookstack/php-packages.nix @@ -5,20 +5,20 @@ let "aws/aws-sdk-php" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "aws-aws-sdk-php-3e6143f5c12986d727307d5d19d6aec21575d903"; + name = "aws-aws-sdk-php-0aa83b522d5ffa794c02e7411af87a0e241a3082"; src = fetchurl { - url = https://api.github.com/repos/aws/aws-sdk-php/zipball/3e6143f5c12986d727307d5d19d6aec21575d903; - sha256 = "16hbw8gqscbc3bcvnfdsll6x1653lq2s4dga3d5jbpczil3ws9yb"; + url = https://api.github.com/repos/aws/aws-sdk-php/zipball/0aa83b522d5ffa794c02e7411af87a0e241a3082; + sha256 = "03qahdj01bz76aar21limham7xnv5r0d61gfk1fph8ljf2gbg33i"; }; }; }; "barryvdh/laravel-dompdf" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "barryvdh-laravel-dompdf-30310e0a675462bf2aa9d448c8dcbf57fbcc517d"; + name = "barryvdh-laravel-dompdf-5b99e1f94157d74e450f4c97e8444fcaffa2144b"; src = fetchurl { - url = https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/30310e0a675462bf2aa9d448c8dcbf57fbcc517d; - sha256 = "1fnan9b2g4xhqqvlfsn3alb4nx5jjlrapgiad2kca13b3gizv7zr"; + url = https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/5b99e1f94157d74e450f4c97e8444fcaffa2144b; + sha256 = "1r82fzrnjrjy5jgpyc071miiw1rwhwys9ccj81gs3yydq9hi4crw"; }; }; }; @@ -45,10 +45,20 @@ let "doctrine/dbal" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "doctrine-dbal-47433196b6390d14409a33885ee42b6208160643"; + name = "doctrine-dbal-c800380457948e65bbd30ba92cc17cda108bf8c9"; src = fetchurl { - url = https://api.github.com/repos/doctrine/dbal/zipball/47433196b6390d14409a33885ee42b6208160643; - sha256 = "0bcg9494hr31902zcmq5kk7ji78yxk074d5bd9chxn9q0xz4g2h8"; + url = https://api.github.com/repos/doctrine/dbal/zipball/c800380457948e65bbd30ba92cc17cda108bf8c9; + sha256 = "1x6bij89yaj0d52ffx683rlpxrgxl0vx9q6a121mkz1zplnif647"; + }; + }; + }; + "doctrine/deprecations" = { + targetDir = ""; + src = composerEnv.buildZipPackage { + name = "doctrine-deprecations-9504165960a1f83cc1480e2be1dd0a0478561314"; + src = fetchurl { + url = https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314; + sha256 = "04kpbzk5iw86imspkg7dgs54xx877k9b5q0dfg2h119mlfkvxil6"; }; }; }; @@ -85,10 +95,10 @@ let "dompdf/dompdf" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "dompdf-dompdf-db91d81866c69a42dad1d2926f61515a1e3f42c5"; + name = "dompdf-dompdf-8768448244967a46d6e67b891d30878e0e15d25c"; src = fetchurl { - url = https://api.github.com/repos/dompdf/dompdf/zipball/db91d81866c69a42dad1d2926f61515a1e3f42c5; - sha256 = "10nsmaiqfk6wgv0l9wjsh7h8nigdfabygkhjk7wdbxdfvlvniddd"; + url = https://api.github.com/repos/dompdf/dompdf/zipball/8768448244967a46d6e67b891d30878e0e15d25c; + sha256 = "0mgsry4mq5bx6b74h3akay1bp03rnsl8ppcjxjkfjlq4svq7m5yf"; }; }; }; @@ -115,10 +125,10 @@ let "facade/flare-client-php" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "facade-flare-client-php-ef0f5bce23b30b32d98fd9bb49c6fa37b40eb546"; + name = "facade-flare-client-php-6bf380035890cb0a09b9628c491ae3866b858522"; src = fetchurl { - url = https://api.github.com/repos/facade/flare-client-php/zipball/ef0f5bce23b30b32d98fd9bb49c6fa37b40eb546; - sha256 = "1car7k8zzkgib9wpi9lzw1dj9qgjak8s9dmiimxaigvb7q4bc5vk"; + url = https://api.github.com/repos/facade/flare-client-php/zipball/6bf380035890cb0a09b9628c491ae3866b858522; + sha256 = "1y0rjlpd71jkl0zzl3q4flv5s9gbk87947xgfi8w62sg5g7jjgl2"; }; }; }; @@ -135,10 +145,10 @@ let "facade/ignition-contracts" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "facade-ignition-contracts-aeab1ce8b68b188a43e81758e750151ad7da796b"; + name = "facade-ignition-contracts-3c921a1cdba35b68a7f0ccffc6dffc1995b18267"; src = fetchurl { - url = https://api.github.com/repos/facade/ignition-contracts/zipball/aeab1ce8b68b188a43e81758e750151ad7da796b; - sha256 = "0b5hv56758fh2y6fqbygwn94qgqwjan8d2s1i10m242x80h9jjiw"; + url = https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267; + sha256 = "1nsjwd1k9q8qmfvh7m50rs42yxzxyq4f56r6dq205gwcmqsjb2j0"; }; }; }; @@ -155,40 +165,40 @@ let "filp/whoops" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "filp-whoops-df7933820090489623ce0be5e85c7e693638e536"; + name = "filp-whoops-d501fd2658d55491a2295ff600ae5978eaad7403"; src = fetchurl { - url = https://api.github.com/repos/filp/whoops/zipball/df7933820090489623ce0be5e85c7e693638e536; - sha256 = "0azpv2r8hc9s5pbk9wh2qk52qzycsbvpijr8w68l311igpcj4f78"; + url = https://api.github.com/repos/filp/whoops/zipball/d501fd2658d55491a2295ff600ae5978eaad7403; + sha256 = "1mpgkl7yzw9j4pxkw404fvykapr42347lyz7jgrl1ks61pk6s9v5"; }; }; }; "guzzlehttp/guzzle" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "guzzlehttp-guzzle-0aa74dfb41ae110835923ef10a9d803a22d50e79"; + name = "guzzlehttp-guzzle-7008573787b430c1c1f650e3722d9bba59967628"; src = fetchurl { - url = https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79; - sha256 = "0gba1711dpi147fzi2ab2pg0k1g6zfanm5w5hf4c7w0b3h4ya5gj"; + url = https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628; + sha256 = "10fiv9ifhz5vg78z4xa41dkwic5ql4m6xf8bglyvpw3x7b76l81m"; }; }; }; "guzzlehttp/promises" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "guzzlehttp-promises-60d379c243457e073cff02bc323a2a86cb355631"; + name = "guzzlehttp-promises-8e7d04f1f6450fef59366c399cfad4b9383aa30d"; src = fetchurl { - url = https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631; - sha256 = "0lvcr64bx9sb90qggxk7g7fsplz403gm3i8lnlcaifyjrlmdj5wb"; + url = https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d; + sha256 = "158wd8nmvvl386c24lkr4jkwdhqpdj0dxdbjwh8iv6a2rgccjr2q"; }; }; }; "guzzlehttp/psr7" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "guzzlehttp-psr7-53330f47520498c0ae1f61f7e2c90f55690c06a3"; + name = "guzzlehttp-psr7-35ea11d335fd638b5882ff1725228b3d35496ab1"; src = fetchurl { - url = https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3; - sha256 = "0948mbbqn1xcz39diajhvlr9a7586vx3091kzx96m0z4ki3lhv7g"; + url = https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1; + sha256 = "1nsd7sla2jpx9kzg0lzk4kvc66d30bnkf2yfzdp7gghb67wvajfa"; }; }; }; @@ -215,30 +225,30 @@ let "laravel/framework" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "laravel-framework-d0e4731e92ca88f4a78fe9e0c2c426a3e8c063c8"; + name = "laravel-framework-d94c07d72c14f07e7d2027458e7f0a76f9ceb0d9"; src = fetchurl { - url = https://api.github.com/repos/laravel/framework/zipball/d0e4731e92ca88f4a78fe9e0c2c426a3e8c063c8; - sha256 = "15zjpq6lbxs019vd0mm2nbfi91yyw40wsf5fl0jbw3s1ffvaq898"; + url = https://api.github.com/repos/laravel/framework/zipball/d94c07d72c14f07e7d2027458e7f0a76f9ceb0d9; + sha256 = "02cml6rg3qxnr8gynnd8iqwdyzflqwnyivxw034dzbm60xpg6w93"; }; }; }; "laravel/socialite" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "laravel-socialite-8d25d574b4f2005411c0b9cb527ef5e745c1b07d"; + name = "laravel-socialite-1960802068f81e44b2ae9793932181cf1cb91b5c"; src = fetchurl { - url = https://api.github.com/repos/laravel/socialite/zipball/8d25d574b4f2005411c0b9cb527ef5e745c1b07d; - sha256 = "0ash56za1flniq9nnk3siyb8l0m2cjwn2n25315qfhmdgbxxjz68"; + url = https://api.github.com/repos/laravel/socialite/zipball/1960802068f81e44b2ae9793932181cf1cb91b5c; + sha256 = "1v68icdk7x1qbnhzsvpzv4nj0hwdw70s75g2bzbvmli6ah0kvvck"; }; }; }; "league/commonmark" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "league-commonmark-11df9b36fd4f1d2b727a73bf14931d81373b9a54"; + name = "league-commonmark-08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf"; src = fetchurl { - url = https://api.github.com/repos/thephpleague/commonmark/zipball/11df9b36fd4f1d2b727a73bf14931d81373b9a54; - sha256 = "15chm1sa65b58b47am00ik03s2agnx49i8yww3mhqlijvbrjvxc3"; + url = https://api.github.com/repos/thephpleague/commonmark/zipball/08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf; + sha256 = "10bs8r0qiq9bybypnascvk7a7181699cnwl27yq4m108cj1i223h"; }; }; }; @@ -305,10 +315,10 @@ let "nesbot/carbon" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "nesbot-carbon-528783b188bdb853eb21239b1722831e0f000a8d"; + name = "nesbot-carbon-2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4"; src = fetchurl { - url = https://api.github.com/repos/briannesbitt/Carbon/zipball/528783b188bdb853eb21239b1722831e0f000a8d; - sha256 = "18pvfwjvclfj0mrgqvycgrbyx5jfcp1hks4yljc6mp66yxr787x4"; + url = https://api.github.com/repos/briannesbitt/Carbon/zipball/2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4; + sha256 = "0riizvfqxvvbkhhfadcqr8717s0q12p00qmffv26664h5kckl58r"; }; }; }; @@ -325,20 +335,20 @@ let "onelogin/php-saml" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "onelogin-php-saml-a7328b11887660ad248ea10952dd67a5aa73ba3b"; + name = "onelogin-php-saml-f30f5062f3653c4d2082892d207f4dc3e577d979"; src = fetchurl { - url = https://api.github.com/repos/onelogin/php-saml/zipball/a7328b11887660ad248ea10952dd67a5aa73ba3b; - sha256 = "0ycj3n22k5i3h8p7gn0xff6a7smjypazl2k5qvyzg86fjr7s3vfv"; + url = https://api.github.com/repos/onelogin/php-saml/zipball/f30f5062f3653c4d2082892d207f4dc3e577d979; + sha256 = "0nl431rx1gngc2g92w4hjf2y26vjvscgbrwhq0m6kzm9kq043qzh"; }; }; }; "opis/closure" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "opis-closure-943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5"; + name = "opis-closure-06e2ebd25f2869e54a306dda991f7db58066f7f6"; src = fetchurl { - url = https://api.github.com/repos/opis/closure/zipball/943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5; - sha256 = "0y47ldgzzv22c5dnsdzqmbrsicq6acjyba0119d3dc6wa3n7zqi6"; + url = https://api.github.com/repos/opis/closure/zipball/06e2ebd25f2869e54a306dda991f7db58066f7f6; + sha256 = "0fpa1w0rmwywj67jgaldmw563p7gycahs8gpkpjvrra9zhhj4yyc"; }; }; }; @@ -405,20 +415,20 @@ let "predis/predis" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "predis-predis-9930e933c67446962997b05201c69c2319bf26de"; + name = "predis-predis-b240daa106d4e02f0c5b7079b41e31ddf66fddf8"; src = fetchurl { - url = https://api.github.com/repos/predis/predis/zipball/9930e933c67446962997b05201c69c2319bf26de; - sha256 = "0qnpiyv96gs8yzy3b1ba918yw1pv8bgzw7skcf3k40ffpxsmkxv6"; + url = https://api.github.com/repos/predis/predis/zipball/b240daa106d4e02f0c5b7079b41e31ddf66fddf8; + sha256 = "0wbsmq5c449vwfvsriyjwqaq5sjf9kw2chr4f2xlh3vqc4kw720j"; }; }; }; "psr/container" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "psr-container-b7ce3b176482dbbc1245ebf52b181af44c2cf55f"; + name = "psr-container-8622567409010282b7aeebe4bb841fe98b58dcaf"; src = fetchurl { - url = https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f; - sha256 = "0rkz64vgwb0gfi09klvgay4qnw993l1dc03vyip7d7m2zxi6cy4j"; + url = https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf; + sha256 = "0qfvyfp3mli776kb9zda5cpc8cazj3prk0bg0gm254kwxyfkfrwn"; }; }; }; @@ -565,10 +575,10 @@ let "socialiteproviders/slack" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "socialiteproviders-slack-8efb25c71d98bedf4010a829d1e41ff9fe449bcc"; + name = "socialiteproviders-slack-2b781c95daf06ec87a8f3deba2ab613d6bea5e8d"; src = fetchurl { - url = https://api.github.com/repos/SocialiteProviders/Slack/zipball/8efb25c71d98bedf4010a829d1e41ff9fe449bcc; - sha256 = "0ax3n4s1djidkhgvrcgv1qipv3k0fhfd0cvs273h6wh66bjniq66"; + url = https://api.github.com/repos/SocialiteProviders/Slack/zipball/2b781c95daf06ec87a8f3deba2ab613d6bea5e8d; + sha256 = "1xilg7l1wc1vgwyakhfl8dpvgkjqx90g4khvzi411j9xa2wvpprh"; }; }; }; @@ -595,20 +605,20 @@ let "swiftmailer/swiftmailer" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "swiftmailer-swiftmailer-698a6a9f54d7eb321274de3ad19863802c879fb7"; + name = "swiftmailer-swiftmailer-15f7faf8508e04471f666633addacf54c0ab5933"; src = fetchurl { - url = https://api.github.com/repos/swiftmailer/swiftmailer/zipball/698a6a9f54d7eb321274de3ad19863802c879fb7; - sha256 = "1zmyr6szxvbc77rs4q1cp7f3vzw1wfx9rbbj7x9s65gh37z9fd1w"; + url = https://api.github.com/repos/swiftmailer/swiftmailer/zipball/15f7faf8508e04471f666633addacf54c0ab5933; + sha256 = "1xiisdaxlmkzi16szh7lm3ay9vr9pdz0q2ah7vqaqrm2b4mwd90g"; }; }; }; "symfony/console" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-console-24026c44fc37099fa145707fecd43672831b837a"; + name = "symfony-console-1ba4560dbbb9fcf5ae28b61f71f49c678086cf23"; src = fetchurl { - url = https://api.github.com/repos/symfony/console/zipball/24026c44fc37099fa145707fecd43672831b837a; - sha256 = "19c5yczwxk0965pdg7ka8sa8wsr569r6l725rj4y9sabfd6mg6jf"; + url = https://api.github.com/repos/symfony/console/zipball/1ba4560dbbb9fcf5ae28b61f71f49c678086cf23; + sha256 = "1zsmv0p0xxdp44301yd3n1w9j79g631bvvfp04zniqk4h5q6kvg9"; }; }; }; @@ -625,30 +635,30 @@ let "symfony/debug" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-debug-af4987aa4a5630e9615be9d9c3ed1b0f24ca449c"; + name = "symfony-debug-157bbec4fd773bae53c5483c50951a5530a2cc16"; src = fetchurl { - url = https://api.github.com/repos/symfony/debug/zipball/af4987aa4a5630e9615be9d9c3ed1b0f24ca449c; - sha256 = "15y1bgdrzq3859ql37ymx4fsvd28kyck69ncm6zyg84q3fhd8i19"; + url = https://api.github.com/repos/symfony/debug/zipball/157bbec4fd773bae53c5483c50951a5530a2cc16; + sha256 = "0v7l7081fw2wr96xv472nhi1d0xzw6lnl8hnjgi9g3gnksfagwq8"; }; }; }; "symfony/deprecation-contracts" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-deprecation-contracts-5fa56b4074d1ae755beb55617ddafe6f5d78f665"; + name = "symfony-deprecation-contracts-5f38c8804a9e97d23e0c8d63341088cd8a22d627"; src = fetchurl { - url = https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665; - sha256 = "0ny59x0aaipqaj956wx7ak5f6d5rn90766swp5m18019v9cppg10"; + url = https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627; + sha256 = "11k6a8v9b6p0j788fgykq6s55baba29lg37fwvmn4igxxkfwmbp3"; }; }; }; "symfony/error-handler" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-error-handler-d603654eaeb713503bba3e308b9e748e5a6d3f2e"; + name = "symfony-error-handler-48e81a375525872e788c2418430f54150d935810"; src = fetchurl { - url = https://api.github.com/repos/symfony/error-handler/zipball/d603654eaeb713503bba3e308b9e748e5a6d3f2e; - sha256 = "15xdk9bbyfdm8yf19jfb3zr1yaj0lprf9pmxgj630vbpbqkgsd8f"; + url = https://api.github.com/repos/symfony/error-handler/zipball/48e81a375525872e788c2418430f54150d935810; + sha256 = "17hpwx8arv3h4cw4fwzkm7a39lsa92vwxsinyqmx723v1nr5z1d2"; }; }; }; @@ -675,50 +685,50 @@ let "symfony/finder" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-finder-25d79cfccfc12e84e7a63a248c3f0720fdd92db6"; + name = "symfony-finder-2543795ab1570df588b9bbd31e1a2bd7037b94f6"; src = fetchurl { - url = https://api.github.com/repos/symfony/finder/zipball/25d79cfccfc12e84e7a63a248c3f0720fdd92db6; - sha256 = "04fwddn12sj6vzr5xr4xd25m86cn4l15079490h3q3igprzvrqk8"; + url = https://api.github.com/repos/symfony/finder/zipball/2543795ab1570df588b9bbd31e1a2bd7037b94f6; + sha256 = "0scclnfc9aphjsric1xaj51vbqqz56kiz6l8l6ldqv6cvyg8zlyi"; }; }; }; "symfony/http-client-contracts" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-http-client-contracts-41db680a15018f9c1d4b23516059633ce280ca33"; + name = "symfony-http-client-contracts-7e82f6084d7cae521a75ef2cb5c9457bbda785f4"; src = fetchurl { - url = https://api.github.com/repos/symfony/http-client-contracts/zipball/41db680a15018f9c1d4b23516059633ce280ca33; - sha256 = "1iia9rpbri1whp2dw4qfhh90gmkdvxhgjwxi54q7wlnlhijgga81"; + url = https://api.github.com/repos/symfony/http-client-contracts/zipball/7e82f6084d7cae521a75ef2cb5c9457bbda785f4; + sha256 = "04mszmb94y0xjs0cwqxzhpf65kfqhhqznldifbxvrrlxb9nn23qc"; }; }; }; "symfony/http-foundation" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-http-foundation-8888741b633f6c3d1e572b7735ad2cae3e03f9c5"; + name = "symfony-http-foundation-02d968647fe61b2f419a8dc70c468a9d30a48d3a"; src = fetchurl { - url = https://api.github.com/repos/symfony/http-foundation/zipball/8888741b633f6c3d1e572b7735ad2cae3e03f9c5; - sha256 = "0qs389nxxqc6nwx5x6b9kz8ykdlhdx7k8k6nd2apppxpqalvk6sw"; + url = https://api.github.com/repos/symfony/http-foundation/zipball/02d968647fe61b2f419a8dc70c468a9d30a48d3a; + sha256 = "1bq4why2v8p7wy8801bdml43xh7kb5fli16cv74bvqpwlp4cdv9f"; }; }; }; "symfony/http-kernel" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-http-kernel-07ea794a327d7c8c5d76e3058fde9fec6a711cb4"; + name = "symfony-http-kernel-0248214120d00c5f44f1cd5d9ad65f0b38459333"; src = fetchurl { - url = https://api.github.com/repos/symfony/http-kernel/zipball/07ea794a327d7c8c5d76e3058fde9fec6a711cb4; - sha256 = "0mnay6nn299ljjgaqqbk8kcl431wrzvzsqybvl648pf513mp9vy9"; + url = https://api.github.com/repos/symfony/http-kernel/zipball/0248214120d00c5f44f1cd5d9ad65f0b38459333; + sha256 = "032ljl732x0bs3my26wjfmxrxplz8vlxs0xzlqsxrh18lnyv6z3h"; }; }; }; "symfony/mime" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-mime-7dee6a43493f39b51ff6c5bb2bd576fe40a76c86"; + name = "symfony-mime-1b2092244374cbe48ae733673f2ca0818b37197b"; src = fetchurl { - url = https://api.github.com/repos/symfony/mime/zipball/7dee6a43493f39b51ff6c5bb2bd576fe40a76c86; - sha256 = "0931zsmnpx75b9b34a03l0sfp22mailaa2y5az3cgx9v0bkc0vka"; + url = https://api.github.com/repos/symfony/mime/zipball/1b2092244374cbe48ae733673f2ca0818b37197b; + sha256 = "0d2vhmd25d7yvh9xzl2vazx2bfsb8qyvd2kgvl9cry1va4vrpkj3"; }; }; }; @@ -815,50 +825,50 @@ let "symfony/routing" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-routing-87529f6e305c7acb162840d1ea57922038072425"; + name = "symfony-routing-69919991c845b34626664ddc9b3aef9d09d2a5df"; src = fetchurl { - url = https://api.github.com/repos/symfony/routing/zipball/87529f6e305c7acb162840d1ea57922038072425; - sha256 = "0qrgacividsp7c61y03qh8lb4vj30g0mvljnm5k60h4zzdmivlgc"; + url = https://api.github.com/repos/symfony/routing/zipball/69919991c845b34626664ddc9b3aef9d09d2a5df; + sha256 = "0ghynrw6d9dpskhgyf3ljlz4pfmi68r3bzhr45lygadx21yacddw"; }; }; }; "symfony/service-contracts" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-service-contracts-d15da7ba4957ffb8f1747218be9e1a121fd298a1"; + name = "symfony-service-contracts-f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb"; src = fetchurl { - url = https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1; - sha256 = "168iq1lp2r5qb5h8j0s17da09iaj2h5hrrdc9rw2p73hq8rvm1w2"; + url = https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb; + sha256 = "1i573rmajc33a9nrgwgc4k3svg29yp9xv17gp133rd1i705hwv1y"; }; }; }; "symfony/translation" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-translation-e1d0c67167a553556d9f974b5fa79c2448df317a"; + name = "symfony-translation-eb8f5428cc3b40d6dffe303b195b084f1c5fbd14"; src = fetchurl { - url = https://api.github.com/repos/symfony/translation/zipball/e1d0c67167a553556d9f974b5fa79c2448df317a; - sha256 = "1b6fj278i1wdf4l7py9n86lmhrqmzvjy7kapjpfkz03adn2ps127"; + url = https://api.github.com/repos/symfony/translation/zipball/eb8f5428cc3b40d6dffe303b195b084f1c5fbd14; + sha256 = "0x80ijdhpfv9is847pp09jlr0g0hwg9sil95jknil7dgx5pjsa5z"; }; }; }; "symfony/translation-contracts" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-translation-contracts-e2eaa60b558f26a4b0354e1bbb25636efaaad105"; + name = "symfony-translation-contracts-95c812666f3e91db75385749fe219c5e494c7f95"; src = fetchurl { - url = https://api.github.com/repos/symfony/translation-contracts/zipball/e2eaa60b558f26a4b0354e1bbb25636efaaad105; - sha256 = "1k26yvgk84rz6ja9ml6l6iwbbi68qsqnq2cpky044g9ymvlg8d5g"; + url = https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95; + sha256 = "073l1pbmwbkaviwwjq9ypb1w7dk366nn2vn1vancbal0zqk0zx7b"; }; }; }; "symfony/var-dumper" = { targetDir = ""; src = composerEnv.buildZipPackage { - name = "symfony-var-dumper-a1eab2f69906dc83c5ddba4632180260d0ab4f7f"; + name = "symfony-var-dumper-0da0e174f728996f5d5072d6a9f0a42259dbc806"; src = fetchurl { - url = https://api.github.com/repos/symfony/var-dumper/zipball/a1eab2f69906dc83c5ddba4632180260d0ab4f7f; - sha256 = "1yw12jbx6gf5mvg7jrr1v57ah3b2s4hflz2p1m98nayi4qhdp20m"; + url = https://api.github.com/repos/symfony/var-dumper/zipball/0da0e174f728996f5d5072d6a9f0a42259dbc806; + sha256 = "1qmv99bvq10siy8bbszqmn488cjcm70vip4xs8vxwm6x6x5cw1ia"; }; }; }; diff --git a/pkgs/shells/bash/undistract-me/default.nix b/pkgs/shells/bash/undistract-me/default.nix new file mode 100644 index 0000000000000..e6641d9039c52 --- /dev/null +++ b/pkgs/shells/bash/undistract-me/default.nix @@ -0,0 +1,79 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +, fetchpatch +, coreutils +, gnused +, libnotify +, pulseaudio +, sound-theme-freedesktop +, xprop +}: + +stdenvNoCC.mkDerivation rec { + pname = "undistract-me"; + version = "unstable-2020-08-09"; + + src = fetchFromGitHub { + owner = "jml"; + repo = pname; + rev = "2f8ac25c6ad8efcf160d2b480825b1cbb6772aab"; + hash = "sha256-Qw7Cu9q0ZgK/RTvyDdHM5N3eBaKjtYqYH0J+hKMUZX8="; + }; + + patches = [ + # Don't block the terminal when notification sound is played + # + # See https://github.com/jml/undistract-me/pull/69 + (fetchpatch { + url = "https://github.com/jml/undistract-me/commit/2356ebbe8bf2bcb4b95af1ae2bcdc786ce7cc6e8.patch"; + sha256 = "sha256-Ij3OXTOnIQsYhKVmqjChhN1q4ASZ7waOkfQTTp5XfPo="; + }) + + # Fix showing notifications when using Wayland apps with XWayland + # running, or connection to X server fails. + # + # NOTE: Without a real X server, notifications will not be + # suppressed when the window running the command is focused. + # + # See https://github.com/jml/undistract-me/pull/71 + (fetchpatch { + url = "https://github.com/jml/undistract-me/commit/3f4ceaf5a4eba8e3cb02236c48247f87e3d1124f.patch"; + sha256 = "sha256-9AK9Jp3TXJ75Y+jwZXlwQ6j54FW1rOBddoktrm0VX68="; + }) + ]; + + # Patch in dependencies. Can't use makeWrapper because the bash + # functions will be sourced and invoked in a different environment + # for each command invocation. + postPatch = '' + for script in *.bash *.sh; do + substituteInPlace "$script" \ + --replace /usr/share/undistract-me "$out/share/undistract-me" \ + --replace basename ${coreutils}/bin/basename \ + --replace 'cut ' '${coreutils}/bin/cut ' \ + --replace date ${coreutils}/bin/date \ + --replace dirname ${coreutils}/bin/dirname \ + --replace sed ${gnused}/bin/sed \ + --replace notify-send ${libnotify}/bin/notify-send \ + --replace paplay ${pulseaudio}/bin/paplay \ + --replace /usr/share/sounds/freedesktop ${sound-theme-freedesktop}/share/sounds/freedesktop \ + --replace xprop ${xprop}/bin/xprop + done + ''; + + installPhase = '' + mkdir -p "$out/share/undistract-me" "$out/etc/profile.d" "$out/share/licenses/undistract-me" + cp long-running.bash "$out/share/undistract-me" + cp preexec.bash "$out/share/undistract-me" + cp undistract-me.sh "$out/etc/profile.d" + cp LICENSE "$out/share/licenses/undistract-me" + ''; + + meta = with lib; { + description = "Notifies you when long-running terminal commands complete"; + homepage = "https://github.com/jml/undistract-me"; + license = licenses.mit; + maintainers = with maintainers; [ metadark ]; + }; +} diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index fb9b748b5d0ae..1c3d5929636a6 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -3,7 +3,7 @@ , zlib, libiconv, libpng, libX11 , freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext , perl, perlPackages, python3Packages, pkg-config -, poppler, libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr +, libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr , brotli, cairo, pixman, xorg, clisp, biber, woff2, xxHash , makeWrapper, shortenPerlShebang }: @@ -14,24 +14,22 @@ let withSystemLibs = map (libname: "--with-system-${libname}"); - year = "2020"; + year = "2021"; version = year; # keep names simple for now common = { src = fetchurl { urls = [ - "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0406-source.tar.xz" - "ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0406-source.tar.xz" + "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0325-source.tar.xz" + "ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0325-source.tar.xz" ]; - sha256 = "0y4h4j2qg714srhvf1hvn165w7sanr1j2vzrsgc23kxvrc43sbz3"; + sha256 = "0jsq1p66l46k2qq0gbqmx25flj2nprsz4wrd1ybn286p11kdkvvs"; }; prePatch = '' for i in texk/kpathsea/mktex*; do sed -i '/^mydir=/d' "$i" done - cp -pv texk/web2c/pdftexdir/pdftoepdf{-poppler0.86.0,}.cc - cp -pv texk/web2c/pdftexdir/pdftosrc{-poppler0.83.0,}.cc ''; configureFlags = [ @@ -43,9 +41,8 @@ let ] ++ withSystemLibs [ # see "from TL tree" vs. "Using installed" in configure output - "zziplib" "xpdf" "poppler" "mpfr" "gmp" + "zziplib" "mpfr" "gmp" "pixman" "potrace" "gd" "freetype2" "libpng" "libpaper" "zlib" - # beware: xpdf means to use stuff from poppler :-/ ]; # clean broken links to stuff not built @@ -73,7 +70,7 @@ core = stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ - /*teckit*/ zziplib poppler mpfr gmp + /*teckit*/ zziplib mpfr gmp pixman gd freetype libpng libpaper zlib perl ]; @@ -82,7 +79,7 @@ core = stdenv.mkDerivation rec { preConfigure = '' rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \ - libs/{lua53,luajit,mpfr,pixman,poppler,xpdf,zlib,zziplib} + libs/{lua53,luajit,mpfr,pixman,zlib,zziplib} mkdir WorkDir cd WorkDir ''; @@ -178,7 +175,7 @@ core-big = stdenv.mkDerivation { #TODO: upmendex luajit = lib.optionalString withLuaJIT ",luajit"; in '' mkdir ./WorkDir && cd ./WorkDir - for path in libs/{teckit,lua53${luajit}} texk/web2c; do + for path in libs/{pplib,teckit,lua53${luajit}} texk/web2c; do ( if [[ "$path" =~ "libs/lua" ]]; then extraConfig="--enable-static --disable-shared" @@ -247,18 +244,17 @@ chktex = stdenv.mkDerivation { dvisvgm = stdenv.mkDerivation rec { pname = "texlive-dvisvgm.bin"; - version = "2.11"; - # TODO: dvisvgm was switched to build from upstream sources - # to address https://github.com/NixOS/nixpkgs/issues/104847 - # We might want to consider reverting that change in the future. - - src = fetchurl { - url = "https://github.com/mgieseki/dvisvgm/releases/download/${version}/dvisvgm-${version}.tar.gz"; - sha256 = "12b6h0h8rc487yjh3sq9zsdabm9cs2vqcrb0znnfi8277f87zf3j"; - }; + inherit version; + + inherit (common) src; + + preConfigure = "cd texk/dvisvgm"; + + configureFlags = common.configureFlags + ++ [ "--with-system-kpathsea" ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ core/*kpathsea*/ brotli ghostscript zlib freetype woff2 potrace xxHash ]; + buildInputs = [ core brotli ghostscript zlib freetype woff2 potrace xxHash ]; enableParallelBuilding = true; }; diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index 52521a80809f0..4ba42cbce570e 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -3,7 +3,7 @@ - current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive */ { stdenv, lib, fetchurl, runCommand, writeText, buildEnv -, callPackage, ghostscriptX, harfbuzz, poppler_min +, callPackage, ghostscriptX, harfbuzz , makeWrapper, python3, ruby, perl , useFixedHashes ? true , recurseIntoAttrs @@ -11,7 +11,6 @@ let # various binaries (compiled) bin = callPackage ./bin.nix { - poppler = poppler_min; # otherwise depend on various X stuff ghostscript = ghostscriptX; harfbuzz = harfbuzz.override { withIcu = true; withGraphite2 = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index abb7775b48d48..c3308a1696598 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9923,6 +9923,8 @@ in nix-bash-completions = callPackage ../shells/bash/nix-bash-completions { }; + undistract-me = callPackage ../shells/bash/undistract-me { }; + dash = callPackage ../shells/dash { }; dasht = callPackage ../tools/misc/dasht { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7f8429c58d62e..7249173d70721 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -605,6 +605,8 @@ in { auth0-python = callPackage ../development/python-modules/auth0-python { }; + authcaptureproxy = callPackage ../development/python-modules/authcaptureproxy { }; + authheaders = callPackage ../development/python-modules/authheaders { }; authlib = callPackage ../development/python-modules/authlib { }; |