Commit 68493639 authored by K900's avatar K900
Browse files

Merge remote-tracking branch 'origin/master' into staging-next

parents 48559805 6b0f198f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@

- `nodePackages.wavedrom-cli` has been removed, as it was unmaintained within nixpkgs.

- All `@tailwindcss` packages in the `nodePackages` set have been removed, as they are libraries that should instead be locked by JS projects that utilize them.

- `arti` has been updated to major version 2, which removed the long-deprecated `proxy.socks_port` and `proxy.dns_port` and the legacy syntax for specifying directory authorities. For more information, see the [changelog for 2.0.0](https://gitlab.torproject.org/tpo/core/arti/-/blob/arti-v2.0.0/CHANGELOG.md).

- `kanata` now requires `karabiner-dk` version 6.0+ or later.
+23 −6
Original line number Diff line number Diff line
@@ -8637,12 +8637,6 @@
    githubId = 5198058;
    name = "Udo Sauer";
  };
  fettgoenner = {
    email = "paulmatti@protonmail.com";
    github = "fettgoenner";
    githubId = 92429150;
    name = "Paul Meinhold";
  };
  feyorsh = {
    email = "george@feyor.sh";
    github = "Feyorsh";
@@ -11831,6 +11825,12 @@
    githubId = 1358764;
    name = "Jamie Magee";
  };
  janezp = {
    name = "Janez Podhostnik";
    email = "janez.podhostnik@ourplace.is";
    github = "janezpodhostnik";
    githubId = 67895329;
  };
  janhencic = {
    name = "Jan Hencic";
    email = "jan@hencic.com";
@@ -14836,6 +14836,11 @@
    githubId = 736291;
    name = "Lee Machin";
  };
  lefaucheur0769 = {
    name = "LeFaucheur0769";
    github = "LeFaucheur0769";
    githubId = 90474269;
  };
  legojames = {
    github = "jrobinson-uk";
    githubId = 4701504;
@@ -17472,6 +17477,12 @@
    githubId = 33701036;
    name = "Milo Mc";
  };
  mimahlavacek = {
    email = "mima.hlavacek@gmail.com";
    github = "mima-hlavacek";
    githubId = 55756477;
    name = "Míma Hlaváček";
  };
  mimame = {
    email = "miguel.madrid.mencia@gmail.com";
    github = "mimame";
@@ -21140,6 +21151,12 @@
    githubId = 103822;
    name = "Patrick Mahoney";
  };
  pmeinhold = {
    email = "paulmatti@protonmail.com";
    github = "pmeinhold";
    githubId = 92429150;
    name = "Paul Meinhold";
  };
  pmenke = {
    email = "nixos@pmenke.de";
    github = "pmenke-de";
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@

- [qui](https://github.com/autobrr/qui), a modern alternative webUI for qBittorrent, with multi-instance support. Written in Go/React. Available as [services.qui](#opt-services.qui.enable).

- [Remark42](https://remark42.com/), a self-hosted comment engine. Available as [services.remark42](#opt-services.remark42.enable).

- [LibreChat](https://www.librechat.ai/), open-source self-hostable ChatGPT clone with Agents and RAG APIs. Available as [services.librechat](#opt-services.librechat.enable).

- [nohang](https://github.com/hakavlad/nohang), a daemon for Linux that prevents out of memory (OOM) situations from affecting system responsiveness. Available as [services.nohang](#opt-services.nohang.enable)
+15 −1
Original line number Diff line number Diff line
@@ -228,6 +228,10 @@ in
    (mkRenamedOptionModule [ "programs" "info" "enable" ] [ "documentation" "info" "enable" ])
    (mkRenamedOptionModule [ "programs" "man" "enable" ] [ "documentation" "man" "enable" ])
    (mkRenamedOptionModule [ "services" "nixosManual" "enable" ] [ "documentation" "nixos" "enable" ])
    (mkRenamedOptionModule
      [ "documentation" "man" "generateCaches" ]
      [ "documentation" "man" "cache" "enable" ]
    )
    (mkRemovedOptionModule [
      "documentation"
      "nixos"
@@ -261,7 +265,7 @@ in
        '';
      };

      man.generateCaches = mkOption {
      man.cache.enable = mkOption {
        type = types.bool;
        default = false;
        description = ''
@@ -273,6 +277,16 @@ in
        '';
      };

      man.cache.generateAtRuntime = mkOption {
        type = types.bool;
        default = false;
        description = ''
          Whether to generate the manual page index caches at runtime using
          a systemd service. Note that this is currently only supported by the
          man-db module.
        '';
      };

      info.enable = mkOption {
        type = types.bool;
        default = true;
+75 −36
Original line number Diff line number Diff line
@@ -7,13 +7,14 @@

let
  cfg = config.documentation.man.man-db;
  cfgm = config.documentation.man;
in

{
  options = {
    documentation.man.man-db = {
      enable = lib.mkEnableOption "man-db as the default man page viewer" // {
        default = config.documentation.man.enable;
        default = cfgm.enable;
        defaultText = lib.literalExpression "config.documentation.man.enable";
        example = false;
      };
@@ -39,7 +40,7 @@ in
        };
        defaultText = lib.literalMD "all man pages in {option}`config.environment.systemPackages`";
        description = ''
          The manual pages to generate caches for if {option}`documentation.man.generateCaches`
          The manual pages to generate caches for if {option}`documentation.man.cache.enable`
          is enabled. Must be a path to a directory with man pages under
          `/share/man`; see the source for an example.
          Advanced users can make this a content-addressed derivation to save a few rebuilds.
@@ -65,7 +66,9 @@ in
    )
  ];

  config = lib.mkIf cfg.enable {
  config = lib.mkIf cfg.enable (
    lib.mkMerge [
      {
        environment.systemPackages = [ cfg.package ];
        environment.etc."man_db.conf".text =
          let
@@ -79,6 +82,7 @@ in
                pkgs.buildPackages.man-db;

            manualCache =
              if (!cfgm.cache.generateAtRuntime) then
                pkgs.runCommand "man-cache"
                  {
                    nativeBuildInputs = [ buildPackage ];
@@ -87,19 +91,54 @@ in
                  ''
                    echo "MANDB_MAP ${cfg.manualPages}/share/man $out" > man.conf
                    mandb -C man.conf -pscq
            '';
                  ''
              else
                "/var/cache/man/nixos-mandb";
          in
          ''
            # Manual pages paths for NixOS
            MANPATH_MAP /run/current-system/sw/bin /run/current-system/sw/share/man
            MANPATH_MAP /run/wrappers/bin          /run/current-system/sw/share/man

        ${lib.optionalString config.documentation.man.generateCaches ''
          # Generated manual pages cache for NixOS (immutable)
            ${lib.optionalString cfgm.cache.enable ''
              # Manual pages caches for NixOS
              MANDB_MAP /run/current-system/sw/share/man ${manualCache}
            ''}
        # Manual pages caches for NixOS
        MANDB_MAP /run/current-system/sw/share/man /var/cache/man/nixos
          '';
      }

      (lib.mkIf (cfgm.enable && cfgm.cache.generateAtRuntime) {
        users.users.mandb = {
          isSystemUser = true;
          group = "mandb";
        };
        users.groups.mandb = { };

        systemd.services.mandb = {
          path = [
            cfg.package
            pkgs.rsync
          ];
          script = ''
            rsync \
              --checksum --recursive --copy-links --delete --no-times --no-perms --chmod=+w \
              ${cfg.manualPages}/share/man/ "$CACHE_DIRECTORY/nixos-manpages"

            echo "MANDB_MAP $CACHE_DIRECTORY/nixos-manpages $CACHE_DIRECTORY/nixos-mandb" \
              > "$RUNTIME_DIRECTORY/man.conf"

            mandb -C "$RUNTIME_DIRECTORY/man.conf" -q
          '';
          serviceConfig = {
            CacheDirectory = "man";
            RuntimeDirectory = "mandb";
            User = "mandb";
            BindReadOnlyPaths = [ "/dev/null:/etc/man_db.conf" ]; # mandb will still read /etc/man_db.conf if it exists, even when setting -C path/to/config.conf
            ProtectSystem = "strict";
          };
          wantedBy = [ "default.target" ];
        };
      })
    ]
  );
}
Loading