diff --git a/.github/labeler.yml b/.github/labeler.yml index c05c496cb102..582260312274 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -37,6 +37,11 @@ "6.topic: fetch": - pkgs/build-support/fetch*/**/* +"6.topic: flakes": + - '**/flake.nix' + - lib/systems/flake-systems.nix + - nixos/modules/config/nix-flakes.nix + "6.topic: GNOME": - doc/languages-frameworks/gnome.section.md - nixos/modules/services/desktops/gnome/**/* diff --git a/lib/fileset/default.nix b/lib/fileset/default.nix index 81be1af9d8a1..15af0813eec7 100644 --- a/lib/fileset/default.nix +++ b/lib/fileset/default.nix @@ -12,14 +12,18 @@ let _printFileset _intersection _difference + _mirrorStorePath + _fetchGitSubmodulesMinver ; inherit (builtins) + isBool isList isPath pathExists seq typeOf + nixVersion ; inherit (lib.lists) @@ -34,6 +38,7 @@ let inherit (lib.strings) isStringLike + versionOlder ; inherit (lib.filesystem) @@ -47,6 +52,7 @@ let inherit (lib.trivial) isFunction pipe + inPureEvalMode ; in { @@ -596,4 +602,111 @@ in { # We could also return the original fileset argument here, # but that would then duplicate work for consumers of the fileset, because then they have to coerce it again actualFileset; + + /* + Create a file set containing all [Git-tracked files](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository) in a repository. + + This function behaves like [`gitTrackedWith { }`](#function-library-lib.fileset.gitTrackedWith) - using the defaults. + + Type: + gitTracked :: Path -> FileSet + + Example: + # Include all files tracked by the Git repository in the current directory + gitTracked ./. + + # Include only files tracked by the Git repository in the parent directory + # that are also in the current directory + intersection ./. (gitTracked ../.) + */ + gitTracked = + /* + The [path](https://nixos.org/manual/nix/stable/language/values#type-path) to the working directory of a local Git repository. + This directory must contain a `.git` file or subdirectory. + */ + path: + # See the gitTrackedWith implementation for more explanatory comments + let + fetchResult = builtins.fetchGit path; + in + if inPureEvalMode then + throw "lib.fileset.gitTracked: This function is currently not supported in pure evaluation mode, since it currently relies on `builtins.fetchGit`. See https://github.com/NixOS/nix/issues/9292." + else if ! isPath path then + throw "lib.fileset.gitTracked: Expected the argument to be a path, but it's a ${typeOf path} instead." + else if ! pathExists (path + "/.git") then + throw "lib.fileset.gitTracked: Expected the argument (${toString path}) to point to a local working tree of a Git repository, but it's not." + else + _mirrorStorePath path fetchResult.outPath; + + /* + Create a file set containing all [Git-tracked files](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository) in a repository. + The first argument allows configuration with an attribute set, + while the second argument is the path to the Git working tree. + If you don't need the configuration, + you can use [`gitTracked`](#function-library-lib.fileset.gitTracked) instead. + + This is equivalent to the result of [`unions`](#function-library-lib.fileset.unions) on all files returned by [`git ls-files`](https://git-scm.com/docs/git-ls-files) + (which uses [`--cached`](https://git-scm.com/docs/git-ls-files#Documentation/git-ls-files.txt--c) by default). + + :::{.warning} + Currently this function is based on [`builtins.fetchGit`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchGit) + As such, this function causes all Git-tracked files to be unnecessarily added to the Nix store, + without being re-usable by [`toSource`](#function-library-lib.fileset.toSource). + + This may change in the future. + ::: + + Type: + gitTrackedWith :: { recurseSubmodules :: Bool ? false } -> Path -> FileSet + + Example: + # Include all files tracked by the Git repository in the current directory + # and any submodules under it + gitTracked { recurseSubmodules = true; } ./. + */ + gitTrackedWith = + { + /* + (optional, default: `false`) Whether to recurse into [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to also include their tracked files. + + If `true`, this is equivalent to passing the [--recurse-submodules](https://git-scm.com/docs/git-ls-files#Documentation/git-ls-files.txt---recurse-submodules) flag to `git ls-files`. + */ + recurseSubmodules ? false, + }: + /* + The [path](https://nixos.org/manual/nix/stable/language/values#type-path) to the working directory of a local Git repository. + This directory must contain a `.git` file or subdirectory. + */ + path: + let + # This imports the files unnecessarily, which currently can't be avoided + # because `builtins.fetchGit` is the only function exposing which files are tracked by Git. + # With the [lazy trees PR](https://github.com/NixOS/nix/pull/6530), + # the unnecessarily import could be avoided. + # However a simpler alternative still would be [a builtins.gitLsFiles](https://github.com/NixOS/nix/issues/2944). + fetchResult = builtins.fetchGit { + url = path; + + # This is the only `fetchGit` parameter that makes sense in this context. + # We can't just pass `submodules = recurseSubmodules` here because + # this would fail for Nix versions that don't support `submodules`. + ${if recurseSubmodules then "submodules" else null} = true; + }; + in + if inPureEvalMode then + throw "lib.fileset.gitTrackedWith: This function is currently not supported in pure evaluation mode, since it currently relies on `builtins.fetchGit`. See https://github.com/NixOS/nix/issues/9292." + else if ! isBool recurseSubmodules then + throw "lib.fileset.gitTrackedWith: Expected the attribute `recurseSubmodules` of the first argument to be a boolean, but it's a ${typeOf recurseSubmodules} instead." + else if recurseSubmodules && versionOlder nixVersion _fetchGitSubmodulesMinver then + throw "lib.fileset.gitTrackedWith: Setting the attribute `recurseSubmodules` to `true` is only supported for Nix version ${_fetchGitSubmodulesMinver} and after, but Nix version ${nixVersion} is used." + else if ! isPath path then + throw "lib.fileset.gitTrackedWith: Expected the second argument to be a path, but it's a ${typeOf path} instead." + # We can identify local working directories by checking for .git, + # see https://git-scm.com/docs/gitrepository-layout#_description. + # Note that `builtins.fetchGit` _does_ work for bare repositories (where there's no `.git`), + # even though `git ls-files` wouldn't return any files in that case. + else if ! pathExists (path + "/.git") then + throw "lib.fileset.gitTrackedWith: Expected the second argument (${toString path}) to point to a local working tree of a Git repository, but it's not." + else + _mirrorStorePath path fetchResult.outPath; } diff --git a/lib/fileset/internal.nix b/lib/fileset/internal.nix index 6b5cea066afd..0769e654c8fb 100644 --- a/lib/fileset/internal.nix +++ b/lib/fileset/internal.nix @@ -825,4 +825,27 @@ rec { ${baseNameOf root} = fromFile (baseNameOf root) rootType; }; + + # Support for `builtins.fetchGit` with `submodules = true` was introduced in 2.4 + # https://github.com/NixOS/nix/commit/55cefd41d63368d4286568e2956afd535cb44018 + _fetchGitSubmodulesMinver = "2.4"; + + # Mirrors the contents of a Nix store path relative to a local path as a file set. + # Some notes: + # - The store path is read at evaluation time. + # - The store path must not include files that don't exist in the respective local path. + # + # Type: Path -> String -> FileSet + _mirrorStorePath = localPath: storePath: + let + recurse = focusedStorePath: + mapAttrs (name: type: + if type == "directory" then + recurse (focusedStorePath + "/${name}") + else + type + ) (builtins.readDir focusedStorePath); + in + _create localPath + (recurse storePath); } diff --git a/lib/fileset/tests.sh b/lib/fileset/tests.sh index ebf9b6c37bf2..3c88ebdd0559 100755 --- a/lib/fileset/tests.sh +++ b/lib/fileset/tests.sh @@ -43,15 +43,29 @@ crudeUnquoteJSON() { cut -d \" -f2 } -prefixExpression='let - lib = import ; - internal = import { - inherit lib; - }; -in -with lib; -with internal; -with lib.fileset;' +prefixExpression() { + echo 'let + lib = + (import ) + ' + if [[ "${1:-}" == "--simulate-pure-eval" ]]; then + echo ' + .extend (final: prev: { + trivial = prev.trivial // { + inPureEvalMode = true; + }; + })' + fi + echo ' + ; + internal = import { + inherit lib; + }; + in + with lib; + with internal; + with lib.fileset;' +} # Check that two nix expression successfully evaluate to the same value. # The expressions have `lib.fileset` in scope. @@ -60,7 +74,7 @@ expectEqual() { local actualExpr=$1 local expectedExpr=$2 if actualResult=$(nix-instantiate --eval --strict --show-trace 2>"$tmp"/actualStderr \ - --expr "$prefixExpression ($actualExpr)"); then + --expr "$(prefixExpression) ($actualExpr)"); then actualExitCode=$? else actualExitCode=$? @@ -68,7 +82,7 @@ expectEqual() { actualStderr=$(< "$tmp"/actualStderr) if expectedResult=$(nix-instantiate --eval --strict --show-trace 2>"$tmp"/expectedStderr \ - --expr "$prefixExpression ($expectedExpr)"); then + --expr "$(prefixExpression) ($expectedExpr)"); then expectedExitCode=$? else expectedExitCode=$? @@ -95,8 +109,9 @@ expectEqual() { # Usage: expectStorePath NIX expectStorePath() { local expr=$1 - if ! result=$(nix-instantiate --eval --strict --json --read-write-mode --show-trace \ - --expr "$prefixExpression ($expr)"); then + if ! result=$(nix-instantiate --eval --strict --json --read-write-mode --show-trace 2>"$tmp"/stderr \ + --expr "$(prefixExpression) ($expr)"); then + cat "$tmp/stderr" >&2 die "$expr failed to evaluate, but it was expected to succeed" fi # This is safe because we assume to get back a store path in a string @@ -108,10 +123,16 @@ expectStorePath() { # The expression has `lib.fileset` in scope. # Usage: expectFailure NIX REGEX expectFailure() { + if [[ "$1" == "--simulate-pure-eval" ]]; then + maybePure="--simulate-pure-eval" + shift + else + maybePure="" + fi local expr=$1 local expectedErrorRegex=$2 if result=$(nix-instantiate --eval --strict --read-write-mode --show-trace 2>"$tmp/stderr" \ - --expr "$prefixExpression $expr"); then + --expr "$(prefixExpression $maybePure) $expr"); then die "$expr evaluated successfully to $result, but it was expected to fail" fi stderr=$(<"$tmp/stderr") @@ -128,12 +149,12 @@ expectTrace() { local expectedTrace=$2 nix-instantiate --eval --show-trace >/dev/null 2>"$tmp"/stderrTrace \ - --expr "$prefixExpression trace ($expr)" || true + --expr "$(prefixExpression) trace ($expr)" || true actualTrace=$(sed -n 's/^trace: //p' "$tmp/stderrTrace") nix-instantiate --eval --show-trace >/dev/null 2>"$tmp"/stderrTraceVal \ - --expr "$prefixExpression traceVal ($expr)" || true + --expr "$(prefixExpression) traceVal ($expr)" || true actualTraceVal=$(sed -n 's/^trace: //p' "$tmp/stderrTraceVal") @@ -1251,6 +1272,179 @@ expectEqual 'trace (intersection ./a (fromSource (lib.cleanSourceWith { }))) null' 'trace ./a/b null' rm -rf -- * +## lib.fileset.gitTracked/gitTrackedWith + +# The first/second argument has to be a path +expectFailure 'gitTracked null' 'lib.fileset.gitTracked: Expected the argument to be a path, but it'\''s a null instead.' +expectFailure 'gitTrackedWith {} null' 'lib.fileset.gitTrackedWith: Expected the second argument to be a path, but it'\''s a null instead.' + +# The path has to contain a .git directory +expectFailure 'gitTracked ./.' 'lib.fileset.gitTracked: Expected the argument \('"$work"'\) to point to a local working tree of a Git repository, but it'\''s not.' +expectFailure 'gitTrackedWith {} ./.' 'lib.fileset.gitTrackedWith: Expected the second argument \('"$work"'\) to point to a local working tree of a Git repository, but it'\''s not.' + +# recurseSubmodules has to be a boolean +expectFailure 'gitTrackedWith { recurseSubmodules = null; } ./.' 'lib.fileset.gitTrackedWith: Expected the attribute `recurseSubmodules` of the first argument to be a boolean, but it'\''s a null instead.' + +# recurseSubmodules = true is not supported on all Nix versions +if [[ "$(nix-instantiate --eval --expr "$(prefixExpression) (versionAtLeast builtins.nixVersion _fetchGitSubmodulesMinver)")" == true ]]; then + fetchGitSupportsSubmodules=1 +else + fetchGitSupportsSubmodules= + expectFailure 'gitTrackedWith { recurseSubmodules = true; } ./.' 'lib.fileset.gitTrackedWith: Setting the attribute `recurseSubmodules` to `true` is only supported for Nix version 2.4 and after, but Nix version [0-9.]+ is used.' +fi + +# Checks that `gitTrackedWith` contains the same files as `git ls-files` +# for the current working directory. +# If --recurse-submodules is passed, the flag is passed through to `git ls-files` +# and as `recurseSubmodules` to `gitTrackedWith` +checkGitTrackedWith() { + if [[ "${1:-}" == "--recurse-submodules" ]]; then + gitLsFlags="--recurse-submodules" + gitTrackedArg="{ recurseSubmodules = true; }" + else + gitLsFlags="" + gitTrackedArg="{ }" + fi + + # All files listed by `git ls-files` + expectedFiles=() + while IFS= read -r -d $'\0' file; do + # If there are submodules but --recurse-submodules isn't passed, + # `git ls-files` lists them as empty directories, + # we need to filter that out since we only want to check/count files + if [[ -f "$file" ]]; then + expectedFiles+=("$file") + fi + done < <(git ls-files -z $gitLsFlags) + + storePath=$(expectStorePath 'toSource { root = ./.; fileset = gitTrackedWith '"$gitTrackedArg"' ./.; }') + + # Check that each expected file is also in the store path with the same content + for expectedFile in "${expectedFiles[@]}"; do + if [[ ! -e "$storePath"/"$expectedFile" ]]; then + die "Expected file $expectedFile to exist in $storePath, but it doesn't.\nGit status:\n$(git status)\nStore path contents:\n$(find "$storePath")" + fi + if ! diff "$expectedFile" "$storePath"/"$expectedFile"; then + die "Expected file $expectedFile to have the same contents as in $storePath, but it doesn't.\nGit status:\n$(git status)\nStore path contents:\n$(find "$storePath")" + fi + done + + # This is a cheap way to verify the inverse: That all files in the store path are also expected + # We just count the number of files in both and verify they're the same + actualFileCount=$(find "$storePath" -type f -printf . | wc -c) + if [[ "${#expectedFiles[@]}" != "$actualFileCount" ]]; then + die "Expected ${#expectedFiles[@]} files in $storePath, but got $actualFileCount.\nGit status:\n$(git status)\nStore path contents:\n$(find "$storePath")" + fi +} + + +# Runs checkGitTrackedWith with and without --recurse-submodules +# Allows testing both variants together +checkGitTracked() { + checkGitTrackedWith + if [[ -n "$fetchGitSupportsSubmodules" ]]; then + checkGitTrackedWith --recurse-submodules + fi +} + +createGitRepo() { + git init -q "$1" + # Only repo-local config + git -C "$1" config user.name "Nixpkgs" + git -C "$1" config user.email "nixpkgs@nixos.org" + # Get at least a HEAD commit, needed for older Nix versions + git -C "$1" commit -q --allow-empty -m "Empty commit" +} + +# Check the error message for pure eval mode +createGitRepo . +expectFailure --simulate-pure-eval 'toSource { root = ./.; fileset = gitTracked ./.; }' 'lib.fileset.gitTracked: This function is currently not supported in pure evaluation mode, since it currently relies on `builtins.fetchGit`. See https://github.com/NixOS/nix/issues/9292.' +expectFailure --simulate-pure-eval 'toSource { root = ./.; fileset = gitTrackedWith {} ./.; }' 'lib.fileset.gitTrackedWith: This function is currently not supported in pure evaluation mode, since it currently relies on `builtins.fetchGit`. See https://github.com/NixOS/nix/issues/9292.' +rm -rf -- * + +# Go through all stages of Git files +# See https://www.git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository + +# Empty repository +createGitRepo . +checkGitTracked + +# Untracked file +echo a > a +checkGitTracked + +# Staged file +git add a +checkGitTracked + +# Committed file +git commit -q -m "Added a" +checkGitTracked + +# Edited file +echo b > a +checkGitTracked + +# Removed file +git rm -f -q a +checkGitTracked + +rm -rf -- * + +# gitignored file +createGitRepo . +echo a > .gitignore +touch a +git add -A +checkGitTracked + +# Add it regardless (needs -f) +git add -f a +checkGitTracked +rm -rf -- * + +# Directory +createGitRepo . +mkdir -p d1/d2/d3 +touch d1/d2/d3/a +git add d1 +checkGitTracked +rm -rf -- * + +# Submodules +createGitRepo . +createGitRepo sub + +# Untracked submodule +git -C sub commit -q --allow-empty -m "Empty commit" +checkGitTracked + +# Tracked submodule +git submodule add ./sub sub >/dev/null +checkGitTracked + +# Untracked file +echo a > sub/a +checkGitTracked + +# Staged file +git -C sub add a +checkGitTracked + +# Committed file +git -C sub commit -q -m "Add a" +checkGitTracked + +# Changed file +echo b > sub/b +checkGitTracked + +# Removed file +git -C sub rm -f -q a +checkGitTracked + +rm -rf -- * + # TODO: Once we have combinators and a property testing library, derive property tests from https://en.wikipedia.org/wiki/Algebra_of_sets echo >&2 tests ok diff --git a/lib/tests/release.nix b/lib/tests/release.nix index c8d6b810122e..6e5b07117367 100644 --- a/lib/tests/release.nix +++ b/lib/tests/release.nix @@ -25,11 +25,13 @@ let ]; nativeBuildInputs = [ nix + pkgs.gitMinimal ] ++ lib.optional pkgs.stdenv.isLinux pkgs.inotify-tools; strictDeps = true; } '' datadir="${nix}/share" export TEST_ROOT=$(pwd)/test-tmp + export HOME=$(mktemp -d) export NIX_BUILD_HOOK= export NIX_CONF_DIR=$TEST_ROOT/etc export NIX_LOCALSTATE_DIR=$TEST_ROOT/var diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 0021471e320a..25ca241f3487 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -8295,6 +8295,15 @@ githubId = 18501; name = "Julien Langlois"; }; + jfly = { + name = "Jeremy Fleischman"; + email = "jeremyfleischman@gmail.com"; + github = "jfly"; + githubId = 277474; + keys = [{ + fingerprint = "F1F1 3395 8E8E 9CC4 D9FC 9647 1931 9CD8 416A 642B"; + }]; + }; jfrankenau = { email = "johannes@frankenau.net"; github = "jfrankenau"; @@ -11209,6 +11218,12 @@ githubId = 11810057; name = "Matt Snider"; }; + matusf = { + email = "matus.ferech@gmail.com"; + github = "matusf"; + githubId = 18228995; + name = "Matúš Ferech"; + }; maurer = { email = "matthew.r.maurer+nix@gmail.com"; github = "maurer"; diff --git a/nixos/modules/services/monitoring/parsedmarc.nix b/nixos/modules/services/monitoring/parsedmarc.nix index 44fc359b6a7d..a146e7ab9543 100644 --- a/nixos/modules/services/monitoring/parsedmarc.nix +++ b/nixos/modules/services/monitoring/parsedmarc.nix @@ -301,6 +301,7 @@ in description = lib.mdDoc '' The addresses to send outgoing mail to. ''; + apply = x: if x == [] then null else lib.concatStringsSep "," x; }; }; diff --git a/nixos/modules/services/web-apps/plantuml-server.nix b/nixos/modules/services/web-apps/plantuml-server.nix index 5ebee48c3e0b..1fa69814c6c9 100644 --- a/nixos/modules/services/web-apps/plantuml-server.nix +++ b/nixos/modules/services/web-apps/plantuml-server.nix @@ -1,123 +1,110 @@ { config, lib, pkgs, ... }: -with lib; - let + inherit (lib) + literalExpression + mdDoc + mkEnableOption + mkIf + mkOption + mkPackageOptionMD + mkRemovedOptionModule + types + ; cfg = config.services.plantuml-server; in { + imports = [ + (mkRemovedOptionModule [ "services" "plantuml-server" "allowPlantumlInclude" ] "This option has been removed from PlantUML.") + ]; + options = { services.plantuml-server = { - enable = mkEnableOption (lib.mdDoc "PlantUML server"); + enable = mkEnableOption (mdDoc "PlantUML server"); - package = mkOption { - type = types.package; - default = pkgs.plantuml-server; - defaultText = literalExpression "pkgs.plantuml-server"; - description = lib.mdDoc "PlantUML server package to use"; - }; + package = mkPackageOptionMD pkgs "plantuml-server" { }; packages = { - jdk = mkOption { - type = types.package; - default = pkgs.jdk; - defaultText = literalExpression "pkgs.jdk"; - description = lib.mdDoc "JDK package to use for the server"; - }; - jetty = mkOption { - type = types.package; - default = pkgs.jetty; - defaultText = literalExpression "pkgs.jetty"; - description = lib.mdDoc "Jetty package to use for the server"; + jdk = mkPackageOptionMD pkgs "jdk" { }; + jetty = mkPackageOptionMD pkgs "jetty" { + default = "jetty_11"; + extraDescription = '' + At the time of writing (v1.2023.12), PlantUML Server does not support + Jetty versions higher than 12.x. + + Jetty 12.x has introduced major breaking changes, see + and + + ''; }; }; user = mkOption { type = types.str; default = "plantuml"; - description = lib.mdDoc "User which runs PlantUML server."; + description = mdDoc "User which runs PlantUML server."; }; group = mkOption { type = types.str; default = "plantuml"; - description = lib.mdDoc "Group which runs PlantUML server."; + description = mdDoc "Group which runs PlantUML server."; }; home = mkOption { - type = types.str; + type = types.path; default = "/var/lib/plantuml"; - description = lib.mdDoc "Home directory of the PlantUML server instance."; + description = mdDoc "Home directory of the PlantUML server instance."; }; listenHost = mkOption { type = types.str; default = "127.0.0.1"; - description = lib.mdDoc "Host to listen on."; + description = mdDoc "Host to listen on."; }; listenPort = mkOption { type = types.int; default = 8080; - description = lib.mdDoc "Port to listen on."; + description = mdDoc "Port to listen on."; }; plantumlLimitSize = mkOption { type = types.int; default = 4096; - description = lib.mdDoc "Limits image width and height."; + description = mdDoc "Limits image width and height."; }; - graphvizPackage = mkOption { - type = types.package; - default = pkgs.graphviz; - defaultText = literalExpression "pkgs.graphviz"; - description = lib.mdDoc "Package containing the dot executable."; - }; + graphvizPackage = mkPackageOptionMD pkgs "graphviz" { }; plantumlStats = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Set it to on to enable statistics report (https://plantuml.com/statistics-report)."; + description = mdDoc "Set it to on to enable statistics report (https://plantuml.com/statistics-report)."; }; httpAuthorization = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc "When calling the proxy endpoint, the value of HTTP_AUTHORIZATION will be used to set the HTTP Authorization header."; - }; - - allowPlantumlInclude = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc "Enables !include processing which can read files from the server into diagrams. Files are read relative to the current working directory."; + description = mdDoc "When calling the proxy endpoint, the value of HTTP_AUTHORIZATION will be used to set the HTTP Authorization header."; }; }; }; config = mkIf cfg.enable { - users.users.${cfg.user} = { - isSystemUser = true; - group = cfg.group; - home = cfg.home; - createHome = true; - }; - - users.groups.${cfg.group} = {}; - systemd.services.plantuml-server = { description = "PlantUML server"; wantedBy = [ "multi-user.target" ]; path = [ cfg.home ]; + environment = { PLANTUML_LIMIT_SIZE = builtins.toString cfg.plantumlLimitSize; GRAPHVIZ_DOT = "${cfg.graphvizPackage}/bin/dot"; PLANTUML_STATS = if cfg.plantumlStats then "on" else "off"; HTTP_AUTHORIZATION = cfg.httpAuthorization; - ALLOW_PLANTUML_INCLUDE = if cfg.allowPlantumlInclude then "true" else "false"; }; script = '' ${cfg.packages.jdk}/bin/java \ @@ -128,13 +115,40 @@ in jetty.http.host=${cfg.listenHost} \ jetty.http.port=${builtins.toString cfg.listenPort} ''; + serviceConfig = { User = cfg.user; Group = cfg.group; + StateDirectory = mkIf (cfg.home == "/var/lib/plantuml") "plantuml"; + StateDirectoryMode = mkIf (cfg.home == "/var/lib/plantuml") "0750"; + + # Hardening + AmbientCapabilities = [ "" ]; + CapabilityBoundingSet = [ "" ]; + DynamicUser = true; + LockPersonality = true; + NoNewPrivileges = true; + PrivateDevices = true; + PrivateNetwork = false; PrivateTmp = true; + PrivateUsers = true; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectSystem = "strict"; + RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ]; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + SystemCallFilter = [ "@system-service" ]; }; }; }; - meta.maintainers = with lib.maintainers; [ truh ]; + meta.maintainers = with lib.maintainers; [ truh anthonyroussel ]; } diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index f44fcfcf54ab..fdd95a9b4f94 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -656,6 +656,7 @@ in { phylactery = handleTest ./web-apps/phylactery.nix {}; pict-rs = handleTest ./pict-rs.nix {}; pinnwand = handleTest ./pinnwand.nix {}; + plantuml-server = handleTest ./plantuml-server.nix {}; plasma-bigscreen = handleTest ./plasma-bigscreen.nix {}; plasma5 = handleTest ./plasma5.nix {}; plasma5-systemd-start = handleTest ./plasma5-systemd-start.nix {}; diff --git a/nixos/tests/plantuml-server.nix b/nixos/tests/plantuml-server.nix new file mode 100644 index 000000000000..460c30919aec --- /dev/null +++ b/nixos/tests/plantuml-server.nix @@ -0,0 +1,20 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: { + name = "plantuml-server"; + meta.maintainers = with lib.maintainers; [ anthonyroussel ]; + + nodes.machine = { pkgs, ... }: { + environment.systemPackages = [ pkgs.curl ]; + services.plantuml-server.enable = true; + }; + + testScript = '' + start_all() + + machine.wait_for_unit("plantuml-server.service") + machine.wait_for_open_port(8080) + + with subtest("Generate chart"): + chart_id = machine.succeed("curl -sSf http://localhost:8080/plantuml/coder -d 'Alice -> Bob'") + machine.succeed("curl -sSf http://localhost:8080/plantuml/txt/{}".format(chart_id)) + ''; +}) diff --git a/pkgs/applications/audio/galaxy-buds-client/default.nix b/pkgs/applications/audio/galaxy-buds-client/default.nix index f3a0ba8c6e93..15125358e464 100644 --- a/pkgs/applications/audio/galaxy-buds-client/default.nix +++ b/pkgs/applications/audio/galaxy-buds-client/default.nix @@ -13,13 +13,13 @@ buildDotnetModule rec { pname = "galaxy-buds-client"; - version = "4.5.2"; + version = "4.5.4"; src = fetchFromGitHub { owner = "ThePBone"; repo = "GalaxyBudsClient"; rev = version; - hash = "sha256-bnJ1xvqos+JP0KF8Z7mX8/8IozcaRCgaRL3cSO3V120="; + hash = "sha256-mmhXTtESjc8uNULc9zV2Qy/815BEEL7ybdnjArF2CXY="; }; projectFile = [ "GalaxyBudsClient/GalaxyBudsClient.csproj" ]; diff --git a/pkgs/applications/audio/galaxy-buds-client/deps.nix b/pkgs/applications/audio/galaxy-buds-client/deps.nix index d45dd12b8b20..1e72808d9068 100644 --- a/pkgs/applications/audio/galaxy-buds-client/deps.nix +++ b/pkgs/applications/audio/galaxy-buds-client/deps.nix @@ -2,33 +2,42 @@ # Please dont edit it manually, your changes might get overwritten! { fetchNuGet }: [ - (fetchNuGet { pname = "Avalonia"; version = "0.10.14"; sha256 = "0nn3xgkf7v47dwpnsxjg0b25ifqa4mbq02ja5rvnlc3q2k6k0fxv"; }) + (fetchNuGet { pname = "Avalonia"; version = "0.10.18"; sha256 = "01x7fc8rdkzba40piwi1ngsk7f8jawzn5bcq2la96hphsiahaarh"; }) (fetchNuGet { pname = "Avalonia.Angle.Windows.Natives"; version = "2.1.0.2020091801"; sha256 = "04jm83cz7vkhhr6n2c9hya2k8i2462xbf6np4bidk55as0jdq43a"; }) - (fetchNuGet { pname = "Avalonia.Controls.DataGrid"; version = "0.10.14"; sha256 = "0diw3l2nblapvvhnpl28fcgmqg845rlp8cszcvzhd8g6mcm54r7i"; }) - (fetchNuGet { pname = "Avalonia.Desktop"; version = "0.10.14"; sha256 = "0r0p1g80pj06d8i7mq0kj00bpnsdlrxkh31r9166c779in34y946"; }) - (fetchNuGet { pname = "Avalonia.Diagnostics"; version = "0.10.14"; sha256 = "133w2s2jrjj8731s7xq06c8b4zwn00lb7cn8c1iypqaa82krvkq2"; }) - (fetchNuGet { pname = "Avalonia.FreeDesktop"; version = "0.10.14"; sha256 = "06v18kmq10z5gmdqpnvn3aws2ir14gnnz0gvkbj7f68bfggzcg3s"; }) - (fetchNuGet { pname = "Avalonia.Markup.Xaml.Loader"; version = "0.10.14"; sha256 = "1qmggiigsn2rkqr0fhrfvyx138dvazihj64r1s4azq014530r0pk"; }) - (fetchNuGet { pname = "Avalonia.Native"; version = "0.10.14"; sha256 = "1h0h20cq6hds2mljn1457s42n6pcq821l1d6da2ijncmhk6rdwnl"; }) - (fetchNuGet { pname = "Avalonia.Remote.Protocol"; version = "0.10.14"; sha256 = "1hnski71ynqqlddfnbhall4fx3ndh04774kzykzparm8nd9aqaam"; }) - (fetchNuGet { pname = "Avalonia.Skia"; version = "0.10.13"; sha256 = "0k5y0w164m03q278m4wr7zzf3vfq9nb0am9vmmprivpn1xwwa7ml"; }) - (fetchNuGet { pname = "Avalonia.Skia"; version = "0.10.14"; sha256 = "1cvyg94avqdscniszshx5r3vfvx0cnna262sp89ad4bianmd4qkj"; }) - (fetchNuGet { pname = "Avalonia.Svg.Skia"; version = "0.10.13"; sha256 = "1msrsxzya1l0grfxk17yizfvy2vg4i7hyw1aw54s8gf7x3gpzn86"; }) - (fetchNuGet { pname = "Avalonia.Win32"; version = "0.10.14"; sha256 = "1c1jdxsnqrzwrcalrvc7x34x1zxc5qcpfxx4fkqca99ngw4b0blj"; }) - (fetchNuGet { pname = "Avalonia.X11"; version = "0.10.14"; sha256 = "182nza6rqndxlwi089r06ladfc6j8vsgqzd7xq21s91zbcbcidar"; }) - (fetchNuGet { pname = "Avalonia.Xaml.Behaviors"; version = "0.10.13"; sha256 = "0cs42z2vz679mdic7fbxzjs53xm2lp37wcnh843nz86qvma5280k"; }) - (fetchNuGet { pname = "Avalonia.Xaml.Interactions"; version = "0.10.13"; sha256 = "0s5fcsy2hs2wphd5cs4dnk4aw8zs5bbzisg0ba5akqpzwpps8fs1"; }) - (fetchNuGet { pname = "Avalonia.Xaml.Interactivity"; version = "0.10.13"; sha256 = "19kxbgs0nbiw9zq1f9fsawnw0sl5c880z2dfidnjp99vvfda9rzs"; }) + (fetchNuGet { pname = "Avalonia.Controls.DataGrid"; version = "0.10.18"; sha256 = "1qbb527jvhv2p8dcxi7lhm3lczy96j546gb5w09gh90dmzaq45bw"; }) + (fetchNuGet { pname = "Avalonia.Desktop"; version = "0.10.18"; sha256 = "0iaby5696km0yl0bs2a8i6a5ypras54mimnmh9wjwarwniqj8yjs"; }) + (fetchNuGet { pname = "Avalonia.Diagnostics"; version = "0.10.18"; sha256 = "1qsrzv1fz73p46p9v60qqds229znfv9hawnams5hxwl46jn2v9cp"; }) + (fetchNuGet { pname = "Avalonia.FreeDesktop"; version = "0.10.18"; sha256 = "173apfayxkm3lgj7xk9xzsbxmdhv44svr49ccqnd1dii7y69bgny"; }) + (fetchNuGet { pname = "Avalonia.Markup.Xaml.Loader"; version = "0.10.18"; sha256 = "0vcbhwckzxgcq9wxim91zk30kzjaydr9szl4rbr3rz85447hj9pi"; }) + (fetchNuGet { pname = "Avalonia.Native"; version = "0.10.18"; sha256 = "1hvmjs7wfcbycviky79g1p5q3bzs8j31sr53nnqxqy6pnbmg0nxg"; }) + (fetchNuGet { pname = "Avalonia.Remote.Protocol"; version = "0.10.18"; sha256 = "0phxxz4r1llklvp4svy9qlsms3qw77crai3ww70g03fifmmr9qq2"; }) + (fetchNuGet { pname = "Avalonia.Skia"; version = "0.10.16"; sha256 = "1rla042nc9mc36qnpipszrf0sffwi5d83cr9dmihpa015bby42pz"; }) + (fetchNuGet { pname = "Avalonia.Skia"; version = "0.10.18"; sha256 = "1vi83d9q6m2zd7b5snyzjxsj3vdp5bmi5vqhfslzghslpbhj2zwv"; }) + (fetchNuGet { pname = "Avalonia.Svg.Skia"; version = "0.10.16"; sha256 = "1gsm421gzzymc6rys4sw4hds33grg2mwpnm5xpbhwfh4bnbfblg8"; }) + (fetchNuGet { pname = "Avalonia.Win32"; version = "0.10.18"; sha256 = "1rvqydbzdi2n6jw4xx9q8i025w5zsgcli9vmv0vw1d51rd4cnc4k"; }) + (fetchNuGet { pname = "Avalonia.X11"; version = "0.10.18"; sha256 = "0bzhbnz0dimxbpjxcrphnjn8nk37hqw0b83s2nsha4gzqvpc75b2"; }) + (fetchNuGet { pname = "Avalonia.Xaml.Behaviors"; version = "0.10.17"; sha256 = "05g761may9xa1n75lmzib5hknjk7k0nz453bmg2d5m0xxqw6yc13"; }) + (fetchNuGet { pname = "Avalonia.Xaml.Interactions"; version = "0.10.17"; sha256 = "0k0xnbayplndc6xld98jdla8zv769aj5s285cpbdgm2dril0rywj"; }) + (fetchNuGet { pname = "Avalonia.Xaml.Interactivity"; version = "0.10.17"; sha256 = "0smxxr0b8585x0fq57y3jcaxpl5qyxmkr0c6pd83bsczk8p4rjfy"; }) (fetchNuGet { pname = "Castle.Core"; version = "4.4.0"; sha256 = "0rpcbmyhckvlvp6vbzpj03c1gqz56ixc6f15vgmxmyf1g40c24pf"; }) (fetchNuGet { pname = "Config.Net"; version = "4.15.0"; sha256 = "0hsyma0r8hssz2h7bx38rr8ajx28x5ya2h4k665cbd65z3cs1di1"; }) (fetchNuGet { pname = "Config.Net.Json"; version = "4.15.0"; sha256 = "1q6v4pj76h0hhn26ln4kc8vg75jm8jnlp1ssnrqzwxy88yf82z4h"; }) (fetchNuGet { pname = "CS-Script.Core"; version = "1.4.2-preview"; sha256 = "0djliiixl3ncc1b29s9knal1ascg359na0pacsm73p98ad1f7pzh"; }) - (fetchNuGet { pname = "Fizzler"; version = "1.2.0"; sha256 = "1b8kvqli5wql53ab9fwyg78h572z4f286s8rjb9xxmsyav1hsyll"; }) + (fetchNuGet { pname = "ExCSS"; version = "4.1.4"; sha256 = "1y50xp6rihkydbf5l73mr3qq2rm6rdfjrzdw9h1dw9my230q5lpd"; }) + (fetchNuGet { pname = "Fizzler"; version = "1.2.1"; sha256 = "1w5jb1d0figbv68dydbnlcsfmqlc3sv9z1zxp7d79dg2dkarc4qm"; }) (fetchNuGet { pname = "HarfBuzzSharp"; version = "2.8.2-preview.178"; sha256 = "1p5nwzl7jpypsd6df7hgcf47r977anjlyv21wacmalsj6lvdgnvn"; }) + (fetchNuGet { pname = "HarfBuzzSharp"; version = "2.8.2.1-preview.1"; sha256 = "1g5g7mnfr668hww9r84pfl04x0s44cq5ppykqg406a0lkdb2g8yp"; }) + (fetchNuGet { pname = "HarfBuzzSharp"; version = "2.8.2.1-preview.108"; sha256 = "0xs4px4fy5b6glc77rqswzpi5ddhxvbar1md6q9wla7hckabnq0z"; }) (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Linux"; version = "2.8.2-preview.178"; sha256 = "1402ylkxbgcnagcarqlfvg4gppy2pqs3bmin4n5mphva1g7bqb2p"; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Linux"; version = "2.8.2.1-preview.108"; sha256 = "16wvgvyra2g1b38rxxgkk85wbz89hspixs54zfcm4racgmj1mrj4"; }) (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.macOS"; version = "2.8.2-preview.178"; sha256 = "0p8miaclnbfpacc1jaqxwfg0yfx9byagi4j4k91d9621vd19i8b2"; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.macOS"; version = "2.8.2.1-preview.1"; sha256 = "0z0fadsicysa77ji4fnjkaaqfpc0d1w7x9qlkq40kb3jg7xhsmyx"; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.macOS"; version = "2.8.2.1-preview.108"; sha256 = "16v7lrwwif2f5zfkx08n6y6w3m56mh4hy757biv0w9yffaf200js"; }) (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.WebAssembly"; version = "2.8.2-preview.178"; sha256 = "1n9jay9sji04xly6n8bzz4591fgy8i65p21a8mv5ip9lsyj1c320"; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.WebAssembly"; version = "2.8.2.1-preview.108"; sha256 = "15kqb353snwpavz3jja63mq8xjqsrw1f902scm8wxmsqrm5q6x55"; }) (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Win32"; version = "2.8.2-preview.178"; sha256 = "1r5syii96wv8q558cvsqw3lr10cdw6677lyiy82p6i3if51v3mr7"; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Win32"; version = "2.8.2.1-preview.1"; sha256 = "15671jvv5j98rkv249nn1fchxcd9gq8b37iwjqbmijig3r4ir718"; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Win32"; version = "2.8.2.1-preview.108"; sha256 = "0n6ymn9jqms3mk5hg0ar4y9jmh96myl6q0jimn7ahb1a8viq55k1"; }) (fetchNuGet { pname = "InputSimulatorCore"; version = "1.0.5"; sha256 = "1vfqhqjcrpzahhvv5kyh6pk6j5c06wd0b2831y31fbxpdkxhbs2p"; }) (fetchNuGet { pname = "JetBrains.Annotations"; version = "10.3.0"; sha256 = "1grdx28ga9fp4hwwpwv354rizm8anfq4lp045q4ss41gvhggr3z8"; }) (fetchNuGet { pname = "libsodium"; version = "1.0.18"; sha256 = "15qzl5k31yaaapqlijr336lh4lzz1qqxlimgxy8fdyig8jdmgszn"; }) @@ -112,16 +121,21 @@ (fetchNuGet { pname = "Serilog.Sinks.Debug"; version = "2.0.0"; sha256 = "1i7j870l47gan3gpnnlzkccn5lbm7518cnkp25a3g5gp9l0dbwpw"; }) (fetchNuGet { pname = "Serilog.Sinks.File"; version = "5.0.0"; sha256 = "097rngmgcrdfy7jy8j7dq3xaq2qky8ijwg0ws6bfv5lx0f3vvb0q"; }) (fetchNuGet { pname = "Serilog.Sinks.Trace"; version = "3.0.0"; sha256 = "10byjmh2s0c13lmnzfw24qmr11kry9hg9y5fib3556y7759qwbqv"; }) - (fetchNuGet { pname = "ShimSkiaSharp"; version = "0.5.13"; sha256 = "0gzsiv85g0i8jmjl0nplvljqrgc4y42ds1q0f1x1hdqbnn7vsav2"; }) - (fetchNuGet { pname = "SkiaSharp"; version = "2.88.0-preview.178"; sha256 = "062g14s6b2bixanpwihj3asm3jwvfw15mhvzqv6901afrlgzx4nk"; }) - (fetchNuGet { pname = "SkiaSharp.HarfBuzz"; version = "2.88.0-preview.178"; sha256 = "1gwk81iq6zipab3dhpwydrqm2mqz67hpx7asvhna3mx0phrp2zqd"; }) - (fetchNuGet { pname = "SkiaSharp.NativeAssets.Linux"; version = "2.88.0-preview.178"; sha256 = "07kga1j51l3l302nvf537zg5clf6rflinjy0xd6i06cmhpkf3ksw"; }) - (fetchNuGet { pname = "SkiaSharp.NativeAssets.macOS"; version = "2.88.0-preview.178"; sha256 = "14p95nxccs6yq4rn2h9zbb60k0232k6349zdpy31jcfr6gc99cgi"; }) - (fetchNuGet { pname = "SkiaSharp.NativeAssets.WebAssembly"; version = "2.88.0-preview.178"; sha256 = "09jmcg5k1vpsal8jfs90mwv0isf2y5wq3h4hd77rv6vffn5ic4sm"; }) - (fetchNuGet { pname = "SkiaSharp.NativeAssets.Win32"; version = "2.88.0-preview.178"; sha256 = "0ficil702lv3fvwpngbqh5l85i05l5jafzyh4jprzshr2qbnd8nl"; }) - (fetchNuGet { pname = "Svg.Custom"; version = "0.5.13"; sha256 = "1a6rwgwwqg98dhk5hdb38iffa39khcrvfwskl6i5j3xgvgzzq2lx"; }) - (fetchNuGet { pname = "Svg.Model"; version = "0.5.13"; sha256 = "0rxm79asyx1dji8x7q1z47mzy6zh8qbgw7py6xfkfj89cai6x4p8"; }) - (fetchNuGet { pname = "Svg.Skia"; version = "0.5.13"; sha256 = "1f00mzx7gzfhy42yldi3jzaivsl3byspak22rji86iq0vczz28zg"; }) + (fetchNuGet { pname = "ShimSkiaSharp"; version = "0.5.16"; sha256 = "06qf63bx6m18wbhvzfs89m5yl5s08spgg02gr7qy8j36r04k6cc5"; }) + (fetchNuGet { pname = "SkiaSharp"; version = "2.88.1-preview.1"; sha256 = "1i1px67hcr9kygmbfq4b9nqzlwm7v2gapsp4isg9i19ax5g8dlhm"; }) + (fetchNuGet { pname = "SkiaSharp"; version = "2.88.1-preview.108"; sha256 = "01sm36hdgmcgkai9m09xn2qfz8v7xhh803n8fng8rlxwnw60rgg6"; }) + (fetchNuGet { pname = "SkiaSharp.HarfBuzz"; version = "2.88.1-preview.1"; sha256 = "0r14s3zyn3cpic02j80xjh8x6dd8g671f9nfnng5zk1x497qdw3a"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.Linux"; version = "2.88.1-preview.1"; sha256 = "1r9qr3civk0ws1z7hg322qyr8yjm10853zfgs03szr2lvdqiy7d1"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.Linux"; version = "2.88.1-preview.108"; sha256 = "19jf2jcq2spwbpx3cfdi2a95jf4y8205rh56lmkh8zsxd2k7fjyp"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.macOS"; version = "2.88.1-preview.1"; sha256 = "1w55nrwpl42psn6klia5a9aw2j1n25hpw2fdhchypm9f0v2iz24h"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.macOS"; version = "2.88.1-preview.108"; sha256 = "1vcpqd7slh2b9gsacpd7mk1266r1xfnkm6230k8chl3ng19qlf15"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.WebAssembly"; version = "2.88.1-preview.1"; sha256 = "0mwj2yl4gn40lry03yqkj7sbi1drmm672dv88481sgah4c21lzrq"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.WebAssembly"; version = "2.88.1-preview.108"; sha256 = "0a89gqjw8k97arr0kyd0fm3f46k1qamksbnyns9xdlgydjg557dd"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.Win32"; version = "2.88.1-preview.1"; sha256 = "1k50abd147pif9z9lkckbbk91ga1vv6k4skjz2n7wpll6fn0fvlv"; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.Win32"; version = "2.88.1-preview.108"; sha256 = "05g9blprq5msw3wshrgsk19y0fvhjlqiybs1vdyhfmww330jlypn"; }) + (fetchNuGet { pname = "Svg.Custom"; version = "0.5.16"; sha256 = "0qp0vmknclaahf1aj8y2jl4xbaq30rf4ia55fpawxi25dfxsa4wy"; }) + (fetchNuGet { pname = "Svg.Model"; version = "0.5.16"; sha256 = "0c2hk7wgvd2lbc96jxnkcwmzbbdnwgnhh4km9ijb5248qkghs1b1"; }) + (fetchNuGet { pname = "Svg.Skia"; version = "0.5.16"; sha256 = "0ra6svakyg5h6m19ww5yrxl85w8yi3v5vrzqgcnqlvzndk696cyf"; }) (fetchNuGet { pname = "System.AppContext"; version = "4.3.0"; sha256 = "1649qvy3dar900z3g817h17nl8jp4ka5vcfmsr05kh0fshn7j3ya"; }) (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; }) (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; sha256 = "19r4y64dqyrq6k4706dnyhhw7fs24kpp3awak7whzss39dakpxk9"; }) @@ -154,6 +168,7 @@ (fetchNuGet { pname = "System.Linq"; version = "4.3.0"; sha256 = "1w0gmba695rbr80l1k2h4mrwzbzsyfl2z4klmpbsvsg5pm4a56s7"; }) (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.3.0"; sha256 = "0ky2nrcvh70rqq88m9a5yqabsl4fyd17bpr63iy2mbivjs2nyypv"; }) (fetchNuGet { pname = "System.Memory"; version = "4.5.3"; sha256 = "0naqahm3wljxb5a911d37mwjqjdxv9l0b49p5dmfyijvni2ppy8a"; }) + (fetchNuGet { pname = "System.Memory"; version = "4.5.4"; sha256 = "14gbbs22mcxwggn0fcfs1b062521azb9fbb7c113x0mq6dzq9h6y"; }) (fetchNuGet { pname = "System.Net.Http"; version = "4.3.0"; sha256 = "1i4gc757xqrzflbk7kc5ksn20kwwfjhw9w7pgdkn19y3cgnl302j"; }) (fetchNuGet { pname = "System.Net.NameResolution"; version = "4.3.0"; sha256 = "15r75pwc0rm3vvwsn8rvm2krf929mjfwliv0mpicjnii24470rkq"; }) (fetchNuGet { pname = "System.Net.Primitives"; version = "4.3.0"; sha256 = "0c87k50rmdgmxx7df2khd9qj7q35j9rzdmm2572cc55dygmdk3ii"; }) diff --git a/pkgs/applications/editors/tweak/default.nix b/pkgs/applications/editors/tweak/default.nix index 887a9a8e6923..f6b241c9d07f 100644 --- a/pkgs/applications/editors/tweak/default.nix +++ b/pkgs/applications/editors/tweak/default.nix @@ -11,11 +11,12 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ]; preBuild = "substituteInPlace Makefile --replace '$(DESTDIR)/usr/local' $out"; + makeFlags = [ "CC:=$(CC)" "LINK:=$(CC)" ]; meta = with lib; { description = "An efficient hex editor"; homepage = "http://www.chiark.greenend.org.uk/~sgtatham/tweak"; license = licenses.mit; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix index ace04b883728..365b26642b3e 100644 --- a/pkgs/applications/editors/vscode/extensions/default.nix +++ b/pkgs/applications/editors/vscode/extensions/default.nix @@ -343,8 +343,8 @@ let mktplcRef = { name = "vscode-neovim"; publisher = "asvetliakov"; - version = "0.8.2"; - sha256 = "0kw9asv91s37ql61blbb8pr7wb6c2ba1klchal53chp6ib55v5kn"; + version = "1.0.1"; + sha256 = "1yf065syb5hskds47glnv18nk0fg7d84w1j72hg1pqb082gn1sdv"; }; meta = { changelog = "https://marketplace.visualstudio.com/items/asvetliakov.vscode-neovim/changelog"; diff --git a/pkgs/applications/misc/cherrytree/default.nix b/pkgs/applications/misc/cherrytree/default.nix index 04c30deef773..33e834100044 100644 --- a/pkgs/applications/misc/cherrytree/default.nix +++ b/pkgs/applications/misc/cherrytree/default.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation rec { pname = "cherrytree"; - version = "1.0.1"; + version = "1.0.2"; src = fetchFromGitHub { owner = "giuspen"; repo = "cherrytree"; - rev = version; - hash = "sha256-A/4OcsAOECgQnENj2l9BX713KHG+zk5cJE+yyHXw1TM="; + rev = "refs/tags/v${version}"; + hash = "sha256-ZGw6gESKaio89mt3VPm/uqHwlUQ0/8vIydv/WsOYQ20="; }; nativeBuildInputs = [ diff --git a/pkgs/applications/misc/spicetify-cli/default.nix b/pkgs/applications/misc/spicetify-cli/default.nix index 9c6c8f93f3f7..b9ac311bcea7 100644 --- a/pkgs/applications/misc/spicetify-cli/default.nix +++ b/pkgs/applications/misc/spicetify-cli/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "spicetify-cli"; - version = "2.27.0"; + version = "2.27.1"; src = fetchFromGitHub { owner = "spicetify"; repo = "spicetify-cli"; rev = "v${version}"; - hash = "sha256-5WIITzm9yZWB847WHL+okwpULdwHegtZfvsVrAzwTO0="; + hash = "sha256-Z+paJAuzUnCdCSx2UHg1HV14vDo3jWsyUrcbEnvqTm0="; }; - vendorHash = "sha256-VktAO3yKCdm5yz/RRLeLv6zzyGrwuHC/i8WdJtqZoYc="; + vendorHash = "sha256-H2kSTsYiD9HResHes+7YxUyNcjtM0SLpDPUC0Y518VM="; ldflags = [ "-s -w" diff --git a/pkgs/applications/networking/cluster/werf/default.nix b/pkgs/applications/networking/cluster/werf/default.nix index 0d58e54bcb42..9895729c29eb 100644 --- a/pkgs/applications/networking/cluster/werf/default.nix +++ b/pkgs/applications/networking/cluster/werf/default.nix @@ -10,16 +10,16 @@ buildGoModule rec { pname = "werf"; - version = "1.2.267"; + version = "1.2.269"; src = fetchFromGitHub { owner = "werf"; repo = "werf"; rev = "v${version}"; - hash = "sha256-OlTlyo/JbmXyoMBSDnKHvjGN6NMRrk0kQT63R34gtOs="; + hash = "sha256-LUHENANM+3wGftTVXaQsGykKayzEAIQ3TQ5qM77TJVA="; }; - vendorHash = "sha256-0bxM0Y4K6wxg6Ka1A9MusptiSMshTUWJItXoVDpo7lI="; + vendorHash = "sha256-20bPsBRya7Gg7p/hSSnnYLoSHf/fRwk1UrA/KlMT3Jk="; proxyVendor = true; diff --git a/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix b/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix index d3c6a33d248b..63d8b250b96a 100644 --- a/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix @@ -4,11 +4,11 @@ let in stdenv.mkDerivation rec { pname = "rocketchat-desktop"; - version = "3.9.9"; + version = "3.9.10"; src = fetchurl { url = "https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/${version}/rocketchat-${version}-linux-amd64.deb"; - hash = "sha256-50mVmE+q2VYJXIv2iD6ppS83We0aJRT9vje+zpJcdq0="; + hash = "sha256-VLHkFiIwfjCHr08wTsD8rMWSvHEswZCKl2XJr61cQYE="; }; nativeBuildInputs = [ diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix index c6191e8b4776..e0d3a4171cac 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix @@ -103,14 +103,14 @@ let in stdenv.mkDerivation rec { pname = "telegram-desktop"; - version = "4.11.6"; + version = "4.11.8"; src = fetchFromGitHub { owner = "telegramdesktop"; repo = "tdesktop"; rev = "v${version}"; fetchSubmodules = true; - hash = "sha256-GV5jaC1chm4cq097/aP18Z4QemTO4tt8SBrdxCQYaS8="; + hash = "sha256-VuMcqbGo1t1J7I8kXdqsw/01Mth9YKEbiy8aNtM3azw="; }; patches = [ diff --git a/pkgs/applications/networking/seaweedfs/default.nix b/pkgs/applications/networking/seaweedfs/default.nix index fe06e6a09a44..dd94e7bd88d1 100644 --- a/pkgs/applications/networking/seaweedfs/default.nix +++ b/pkgs/applications/networking/seaweedfs/default.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "seaweedfs"; - version = "3.58"; + version = "3.59"; src = fetchFromGitHub { owner = "seaweedfs"; repo = "seaweedfs"; rev = version; - hash = "sha256-4USDCss2KYjyuwH55ZqMwBWsf7iDcjN7qxTSXvKDkus="; + hash = "sha256-askngehfEBJzJG0MVBA4WCRUPDELWlwJWcRPH6gTvzw="; }; - vendorHash = "sha256-cbc6xKAneBCWpc4kUQUtgV5rrsggCGvVkt9tkypeCiE="; + vendorHash = "sha256-o+moq4arkQLQZcsW4Tahpv1MpGRHwMv+IL5E03W0U5c="; subPackages = [ "weed" ]; diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix index 042f623366db..35c6620c34c4 100644 --- a/pkgs/applications/networking/syncthing/default.nix +++ b/pkgs/applications/networking/syncthing/default.nix @@ -13,13 +13,13 @@ let common = { stname, target, postInstall ? "" }: buildGoModule rec { pname = stname; - version = "1.26.0"; + version = "1.26.1"; src = fetchFromGitHub { owner = "syncthing"; repo = "syncthing"; rev = "v${version}"; - hash = "sha256-JsjZzOYBQ5DD7BsBq/lO2AZvC3Rx4mGr5cUJEU6ufNc="; + hash = "sha256-R7JTHlNP1guKRfiDjPVi1lnvfUAXuPDNDAMTGmbj3Hc="; }; vendorHash = "sha256-XYXIj+7xe33hCYM6Z9tqGSgr/P0LVlaPNf3T0PrxU7I="; diff --git a/pkgs/applications/science/electronics/kicad/addons/default.nix b/pkgs/applications/science/electronics/kicad/addons/default.nix new file mode 100644 index 000000000000..5170e7efce36 --- /dev/null +++ b/pkgs/applications/science/electronics/kicad/addons/default.nix @@ -0,0 +1,5 @@ +{ kicad }: +{ + kikit = kicad.callPackage ./kikit.nix { addonName = "kikit"; }; + kikit-library = kicad.callPackage ./kikit.nix { addonName = "kikit-library"; }; +} diff --git a/pkgs/applications/science/electronics/kicad/addons/kikit.nix b/pkgs/applications/science/electronics/kicad/addons/kikit.nix new file mode 100644 index 000000000000..6e5fc5ad9678 --- /dev/null +++ b/pkgs/applications/science/electronics/kicad/addons/kikit.nix @@ -0,0 +1,52 @@ +# For building the multiple addons that are in the kikit repo. +{ stdenv +, bc +, kikit +, zip +, python3 +, addonName +, addonPath +}: +let + # This python is only used when building the package, it's not the python + # environment that will ultimately run the code packaged here. The python env defined + # in KiCad will import the python code packaged here when KiCad starts up. + python = python3.withPackages (ps: with ps; [ click ]); + kikit-module = python3.pkgs.toPythonModule (kikit.override { inherit python3; }); + + # The following different addons can be built from the same source. + targetSpecs = { + "kikit" = { + makeTarget = "pcm-kikit"; + resultZip = "pcm-kikit.zip"; + description = "KiCad plugin and a CLI tool to automate several tasks in a standard KiCad workflow"; + }; + "kikit-library" = { + makeTarget = "pcm-lib"; + resultZip = "pcm-kikit-lib.zip"; + description = "KiKit uses these symbols and footprints to annotate your boards (e.g., to place a tab in a panel)."; + }; + }; + targetSpec = targetSpecs.${addonName}; +in +stdenv.mkDerivation { + name = "kicadaddon-${addonName}"; + inherit (kikit-module) src version; + + nativeBuildInputs = [ python bc zip ]; + propagatedBuildInputs = [ kikit-module ]; + + buildPhase = '' + patchShebangs scripts/setJson.py + make ${targetSpec.makeTarget} + ''; + + installPhase = '' + mkdir $out + mv build/${targetSpec.resultZip} $out/${addonPath} + ''; + + meta = kikit-module.meta // { + description = targetSpec.description; + }; +} diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix index 3403e410cf85..a2e5bbe72a56 100644 --- a/pkgs/applications/science/electronics/kicad/base.nix +++ b/pkgs/applications/science/electronics/kicad/base.nix @@ -69,6 +69,8 @@ stdenv.mkDerivation rec { patches = [ # upstream issue 12941 (attempted to upstream, but appreciably unacceptable) ./writable.patch + # https://gitlab.com/kicad/code/kicad/-/issues/15687 + ./runtime_stock_data_path.patch ]; # tagged releases don't have "unknown" diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix index a49c813036d3..c6c66839e4bc 100644 --- a/pkgs/applications/science/electronics/kicad/default.nix +++ b/pkgs/applications/science/electronics/kicad/default.nix @@ -1,4 +1,6 @@ { lib, stdenv +, runCommand +, newScope , fetchFromGitLab , gnome , dconf @@ -11,6 +13,8 @@ , callPackages , librsvg , cups +, unzip +, jq , pname ? "kicad" , stable ? true @@ -18,6 +22,7 @@ , libngspice , withScripting ? true , python3 +, addons ? [ ] , debug ? false , sanitizeAddress ? false , sanitizeThreads ? false @@ -27,6 +32,14 @@ , symlinkJoin }: +# `addons`: https://dev-docs.kicad.org/en/addons/ +# +# ```nix +# kicad = pkgs.kicad.override { +# addons = with pkgs.kicadAddons; [ kikit kikit-library ]; +# }; +# ``` + # The `srcs` parameter can be used to override the kicad source code # and all libraries, which are otherwise inaccessible # to overlays since most of the kicad build expression has been @@ -106,6 +119,32 @@ let wxGTK = wxGTK32; python = python3; wxPython = python.pkgs.wxPython_4_2; + addonPath = "addon.zip"; + addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons; + + addonsJoined = + runCommand "addonsJoined" + { + inherit addonsDrvs; + nativeBuildInputs = [ unzip jq ]; + } '' + mkdir $out + + for pkg in $addonsDrvs; do + unzip $pkg/addon.zip -d unpacked + + folder_name=$(jq .identifier unpacked/metadata.json --raw-output | tr . _) + for d in unpacked/*; do + if [ -d "$d" ]; then + dest=$out/share/kicad/scripting/$(basename $d)/$folder_name + mkdir -p $(dirname $dest) + + mv $d $dest + fi + done + rm -r unpacked + done + ''; inherit (lib) concatStringsSep flatten optionalString optionals; in @@ -113,6 +152,7 @@ stdenv.mkDerivation rec { # Common libraries, referenced during runtime, via the wrapper. passthru.libraries = callPackages ./libraries.nix { inherit libSrc; }; + passthru.callPackage = newScope { inherit addonPath python3; }; base = callPackage ./base.nix { inherit stable baseName; inherit kicadSrc kicadVersion; @@ -131,7 +171,7 @@ stdenv.mkDerivation rec { dontFixup = true; pythonPath = optionals (withScripting) - [ wxPython python.pkgs.six python.pkgs.requests ]; + [ wxPython python.pkgs.six python.pkgs.requests ] ++ addonsDrvs; nativeBuildInputs = [ makeWrapper ] ++ optionals (withScripting) @@ -164,6 +204,17 @@ stdenv.mkDerivation rec { "--set-default KICAD7_SYMBOL_DIR ${symbols}/share/kicad/symbols" "--set-default KICAD7_TEMPLATE_DIR ${template_dir}" ] + ++ optionals (addons != [ ]) ( + let stockDataPath = symlinkJoin { + name = "kicad_stock_data_path"; + paths = [ + "${base}/share/kicad" + "${addonsJoined}/share/kicad" + ]; + }; + in + [ "--set-default NIX_KICAD7_STOCK_DATA_PATH ${stockDataPath}" ] + ) ++ optionals (with3d) [ "--set-default KICAD7_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels" diff --git a/pkgs/applications/science/electronics/kicad/runtime_stock_data_path.patch b/pkgs/applications/science/electronics/kicad/runtime_stock_data_path.patch new file mode 100644 index 000000000000..16f7e493c623 --- /dev/null +++ b/pkgs/applications/science/electronics/kicad/runtime_stock_data_path.patch @@ -0,0 +1,15 @@ +diff --git a/common/paths.cpp b/common/paths.cpp +index a74cdd9..790cc58 100644 +--- a/common/paths.cpp ++++ b/common/paths.cpp +@@ -151,6 +151,10 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir ) + { + wxString path; + ++ if( wxGetEnv( wxT( "NIX_KICAD7_STOCK_DATA_PATH" ), &path ) ) { ++ return path; ++ } ++ + if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) ) + { + // Allow debugging from build dir by placing relevant files/folders in the build root diff --git a/pkgs/applications/version-management/git-mit/default.nix b/pkgs/applications/version-management/git-mit/default.nix index 0f630f049ba9..36cda3dfc722 100644 --- a/pkgs/applications/version-management/git-mit/default.nix +++ b/pkgs/applications/version-management/git-mit/default.nix @@ -10,7 +10,7 @@ }: let - version = "5.12.171"; + version = "5.12.174"; in rustPlatform.buildRustPackage { pname = "git-mit"; @@ -20,10 +20,10 @@ rustPlatform.buildRustPackage { owner = "PurpleBooth"; repo = "git-mit"; rev = "v${version}"; - hash = "sha256-K2d12isOOPs8ba77VhQSXRHSYLZZIkZJlM9d3/G4nOo="; + hash = "sha256-juCiPulDVDDg9+DXUf9Gp/1lMoQ0NKLUTrzOqlv+32w="; }; - cargoHash = "sha256-m5b57dJ6IRJ10eJRF5lj2+WiNswHxj08LgXz7KJiTaw="; + cargoHash = "sha256-Wtw7GBPUci4fbplQDtz1Yxrf+7+3ABIe7GPN/gUER6I="; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/applications/video/webtorrent_desktop/default.nix b/pkgs/applications/video/webtorrent_desktop/default.nix index f5b90bb2c884..925fa38a199a 100644 --- a/pkgs/applications/video/webtorrent_desktop/default.nix +++ b/pkgs/applications/video/webtorrent_desktop/default.nix @@ -1,15 +1,27 @@ -{ lib, stdenv, electron_22, buildNpmPackage, fetchFromGitHub }: +{ lib, stdenv, electron, buildNpmPackage, fetchFromGitHub, fetchpatch }: buildNpmPackage { pname = "webtorrent-desktop"; - version = "0.25-pre"; + version = "0.25-pre-1eb612"; src = fetchFromGitHub { owner = "webtorrent"; repo = "webtorrent-desktop"; - rev = "fce078defefd575cb35a5c79d3d9f96affc8a08f"; - sha256 = "sha256-gXFiG36qqR0QHTqhaxgQKDO0UCHkJLnVwUTQB/Nct/c="; + rev = "1eb61201d6360698a2cc4ea72bf0fa7ee78b457c"; + sha256 = "sha256-DBEFOamncyidMXypvKNnUmDIPUq1LzYjDgox7fa4+Gg="; }; - npmDepsHash = "sha256-pEuvstrZ9oMdJ/iU6XwEQ1BYOyQp/ce6sYBTrMCjGMc="; + patches = [ + # electron 27 fix + (fetchpatch { + url = "https://github.com/webtorrent/webtorrent-desktop/pull/2388.patch"; + hash = "sha256-gam5oAZtsaiCNFwecA5ff0nhraySLx3SOHlb/js+cPM="; + }) + # startup fix + (fetchpatch { + url = "https://github.com/webtorrent/webtorrent-desktop/pull/2389.patch"; + hash = "sha256-hBJGLNNjcGRhYOFlLm/RL0po+70tEeJtR6Y/CfacPAI="; + }) + ]; + npmDepsHash = "sha256-tqhp3jDb1xtyV/n9kJtzkiznLQfqeYWeZiTnTVV0ibE="; makeCacheWritable = true; npmRebuildFlags = [ "--ignore-scripts" ]; installPhase = '' @@ -31,7 +43,7 @@ buildNpmPackage { cat > $out/bin/WebTorrent <name)/class_create(dev->name)/g" mst_main.c + ''; + + installPhase = '' + runHook preInstall + + install -D ${pname}.ko $out/lib/modules/${kernel.modDirVersion}/extra/${pname}.ko + + runHook postInstall + ''; + + meta = with lib; { + description = "A kernel module for Nvidia NIC firmware update"; + homepage = "https://github.com/Mellanox/mstflint"; + license = [ licenses.gpl2Only ]; + maintainers = with maintainers; [ thillux ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/trinity/default.nix b/pkgs/os-specific/linux/trinity/default.nix index 09a2d8bf638d..e0ab2b2802f1 100644 --- a/pkgs/os-specific/linux/trinity/default.nix +++ b/pkgs/os-specific/linux/trinity/default.nix @@ -1,25 +1,16 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch }: +{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "trinity"; - version = "1.9"; + version = "1.9-unstable-2023-07-10"; src = fetchFromGitHub { owner = "kernelslacker"; repo = "trinity"; - rev = "v${version}"; - sha256 = "0z1a7x727xacam74jccd223k303sllgwpq30lnq9b6xxy8b659bv"; + rev = "e71872454d26baf37ae1d12e9b04a73d64179555"; + hash = "sha256-Zy+4L1CuB2Ul5iF+AokDkAW1wheDzoCTNkvRZFGRNps="; }; - patches = [ - # Pull upstream fix for -fno-common toolchains - (fetchpatch { - name = "fno-common.patch"; - url = "https://github.com/kernelslacker/trinity/commit/e53e25cc8dd5bdb5f7d9b4247de9e9921eec81d8.patch"; - sha256 = "0dbhyc98x11cmac6rj692zymnfqfqcbawlrkg1lhgfagzjxxwshg"; - }) - ]; - postPatch = '' patchShebangs configure patchShebangs scripts @@ -27,12 +18,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - makeFlags = [ "DESTDIR=$(out)" ]; + installFlags = [ "DESTDIR=$(out)" ]; meta = with lib; { description = "A Linux System call fuzz tester"; - homepage = "https://codemonkey.org.uk/projects/trinity/"; - license = licenses.gpl2; + homepage = "https://github.com/kernelslacker/trinity"; + license = licenses.gpl2Only; maintainers = [ maintainers.dezgeg ]; platforms = platforms.linux; }; diff --git a/pkgs/servers/http/jetty/11.x.nix b/pkgs/servers/http/jetty/11.x.nix new file mode 100644 index 000000000000..3196b24d7485 --- /dev/null +++ b/pkgs/servers/http/jetty/11.x.nix @@ -0,0 +1,4 @@ +import ./common.nix { + version = "11.0.18"; + hash = "sha256-HxtO2r6YWo6+MAYUgk7dNSPDqQZoyO9t/8NdI5pPkL4="; +} diff --git a/pkgs/servers/http/jetty/12.x.nix b/pkgs/servers/http/jetty/12.x.nix new file mode 100644 index 000000000000..4dba445b6b90 --- /dev/null +++ b/pkgs/servers/http/jetty/12.x.nix @@ -0,0 +1,4 @@ +import ./common.nix { + version = "12.0.3"; + hash = "sha256-Z/jJKKzoqTPZnoFOMwbpSd/Kd1w+rXloKH+aw6aNrKs="; +} diff --git a/pkgs/servers/http/jetty/default.nix b/pkgs/servers/http/jetty/common.nix similarity index 73% rename from pkgs/servers/http/jetty/default.nix rename to pkgs/servers/http/jetty/common.nix index 1ebd33f51d6f..83adac4ddd0d 100644 --- a/pkgs/servers/http/jetty/default.nix +++ b/pkgs/servers/http/jetty/common.nix @@ -1,11 +1,15 @@ +{ version, hash }: + { lib, stdenv, fetchurl }: stdenv.mkDerivation rec { pname = "jetty"; - version = "12.0.2"; + + inherit version; + src = fetchurl { url = "mirror://maven/org/eclipse/jetty/jetty-home/${version}/jetty-home-${version}.tar.gz"; - hash = "sha256-DtlHTXjbr31RmK6ycDdiWOL7jIpbWNh0la90OnOhzvM="; + inherit hash; }; dontBuild = true; @@ -17,10 +21,10 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A Web server and javax.servlet container"; - homepage = "https://www.eclipse.org/jetty/"; + homepage = "https://eclipse.dev/jetty/"; platforms = platforms.all; sourceProvenance = with sourceTypes; [ binaryBytecode ]; license = with licenses; [ asl20 epl10 ]; - maintainers = with maintainers; [ emmanuelrosa ]; + maintainers = with maintainers; [ emmanuelrosa anthonyroussel ]; }; } diff --git a/pkgs/tools/audio/liquidsoap/full.nix b/pkgs/tools/audio/liquidsoap/full.nix index 5e196a5b557b..22925dce99fa 100644 --- a/pkgs/tools/audio/liquidsoap/full.nix +++ b/pkgs/tools/audio/liquidsoap/full.nix @@ -1,35 +1,68 @@ -{ lib, stdenv, makeWrapper, fetchurl, which, pkg-config +{ lib, stdenv, makeWrapper, fetchFromGitHub, which, pkg-config , libjpeg , ocamlPackages -, awscli2, curl, ffmpeg, youtube-dl -, runtimePackages ? [ awscli2 curl ffmpeg youtube-dl ] +, awscli2, bubblewrap, curl, ffmpeg, yt-dlp +, runtimePackages ? [ awscli2 bubblewrap curl ffmpeg yt-dlp ] }: let pname = "liquidsoap"; - version = "2.1.4"; + version = "2.2.2"; in stdenv.mkDerivation { inherit pname version; - src = fetchurl { - url = "https://github.com/savonet/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2"; - sha256 = "sha256-GQuG7f9U+/HqPcuj6hnBoH5mWEhxSwWgBnkCuLqHTAc="; + src = fetchFromGitHub { + owner = "savonet"; + repo = "liquidsoap"; + rev = "refs/tags/v${version}"; + hash = "sha256-t7rkWHSAd3DaTCXaGfL9NcIQYT+f4Od9D6huuZlwhWk="; }; - postFixup = '' + postPatch = '' + substituteInPlace src/lang/dune \ + --replace "(run git rev-parse --short HEAD)" "(run echo -n nixpkgs)" + ''; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + + dune build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + dune install --prefix "$out" + + runHook postInstall + ''; + + fixupPhase = '' + runHook preFixup + wrapProgram $out/bin/liquidsoap \ --set LIQ_LADSPA_PATH /run/current-system/sw/lib/ladspa \ --prefix PATH : ${lib.makeBinPath runtimePackages} - ''; + runHook postFixup + ''; strictDeps = true; - nativeBuildInputs = - [ makeWrapper pkg-config which - ocamlPackages.ocaml ocamlPackages.findlib ocamlPackages.menhir - ]; + nativeBuildInputs = [ + makeWrapper + pkg-config + which + ocamlPackages.ocaml + ocamlPackages.dune_3 + ocamlPackages.findlib + ocamlPackages.menhir + ]; buildInputs = [ libjpeg @@ -38,29 +71,36 @@ stdenv.mkDerivation { ocamlPackages.dtools ocamlPackages.duppy ocamlPackages.mm - ocamlPackages.ocaml_pcre - ocamlPackages.menhir ocamlPackages.menhirLib - (ocamlPackages.camomile.override { version = "1.0.2"; }) ocamlPackages.ocurl + ocamlPackages.cry + ocamlPackages.camomile ocamlPackages.uri - ocamlPackages.sedlex + ocamlPackages.fileutils + ocamlPackages.menhir # liquidsoap-lang + ocamlPackages.menhirLib + ocamlPackages.metadata + ocamlPackages.dune-build-info + ocamlPackages.re + ocamlPackages.sedlex # liquidsoap-lang + ocamlPackages.ppx_string # Recommended dependencies ocamlPackages.ffmpeg # Optional dependencies - ocamlPackages.camlimages - ocamlPackages.gd4o ocamlPackages.alsa ocamlPackages.ao ocamlPackages.bjack - ocamlPackages.cry + ocamlPackages.camlimages ocamlPackages.dssi ocamlPackages.faad ocamlPackages.fdkaac ocamlPackages.flac ocamlPackages.frei0r + ocamlPackages.gd4o + ocamlPackages.graphics ocamlPackages.gstreamer + ocamlPackages.imagelib ocamlPackages.inotify ocamlPackages.ladspa ocamlPackages.lame @@ -72,25 +112,22 @@ stdenv.mkDerivation { ocamlPackages.ogg ocamlPackages.opus ocamlPackages.portaudio + ocamlPackages.posix-time2 ocamlPackages.pulseaudio - ocamlPackages.shine ocamlPackages.samplerate + ocamlPackages.shine ocamlPackages.soundtouch ocamlPackages.speex ocamlPackages.srt ocamlPackages.ssl ocamlPackages.taglib ocamlPackages.theora - ocamlPackages.vorbis - ocamlPackages.xmlplaylist - ocamlPackages.posix-time2 ocamlPackages.tsdl ocamlPackages.tsdl-image ocamlPackages.tsdl-ttf - - # Undocumented dependencies - ocamlPackages.graphics - ocamlPackages.cohttp-lwt-unix + ocamlPackages.vorbis + ocamlPackages.xmlplaylist + ocamlPackages.yaml ]; meta = with lib; { diff --git a/pkgs/tools/misc/mstflint/default.nix b/pkgs/tools/misc/mstflint/default.nix index 51fd22b0c35e..619858cbe359 100644 --- a/pkgs/tools/misc/mstflint/default.nix +++ b/pkgs/tools/misc/mstflint/default.nix @@ -1,26 +1,109 @@ { lib , stdenv , fetchurl -, libibmad +, rdma-core , openssl , zlib +, xz +, expat +, boost +, curl +, pkg-config +, libxml2 +, pciutils +, busybox +, python3 +, automake +, autoconf +, libtool +, git +# use this to shrink the package's footprint if necessary (e.g. for hardened appliances) +, onlyFirmwareUpdater ? false +# contains binary-only libraries +, enableDPA ? true }: stdenv.mkDerivation rec { pname = "mstflint"; - version = "4.17.0-1"; + version = "4.26.0-1"; src = fetchurl { url = "https://github.com/Mellanox/mstflint/releases/download/v${version}/mstflint-${version}.tar.gz"; - sha256 = "030vpiv44sxmjf0dng91ziq1cggwj33yp0l4xc6cdhnrv2prjs7y"; + hash = "sha256-P8XACcz6d8UTOhFFeTijfFOthBqnUghGlDj9K145sZ8="; }; - buildInputs = [ - libibmad - openssl - zlib + nativeBuildInputs = [ + autoconf + automake + libtool + pkg-config + libxml2 + git ]; + buildInputs = [ + rdma-core + zlib + libxml2 + openssl + ] ++ lib.optionals (!onlyFirmwareUpdater) [ + boost + curl + expat + xz + python3 + ]; + + preConfigure = '' + export CPPFLAGS="-I$(pwd)/tools_layouts -isystem ${libxml2.dev}/include/libxml2" + export INSTALL_BASEDIR=$out + ./autogen.sh + ''; + + # Cannot use wrapProgram since the python script's logic depends on the + # filename and will get messed up if the executable is named ".xyz-wrapped". + # That is why the python executable and runtime dependencies are injected + # this way. + # + # Remove host_cpu replacement again (see https://github.com/Mellanox/mstflint/pull/865), + # needs to hit master or a release. master_devel may be rebased. + # + # Remove patch for regex check, after https://github.com/Mellanox/mstflint/pull/871 + # got merged. + prePatch = [ + '' + patchShebangs eval_git_sha.sh + substituteInPlace configure.ac \ + --replace "build_cpu" "host_cpu" + substituteInPlace common/compatibility.h \ + --replace "#define ROOT_PATH \"/\"" "#define ROOT_PATH \"$out/\"" + substituteInPlace configure.ac \ + --replace 'Whether to use GNU C regex])' 'Whether to use GNU C regex])],[AC_MSG_RESULT([yes])' + '' + (lib.optionals (!onlyFirmwareUpdater) '' + substituteInPlace common/python_wrapper.sh \ + --replace \ + 'exec $PYTHON_EXEC $SCRIPT_PATH "$@"' \ + 'export PATH=$PATH:${lib.makeBinPath [ (placeholder "out") pciutils busybox]}; exec ${python3}/bin/python3 $SCRIPT_PATH "$@"' + '') + ]; + + configureFlags = [ + "--enable-xml2" + "--datarootdir=${placeholder "out"}/share" + ] ++ lib.optionals (!onlyFirmwareUpdater) [ + "--enable-adb-generic-tools" + "--enable-cs" + "--enable-dc" + "--enable-fw-mgr" + "--enable-inband" + "--enable-rdmem" + ] ++ lib.optionals enableDPA [ + "--enable-dpa" + ]; + + enableParallelBuilding = true; + hardeningDisable = [ "format" ]; dontDisableStatic = true; # the build fails without this. should probably be reported upstream @@ -29,6 +112,7 @@ stdenv.mkDerivation rec { description = "Open source version of Mellanox Firmware Tools (MFT)"; homepage = "https://github.com/Mellanox/mstflint"; license = with licenses; [ gpl2 bsd2 ]; + maintainers = with maintainers; [ thillux ]; platforms = platforms.linux; }; } diff --git a/pkgs/tools/misc/plantuml-server/default.nix b/pkgs/tools/misc/plantuml-server/default.nix index 039e9acb2e8e..dc7fe1627a1c 100644 --- a/pkgs/tools/misc/plantuml-server/default.nix +++ b/pkgs/tools/misc/plantuml-server/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, nixosTests }: let version = "1.2023.12"; @@ -17,6 +17,10 @@ stdenv.mkDerivation rec { cp "$src" "$out/webapps/plantuml.war" ''; + passthru.tests = { + inherit (nixosTests) plantuml-server; + }; + meta = with lib; { description = "A web application to generate UML diagrams on-the-fly."; homepage = "https://plantuml.com/"; diff --git a/pkgs/tools/misc/qflipper/default.nix b/pkgs/tools/misc/qflipper/default.nix index 86043f7b0ba4..5c139d017c86 100644 --- a/pkgs/tools/misc/qflipper/default.nix +++ b/pkgs/tools/misc/qflipper/default.nix @@ -24,8 +24,8 @@ }: let pname = "qFlipper"; - version = "1.3.2"; - sha256 = "sha256-n/vvLR4p7ZmQC+FuYOvarmgydfYwxRBRktzs7CfiNQg="; + version = "1.3.3"; + sha256 = "sha256-/Xzy+OA0Nl/UlSkOOZW2YsOHdJvS/7X3Z3ITkPByAOc="; timestamp = "99999999999"; commit = "nix-${version}"; diff --git a/pkgs/tools/misc/ttyplot/default.nix b/pkgs/tools/misc/ttyplot/default.nix index a136031dfc13..3778048143be 100644 --- a/pkgs/tools/misc/ttyplot/default.nix +++ b/pkgs/tools/misc/ttyplot/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "ttyplot"; - version = "1.5"; + version = "1.5.1"; src = fetchFromGitHub { owner = "tenox7"; repo = "ttyplot"; rev = version; - sha256 = "sha256-COnqzWqah1J/q64XrOBhMOsrafAs/BptqNvrjHJ9edQ="; + sha256 = "sha256-lZLjTmSKxGJhUMELcIPjycpuRR3m9oz/Vh1/FEUzMOQ="; }; buildInputs = [ ncurses ]; diff --git a/pkgs/tools/networking/containerlab/default.nix b/pkgs/tools/networking/containerlab/default.nix index 0a8b02af7cf5..856a21cb9679 100644 --- a/pkgs/tools/networking/containerlab/default.nix +++ b/pkgs/tools/networking/containerlab/default.nix @@ -6,18 +6,18 @@ buildGoModule rec { pname = "containerlab"; - version = "0.46.2"; + version = "0.48.1"; src = fetchFromGitHub { owner = "srl-labs"; repo = "containerlab"; rev = "v${version}"; - hash = "sha256-TzHTiAcN57FDdKBkZq5YwFwjP3s6OmN3431XGoMgnwI="; + hash = "sha256-k166J9algbbwGMG65Sr0sshwhLwo5M7JDtGnG4AKZJM="; }; nativeBuildInputs = [ installShellFiles ]; - vendorHash = "sha256-3ALEwpFDnbSoTm3bxHZmRGkw1DeQ4Ikl6PpTosa1S6E="; + vendorHash = "sha256-w5lwZTSG6OI85P/swjK3NtovMqfgttr9DC+CPSKlpKQ="; ldflags = [ "-s" @@ -41,6 +41,6 @@ buildGoModule rec { changelog = "https://github.com/srl-labs/containerlab/releases/tag/${src.rev}"; license = licenses.bsd3; platforms = platforms.linux; - maintainers = with maintainers; [ janik ]; + maintainers = with maintainers; [ aaronjheng ]; }; } diff --git a/pkgs/tools/networking/sing-box/default.nix b/pkgs/tools/networking/sing-box/default.nix index 600ad2b13f8e..0d75f874a198 100644 --- a/pkgs/tools/networking/sing-box/default.nix +++ b/pkgs/tools/networking/sing-box/default.nix @@ -11,16 +11,16 @@ buildGoModule rec { pname = "sing-box"; - version = "1.6.4"; + version = "1.6.5"; src = fetchFromGitHub { owner = "SagerNet"; repo = pname; rev = "v${version}"; - hash = "sha256-BYmEtdGaNfZ4QJMF1a+W1LjURh7HpFK1rS64CR46z1M="; + hash = "sha256-djbRt4VdrZ2a0yLbNaFNhKIN0AwuCCJATIcwFhnw5aM="; }; - vendorHash = "sha256-aCYnr9Y6rxmTjY6Q/8IjYSmAVep/0ipitjjeArIhtPI="; + vendorHash = "sha256-qoW9+t427k5Ea9BhAdWIh+utD7EnIU1OLKJfsmYlEt8="; tags = [ "with_quic" diff --git a/pkgs/tools/networking/tgt/default.nix b/pkgs/tools/networking/tgt/default.nix index 4030e3d14ec1..cdde4191577d 100644 --- a/pkgs/tools/networking/tgt/default.nix +++ b/pkgs/tools/networking/tgt/default.nix @@ -4,13 +4,13 @@ stdenv.mkDerivation rec { pname = "tgt"; - version = "1.0.88"; + version = "1.0.89"; src = fetchFromGitHub { owner = "fujita"; repo = pname; rev = "v${version}"; - sha256 = "sha256-tLc+viPufR6P5texDs9lU8wsOTzrjSK0Qz/r4/L8M5k="; + sha256 = "sha256-sgflHkG4FncQ31+BwcZsp7LRgqeqANCIKGysxUk8aEs="; }; nativeBuildInputs = [ libxslt docbook_xsl makeWrapper ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 64143a43cbdd..173923343d2a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26569,7 +26569,9 @@ with pkgs; jboss_mysql_jdbc = callPackage ../servers/http/jboss/jdbc/mysql { }; - jetty = callPackage ../servers/http/jetty { }; + jetty = jetty_12; + jetty_12 = callPackage ../servers/http/jetty/12.x.nix { }; + jetty_11 = callPackage ../servers/http/jetty/11.x.nix { }; jibri = callPackage ../servers/jibri { }; @@ -34245,10 +34247,6 @@ with pkgs; roxctl = callPackage ../applications/networking/cluster/roxctl { }; - rqbit = callPackage ../applications/networking/p2p/rqbit { - inherit (darwin.apple_sdk.frameworks) Security; - }; - rssguard = libsForQt5.callPackage ../applications/networking/feedreaders/rssguard { }; scudcloud = callPackage ../applications/networking/instant-messengers/scudcloud { }; @@ -36478,7 +36476,9 @@ with pkgs; webssh = with python3Packages; toPythonApplication webssh; - webtorrent_desktop = callPackage ../applications/video/webtorrent_desktop { }; + webtorrent_desktop = callPackage ../applications/video/webtorrent_desktop { + electron = electron_27; + }; wrapWeechat = callPackage ../applications/networking/irc/weechat/wrapper.nix { }; @@ -39830,6 +39830,8 @@ with pkgs; with3d = false; }; + kicadAddons = recurseIntoAttrs (callPackage ../applications/science/electronics/kicad/addons {}); + librepcb = libsForQt5.callPackage ../applications/science/electronics/librepcb { }; ngspice = libngspice.override { diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index e01597cadea1..2cd4319e6650 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -381,6 +381,8 @@ in { lttng-modules = callPackage ../os-specific/linux/lttng-modules { }; + mstflint_access = callPackage ../os-specific/linux/mstflint_access { }; + broadcom_sta = callPackage ../os-specific/linux/broadcom-sta { }; tbs = callPackage ../os-specific/linux/tbs { }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 635a8d71c2e2..54e0d011e749 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1046,6 +1046,8 @@ let merlin-lib = callPackage ../development/tools/ocaml/merlin/lib.nix { }; + metadata = callPackage ../development/ocaml-modules/metadata { }; + metrics = callPackage ../development/ocaml-modules/metrics { }; metrics-influx = callPackage ../development/ocaml-modules/metrics/influx.nix { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5498e46647b9..b743179d7018 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3657,6 +3657,8 @@ self: super: with self; { et-xmlfile = callPackage ../development/python-modules/et-xmlfile { }; + euclid3 = callPackage ../development/python-modules/euclid3 { }; + eufylife-ble-client = callPackage ../development/python-modules/eufylife-ble-client { }; evaluate = callPackage ../development/python-modules/evaluate { }; @@ -8842,6 +8844,8 @@ self: super: with self; { inherit (pkgs) libpcap; # Avoid confusion with python package of the same name }; + pcbnew-transition = callPackage ../development/python-modules/pcbnew-transition { }; + pcodedmp = callPackage ../development/python-modules/pcodedmp { }; pcpp = callPackage ../development/python-modules/pcpp { }; @@ -9008,6 +9012,10 @@ self: super: with self; { psrpcore = callPackage ../development/python-modules/psrpcore { }; + pybars3 = callPackage ../development/python-modules/pybars3 { }; + + pymeta3 = callPackage ../development/python-modules/pymeta3 { }; + pypemicro = callPackage ../development/python-modules/pypemicro { }; pyprecice = callPackage ../development/python-modules/pyprecice { }; @@ -9111,6 +9119,8 @@ self: super: with self; { pixelmatch = callPackage ../development/python-modules/pixelmatch { }; + pixel-ring = callPackage ../development/python-modules/pixel-ring { }; + pjsua2 = (toPythonModule (pkgs.pjsip.override { pythonSupport = true; python3 = self.python;