Unverified Commit 856b27a8 authored by nixpkgs-ci[bot]'s avatar nixpkgs-ci[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 8b94c518 a7e3137d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3054,6 +3054,12 @@
    githubId = 5409401;
    name = "Bradley Cooley";
  };
  bct = {
    email = "bct@diffeq.com";
    github = "bct";
    githubId = 548;
    name = "Brendan Taylor";
  };
  bcyran = {
    email = "bazyli@cyran.dev";
    github = "bcyran";
+3 −0
Original line number Diff line number Diff line
@@ -124,6 +124,9 @@

- [Szurubooru](https://github.com/rr-/szurubooru), an image board engine inspired by services such as Danbooru, dedicated for small and medium communities. Available as [services.szurubooru](#opt-services.szurubooru.enable).

- [LubeLogger](https://lubelogger.com/), a vehicle maintenance and fuel mileage tracker.
  Available as [services.lubelogger](#opt-services.lubelogger.enable).

- The [Neat IP Address Planner](https://spritelink.github.io/NIPAP/) (NIPAP) can now be enabled through [services.nipap.enable](#opt-services.nipap.enable).

- [tpm2-totp](https://github.com/tpm2-software/tpm2-totp) can now be used to show a TOTP during boot using Plymouth. Available as [boot.plymouth.tpm2-totp](#opt-boot.plymouth.tpm2-totp.enable).
+1 −0
Original line number Diff line number Diff line
@@ -1646,6 +1646,7 @@
  ./services/web-apps/libretranslate.nix
  ./services/web-apps/limesurvey.nix
  ./services/web-apps/linkwarden.nix
  ./services/web-apps/lubelogger.nix
  ./services/web-apps/mainsail.nix
  ./services/web-apps/mastodon.nix
  ./services/web-apps/matomo.nix
+134 −0
Original line number Diff line number Diff line
{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.services.lubelogger;
in
{
  meta.maintainers = with lib.maintainers; [
    bct
    lyndeno
  ];

  options = {
    services.lubelogger = {
      enable = lib.mkEnableOption "LubeLogger, a self-hosted, open-source, web-based vehicle maintenance and fuel milage tracker";

      package = lib.mkPackageOption pkgs "lubelogger" { };

      dataDir = lib.mkOption {
        description = "Path to LubeLogger config and metadata inside of `/var/lib/`.";
        default = "lubelogger";
        type = lib.types.str;
      };

      port = lib.mkOption {
        description = "The TCP port LubeLogger will listen on.";
        default = 5000;
        type = lib.types.port;
      };

      user = lib.mkOption {
        description = "User account under which LubeLogger runs.";
        default = "lubelogger";
        type = lib.types.str;
      };

      group = lib.mkOption {
        description = "Group under which LubeLogger runs.";
        default = "lubelogger";
        type = lib.types.str;
      };

      openFirewall = lib.mkOption {
        description = "Open ports in the firewall for the LubeLogger web interface.";
        default = false;
        type = lib.types.bool;
      };

      settings = lib.mkOption {
        type = with lib.types; attrsOf str;
        default = { };
        example = {
          LUBELOGGER_ALLOWED_FILE_EXTENSIONS = "";
          LUBELOGGER_LOGO_URL = "";
        };
        description = ''
          Additional configuration for LubeLogger, see <https://docs.lubelogger.com/Environment%20Variables> for supported values.
        '';
      };

      environmentFile = lib.mkOption {
        type = lib.types.nullOr lib.types.path;
        default = null;
        example = "/run/secrets/lubelogger";
        description = ''
          Path to a file containing extra LubeLogger config options in the systemd `EnvironmentFile` format.
          Refer to the [documentation] for supported options.

          [documentation]: https://docs.lubelogger.com/Advanced/Environment%20Variables

          This can be used to pass secrets to LubeLogger without putting them in the Nix store.

          For example, to set an SMTP password, point `environmentFile` at a file containing:
          ```
          MailConfig__Password=<pass>
          ```
        '';
      };
    };
  };

  config = lib.mkIf cfg.enable {
    systemd.services.lubelogger = {
      description = "LubeLogger";

      after = [ "network.target" ];
      wantedBy = [ "multi-user.target" ];

      environment = {
        Kestrel__Endpoints__Http__Url = "http://localhost:${toString cfg.port}";
      }
      // cfg.settings;

      serviceConfig = {
        Type = "simple";
        User = cfg.user;
        Group = cfg.group;
        StateDirectory = cfg.dataDir;
        WorkingDirectory = "/var/lib/${cfg.dataDir}";
        ExecStart = lib.getExe cfg.package;
        EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
        Restart = "on-failure";

        CapabilityBoundingSet = [ "" ];
        DeviceAllow = [ "" ];
        PrivateDevices = true;
        PrivateTmp = true;
        ProtectHome = true;
        RestrictAddressFamilies = [
          "AF_UNIX"
          "AF_INET"
          "AF_INET6"
        ];
        RestrictNamespaces = true;
      };
    };

    users.users = lib.mkIf (cfg.user == "lubelogger") {
      lubelogger = {
        isSystemUser = true;
        group = cfg.group;
        home = "/var/lib/${cfg.dataDir}";
      };
    };

    users.groups = lib.mkIf (cfg.group == "lubelogger") { lubelogger = { }; };

    networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; };
  };
}
+8 −8
Original line number Diff line number Diff line
@@ -36,20 +36,20 @@ let

  hash =
    {
      x86_64-linux = "sha256-C+VAuyK2/4unyQm6h0lJJnAMFpGZYC3v8qPaeHkL8gE=";
      x86_64-darwin = "sha256-DpBTTIrKZdItpBgDp3SA9fL9eVvvp/O1FDsVK93nTPw=";
      aarch64-linux = "sha256-o1YyBeQ/ydcd06vxf8sndik4DTqmcgqBSDAuOsMr3WM=";
      aarch64-darwin = "sha256-7XO+Y8T85EeGOUy8traWt+MOFhtCmPQp0benY6ZJCS4=";
      armv7l-linux = "sha256-FAjeY+D4sRpt4/7U+k5c+JZMRMT6vvkYdUTahiQt/mM=";
      x86_64-linux = "sha256-zQ6HHayJy48g/0viZRWm2Ea3Oy50LLkLhSjum68HETk=";
      x86_64-darwin = "sha256-nl4Dn1xiXKZbbKfBHx92h4cxlNTQ7ManVg1LyYvd1xQ=";
      aarch64-linux = "sha256-Yxr2JgpE6nW1B9iCpu8zDHpKHkDr0yy5gQRjNsq73tc=";
      aarch64-darwin = "sha256-iElSgv6jjmKoVZqrZ1ET2EnwyZfiaXkfx9xlSgsUsTc=";
      armv7l-linux = "sha256-M0ZkHHnJB/BtRagJjCi3yfhKz8B4v79IYuiaqdmPrkg=";
    }
    .${system} or throwSystem;

  # Please backport all compatible updates to the stable release.
  # This is important for the extension ecosystem.
  version = "1.106.0";
  version = "1.106.1";

  # This is used for VS Code - Remote SSH test
  rev = "ac4cbdf48759c7d8c3eb91ffe6bb04316e263c57";
  rev = "cb1933bbc38d329b3595673a600fab5c7368f0a7";
in
callPackage ./generic.nix {
  pname = "vscode" + lib.optionalString isInsiders "-insiders";
@@ -82,7 +82,7 @@ callPackage ./generic.nix {
    src = fetchurl {
      name = "vscode-server-${rev}.tar.gz";
      url = "https://update.code.visualstudio.com/commit:${rev}/server-linux-x64/stable";
      hash = "sha256-/ZBBSQTj0gr6H4wRLH9r2Qhukua8qeOq1MVlaScy+IE=";
      hash = "sha256-HYyzA5qfE7CHFqenBjPCe9QhANP0mOgUoORRm/QvxVk=";
    };
    stdenv = stdenvNoCC;
  };
Loading