about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2024-01-30 00:02:29 +0000
committerGitHub <noreply@github.com>2024-01-30 00:02:29 +0000
commit93a73aa6cf02f5e758725dad478d4962abc63e20 (patch)
tree68846c15089ce36743da063949a49cc12de869df /nixos
parentfa5053a02d6810a037fc4e3c7fa8c32b9325ea5f (diff)
parent05449682e26947e9c81aaa4c13d43e3bfce148b1 (diff)
downloadnixlib-93a73aa6cf02f5e758725dad478d4962abc63e20.tar
nixlib-93a73aa6cf02f5e758725dad478d4962abc63e20.tar.gz
nixlib-93a73aa6cf02f5e758725dad478d4962abc63e20.tar.bz2
nixlib-93a73aa6cf02f5e758725dad478d4962abc63e20.tar.lz
nixlib-93a73aa6cf02f5e758725dad478d4962abc63e20.tar.xz
nixlib-93a73aa6cf02f5e758725dad478d4962abc63e20.tar.zst
nixlib-93a73aa6cf02f5e758725dad478d4962abc63e20.zip
Merge staging-next into staging
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/programs/nautilus-open-any-terminal.nix36
-rw-r--r--nixos/modules/services/mail/dovecot.nix8
-rw-r--r--nixos/modules/services/misc/moonraker.nix23
-rw-r--r--nixos/modules/services/networking/kresd.nix2
4 files changed, 53 insertions, 16 deletions
diff --git a/nixos/modules/programs/nautilus-open-any-terminal.nix b/nixos/modules/programs/nautilus-open-any-terminal.nix
new file mode 100644
index 000000000000..d205fb3ec916
--- /dev/null
+++ b/nixos/modules/programs/nautilus-open-any-terminal.nix
@@ -0,0 +1,36 @@
+{ config, lib, pkgs, ... }:
+
+let
+  cfg = config.programs.nautilus-open-any-terminal;
+in
+{
+  options.programs.nautilus-open-any-terminal = {
+    enable = lib.mkEnableOption (lib.mdDoc "nautilus-open-any-terminal");
+
+    terminal = lib.mkOption {
+      type = with lib.types; nullOr str;
+      default = null;
+      description = lib.mdDoc ''
+        The terminal emulator to add to context-entry of nautilus. Supported terminal
+        emulators are listed in https://github.com/Stunkymonkey/nautilus-open-any-terminal#supported-terminal-emulators.
+      '';
+    };
+  };
+
+  config = lib.mkIf cfg.enable {
+    environment.systemPackages = with pkgs; [
+      gnome.nautilus-python
+      nautilus-open-any-terminal
+    ];
+    programs.dconf = lib.optionalAttrs (cfg.terminal != null) {
+      enable = true;
+      profiles.user.databases = [{
+        settings."com/github/stunkymonkey/nautilus-open-any-terminal".terminal = cfg.terminal;
+        lockAll = true;
+      }];
+    };
+  };
+  meta = {
+    maintainers = with lib.maintainers; [ stunkymonkey linsui ];
+  };
+}
diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix
index 8d298de6945b..71baa2bb1852 100644
--- a/nixos/modules/services/mail/dovecot.nix
+++ b/nixos/modules/services/mail/dovecot.nix
@@ -1,8 +1,8 @@
-{ options, config, lib, pkgs, ... }:
+{ config, lib, pkgs, ... }:
 
 let
-  inherit (lib) any attrValues concatMapStringsSep concatStrings
-    concatStringsSep flatten imap1 isList literalExpression mapAttrsToList
+  inherit (lib) attrValues concatMapStringsSep concatStrings
+    concatStringsSep flatten imap1 literalExpression mapAttrsToList
     mkEnableOption mkIf mkOption mkRemovedOptionModule optional optionalAttrs
     optionalString singleton types mkRenamedOptionModule nameValuePair
     mapAttrs' listToAttrs filter;
@@ -14,7 +14,7 @@ let
   baseDir = "/run/dovecot2";
   stateDir = "/var/lib/dovecot";
 
-  sieveScriptSettings = mapAttrs' (to: from: nameValuePair "sieve_${to}" "${stateDir}/sieve/${from}") cfg.sieve.scripts;
+  sieveScriptSettings = mapAttrs' (to: _: nameValuePair "sieve_${to}" "${stateDir}/sieve/${to}") cfg.sieve.scripts;
   imapSieveMailboxSettings = listToAttrs (flatten (imap1 (idx: el:
     singleton {
       name = "imapsieve_mailbox${toString idx}_name";
diff --git a/nixos/modules/services/misc/moonraker.nix b/nixos/modules/services/misc/moonraker.nix
index 4e419aafa990..f043cc83bf05 100644
--- a/nixos/modules/services/misc/moonraker.nix
+++ b/nixos/modules/services/misc/moonraker.nix
@@ -103,17 +103,18 @@ in {
 
   config = mkIf cfg.enable {
     warnings = []
-      ++ optional (cfg.settings.update_manager.enable_system_updates or false)
-        ''Enabling update_manager is not supported on NixOS and will lead to non-removable warnings in some clients.''
-      ++ optional (cfg.configDir != null)
-        ''
-          services.moonraker.configDir has been deprecated upstream and will be removed.
-
-          Action: ${
-            if cfg.configDir == unifiedConfigDir then "Simply remove services.moonraker.configDir from your config."
-            else "Move files from `${cfg.configDir}` to `${unifiedConfigDir}` then remove services.moonraker.configDir from your config."
-          }
-        '';
+      ++ (optional (head (cfg.settings.update_manager.enable_system_updates or [false])) ''
+        Enabling system updates is not supported on NixOS and will lead to non-removable warnings in some clients.
+      '')
+      ++ (optional (cfg.configDir != null) ''
+        services.moonraker.configDir has been deprecated upstream and will be removed.
+
+        Action: ${
+          if cfg.configDir == unifiedConfigDir
+          then "Simply remove services.moonraker.configDir from your config."
+          else "Move files from `${cfg.configDir}` to `${unifiedConfigDir}` then remove services.moonraker.configDir from your config."
+        }
+        '');
 
     assertions = [
       {
diff --git a/nixos/modules/services/networking/kresd.nix b/nixos/modules/services/networking/kresd.nix
index 0c7363e564dc..307414abf170 100644
--- a/nixos/modules/services/networking/kresd.nix
+++ b/nixos/modules/services/networking/kresd.nix
@@ -11,7 +11,7 @@ let
   mkListen = kind: addr: let
     al_v4 = builtins.match "([0-9.]+):([0-9]+)($)" addr;
     al_v6 = builtins.match "\\[(.+)]:([0-9]+)(%.*|$)" addr;
-    al_portOnly = builtins.match "([0-9]+)" addr;
+    al_portOnly = builtins.match "(^)([0-9]+)" addr;
     al = findFirst (a: a != null)
       (throw "services.kresd.*: incorrect address specification '${addr}'")
       [ al_v4 al_v6 al_portOnly ];