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

Merge master into staging-nixos

parents 7d8f4ede 1f05c8b0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -20715,6 +20715,12 @@
    github = "philipwilk";
    githubId = 50517631;
  };
  philocalyst = {
    name = "Myles Wirth";
    email = "milestheperson@posteo.net";
    github = "philocalyst";
    githubId = 114884788;
  };
  philtaken = {
    email = "philipp.herzog@protonmail.com";
    github = "philtaken";
+19 −0
Original line number Diff line number Diff line
{ lib, config, ... }:

let
  cfg = config.hardware.hid-fanatecff;
  inherit (config.boot.kernelPackages) hid-fanatecff;
  inherit (lib) maintainers mkEnableOption mkIf;
in
{
  options.hardware.hid-fanatecff = {
    enable = mkEnableOption "hid-fanatecff, a Linux kernel driver that aims to add support for Fanatec devices";
  };

  config = mkIf cfg.enable {
    boot.extraModulePackages = [ hid-fanatecff ];
    services.udev.packages = [ hid-fanatecff ];
  };

  meta.maintainers = with maintainers; [ rake5k ];
}
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@
  ./hardware/gpgsmartcards.nix
  ./hardware/graphics.nix
  ./hardware/hackrf.nix
  ./hardware/hid-fanatecff.nix
  ./hardware/i2c.nix
  ./hardware/infiniband.nix
  ./hardware/inputmodule.nix
+28 −3
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ let
    // {
      description = "value coercible to CLI argument";
    };
  format = pkgs.formats.yaml { };
  blueprint-file = format.generate "blueprint.yml" cfg.blueprint;
in
{
  imports = [
@@ -48,13 +50,35 @@ in
        };
        description = "Settings for Newt module, see [Newt CLI docs](https://github.com/fosrl/newt?tab=readme-ov-file#cli-args) for more information.";
      };
      blueprint = lib.mkOption {
        inherit (format) type;
        default = { };
        example = {
          proxy-resources = {
            jellyfin = {
              name = "Jellyfin";
              protocol = "http";
              full-domain = "jfn.example.com";
              targets = [
                {
                  hostname = "localhost";
                  method = "http";
                  port = 8096;
                }
              ];
              auth.sso-enabled = true;
            };
          };
        };
        description = "Blueprint for declarative settings, see [Newt Blueprint docs](https://docs.pangolin.net/manage/blueprints#blueprints) for more information.";
      };

      # provide path to file to keep secrets out of the nix store
      environmentFile = lib.mkOption {
        type = with lib.types; nullOr path;
        default = null;
        description = ''
          Path to a file containing sensitive environment variables for Newt. See <https://docs.fossorial.io/Newt/overview#cli-args>
          Path to a file containing sensitive environment variables for Newt. See [Client credentials](https://docs.pangolin.net/manage/clients/credentials) for more information.
          These will overwrite anything defined in the config.
          The file should contain environment-variable assignments like:
          NEWT_ID=2ix2t8xk22ubpfy
@@ -81,9 +105,10 @@ in
      environment = {
        HOME = "/var/lib/private/newt";
      };
      # the flag values will all be overwritten if also defined in the env file
      serviceConfig = {
        ExecStart = "${lib.getExe cfg.package} ${lib.cli.toCommandLineShellGNU { } cfg.settings}";
        ExecStart = "${lib.getExe cfg.package} ${
          lib.cli.toCommandLineShellGNU { } (lib.recursiveUpdate cfg.settings { inherit blueprint-file; })
        }";
        DynamicUser = true;
        StateDirectory = "newt";
        StateDirectoryMode = "0700";
+70 −2
Original line number Diff line number Diff line
@@ -16,13 +16,20 @@ let

  configFile = pkgs.writeText "chrony.conf" ''
    ${lib.concatMapStringsSep "\n" (
      server: "server " + server + " " + cfg.serverOption + lib.optionalString (cfg.enableNTS) " nts"
      server:
      (if lib.strings.hasInfix "pool" server then "pool " else "server ")
      + server
      + " "
      + cfg.serverOption
      + lib.optionalString (cfg.enableNTS) " nts"
    ) cfg.servers}

    ${lib.optionalString (
      cfg.initstepslew.enabled && (cfg.servers != [ ])
    ) "initstepslew ${toString cfg.initstepslew.threshold} ${lib.concatStringsSep " " cfg.servers}"}

    ${lib.optionalString cfg.makestep.enable "makestep ${toString cfg.makestep.threshold} ${toString cfg.makestep.limit}"}

    driftfile ${driftFile}
    keyfile ${keyFile}
    ${lib.optionalString (cfg.enableRTCTrimming) "rtcfile ${rtcFile}"}
@@ -43,6 +50,20 @@ let
  ]
  ++ lib.optional cfg.enableMemoryLocking "-m"
  ++ cfg.extraFlags;

  dispathcerScriptFile = pkgs.callPackage (
    {
      runCommand,
      srcOnly,
    }:
    runCommand "10-chrony-onoffline" { } ''
      cp ${srcOnly chronyPkg}/examples/chrony.nm-dispatcher.onoffline $out
      substituteInPlace $out \
        --replace-fail '/usr/bin/chronyc' '${chronyPkg}/bin/chronyc'
      chmod +x $out
      patchShebangs $out
    ''
  ) { };
in
{
  options = {
@@ -134,8 +155,9 @@ in
      initstepslew = {
        enabled = lib.mkOption {
          type = lib.types.bool;
          default = true;
          default = false;
          description = ''
            DEPRECATED. Consider using `services.chrony.makestep` instead.
            Allow chronyd to make a rapid measurement of the system clock error
            at boot time, and to correct the system clock by stepping before
            normal operation begins.
@@ -153,12 +175,51 @@ in
        };
      };

      makestep = {
        enable = lib.mkOption {
          type = lib.types.bool;
          default = true;
          description = ''
            Allow chronyd to step the system clock if the error is larger than
            the specified threshold.
          '';
        };

        threshold = lib.mkOption {
          type = lib.types.either lib.types.float lib.types.int;
          default = 0.1;
          description = ''
            The threshold of system clock error (in seconds) above which the
            clock will be stepped. If the correction required is less than the
            threshold, a slew is used instead.
          '';
        };

        limit = lib.mkOption {
          type = lib.types.ints.positive;
          default = 3;
          description = ''
            The maximum number of times the system clock will be stepped.
          '';
        };
      };

      directory = lib.mkOption {
        type = lib.types.str;
        default = "/var/lib/chrony";
        description = "Directory where chrony state is stored.";
      };

      dispatcherScript = lib.mkOption {
        type = lib.types.bool;
        default = config.networking.networkmanager.enable;
        defaultText = lib.literalExpression "config.networking.networkmanager.enable";
        description = ''
          Whether to install the chrony NetworkManager dispatcher script
          to handle connectivity changes.
        '';
      };

      extraConfig = lib.mkOption {
        type = lib.types.lines;
        default = "";
@@ -194,6 +255,13 @@ in
      home = stateDir;
    };

    networking.networkmanager.dispatcherScripts = lib.mkIf cfg.dispatcherScript [
      {
        type = "basic";
        source = dispathcerScriptFile;
      }
    ];

    services.timesyncd.enable = lib.mkForce false;

    # If chrony controls and tracks the RTC, writing it externally causes clock error.
Loading