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

Merge master into staging-nixos

parents e793592a 37bc5d9e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ The Nix expressions to build the Linux kernel are in [`pkgs/os-specific/linux/ke
The function [`pkgs.buildLinux`](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/generic.nix) builds a kernel with [common configuration values](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/common-config.nix).
This is the preferred option unless you have a very specific use case.
Most kernels packaged in Nixpkgs are built that way, and it will also generate kernels suitable for NixOS.
[`pkgs.linuxManualConfig`](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/manual-config.nix) requires a complete configuration to be passed.
[`pkgs.linuxManualConfig`](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/build.nix) requires a complete configuration to be passed.
It has fewer additional features than `pkgs.buildLinux`, which provides common configuration values and exposes the `features` attribute, as explained below.

Both functions have an argument `kernelPatches` which should be a list of `{name, patch, extraConfig}` attribute sets, where `name` is the name of the patch (which is included in the kernel’s `meta.description` attribute), `patch` is the patch itself (possibly compressed), and `extraConfig` (optional) is a string specifying extra options to be concatenated to the kernel configuration file (`.config`).
@@ -75,7 +75,7 @@ pkgs.linuxPackages_custom {

:::

Additional attributes can be used with `linuxManualConfig` for further customisation instead of `linuxPackages_custom`. You're encouraged to read [the `pkgs.linuxManualConfig` source code](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/manual-config.nix) to understand how to use them.
Additional attributes can be used with `linuxManualConfig` for further customisation instead of `linuxPackages_custom`. You're encouraged to read [the `pkgs.linuxManualConfig` source code](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/build.nix) to understand how to use them.

To edit the `.config` file for Linux X.Y from within Nix, proceed as follows:

+5 −0
Original line number Diff line number Diff line
@@ -399,3 +399,8 @@
### Additions and Improvements {#sec-nixpkgs-release-25.11-lib-additions-improvements}

- `lib.cli.toCommandLine`, `lib.cli.toCommandLineShell`, `lib.cli.toCommandLineGNU` and `lib.cli.toCommandLineShellGNU` have been added to address multiple issues in `lib.cli.toGNUCommandLine` and `lib.cli.toGNUCommandLineShell`.

- `ugrep`: Added `wrapWithFilterUtils` package flag for optionally wrapping `ugrep+` and `ug+` with filter utilities for grepping other file types.

- `ugrep`: Added `createGrepReplacementLinks` package flag for optionally creating drop-in replacement symlinks for `gnugrep`.
+6 −0
Original line number Diff line number Diff line
@@ -9033,6 +9033,12 @@
    githubId = 1313787;
    name = "Gabriella Gonzalez";
  };
  GabrielMaguire = {
    email = "gabrielmaguire@proton.me";
    github = "GabrielMaguire";
    githubId = 39974571;
    name = "Gabriel Maguire";
  };
  gabyx = {
    email = "gnuetzi@gmail.com";
    github = "gabyx";
+0 −2
Original line number Diff line number Diff line
@@ -34,13 +34,11 @@ in

        systemd = {
          packages = with pkgs.coolercontrol; [
            coolercontrol-liqctld
            coolercontrold
          ];

          # https://github.com/NixOS/nixpkgs/issues/81138
          services = {
            coolercontrol-liqctld.wantedBy = [ "multi-user.target" ];
            coolercontrold.wantedBy = [ "multi-user.target" ];
          };
        };
+61 −35
Original line number Diff line number Diff line
@@ -6,10 +6,17 @@
}:
let
  cfg = config.services.n8n;
  format = pkgs.formats.json { };
  configFile = format.generate "n8n.json" cfg.settings;
in
{
  imports = [
    (lib.mkRemovedOptionModule [ "services" "n8n" "settings" ] "Use services.n8n.environment instead.")
    (lib.mkRemovedOptionModule [
      "services"
      "n8n"
      "webhookUrl"
    ] "Use services.n8n.environment.WEBHOOK_URL instead.")
  ];

  options.services.n8n = {
    enable = lib.mkEnableOption "n8n server";

@@ -19,47 +26,66 @@ in
      description = "Open ports in the firewall for the n8n web interface.";
    };

    settings = lib.mkOption {
      type = format.type;
      default = { };
    environment = lib.mkOption {
      description = ''
        Environment variables to pass to the n8n service.
        See <https://docs.n8n.io/hosting/configuration/environment-variables/> for available options.
      '';
      type = lib.types.submodule {
        freeformType = with lib.types; attrsOf str;
        options = {
          GENERIC_TIMEZONE = lib.mkOption {
            type = with lib.types; nullOr str;
            default = config.time.timeZone;
            defaultText = lib.literalExpression "config.time.timeZone";
            description = ''
        Configuration for n8n, see <https://docs.n8n.io/hosting/environment-variables/configuration-methods/>
        for supported values.
              The n8n instance timezone. Important for schedule nodes (such as Cron).
            '';
          };

    webhookUrl = lib.mkOption {
      type = lib.types.str;
      default = "";
          N8N_PORT = lib.mkOption {
            type = with lib.types; coercedTo port toString str;
            default = 5678;
            description = "The HTTP port n8n runs on.";
          };
          N8N_USER_FOLDER = lib.mkOption {
            type = lib.types.path;
            # This folder must be writeable as the application is storing
            # its data in it, so the StateDirectory is a good choice
            default = "/var/lib/n8n";
            description = ''
        WEBHOOK_URL for n8n, in case we're running behind a reverse proxy.
        This cannot be set through configuration and must reside in an environment variable.
              Provide the path where n8n will create the .n8n folder.
              This directory stores user-specific data, such as database file and encryption key.
            '';
            readOnly = true;
          };

          N8N_DIAGNOSTICS_ENABLED = lib.mkOption {
            type = with lib.types; coercedTo bool toString str;
            default = false;
            description = ''
              Whether to share selected, anonymous telemetry with n8n.
              Note that if you set this to false, you can't enable Ask AI in the Code node.
            '';
          };
          N8N_VERSION_NOTIFICATIONS_ENABLED = lib.mkOption {
            type = with lib.types; coercedTo bool toString str;
            default = false;
            description = ''
              When enabled, n8n sends notifications of new versions and security updates.
            '';
          };
        };
      };
      default = { };
    };

  config = lib.mkIf cfg.enable {
    services.n8n.settings = {
      # We use this to open the firewall, so we need to know about the default at eval time
      port = lib.mkDefault 5678;
  };

  config = lib.mkIf cfg.enable {
    systemd.services.n8n = {
      description = "N8N service";
      description = "n8n service";
      after = [ "network.target" ];
      wantedBy = [ "multi-user.target" ];
      environment = {
        # This folder must be writeable as the application is storing
        # its data in it, so the StateDirectory is a good choice
        N8N_USER_FOLDER = "/var/lib/n8n";
        HOME = "/var/lib/n8n";
        N8N_CONFIG_FILES = "${configFile}";
        WEBHOOK_URL = "${cfg.webhookUrl}";

        # Don't phone home
        N8N_DIAGNOSTICS_ENABLED = "false";
        N8N_VERSION_NOTIFICATIONS_ENABLED = "false";
      environment = cfg.environment // {
        HOME = config.services.n8n.environment.N8N_USER_FOLDER;
      };
      serviceConfig = {
        Type = "simple";
@@ -88,7 +114,7 @@ in
    };

    networking.firewall = lib.mkIf cfg.openFirewall {
      allowedTCPPorts = [ cfg.settings.port ];
      allowedTCPPorts = [ (lib.toInt cfg.environment.N8N_PORT) ];
    };
  };
}
Loading