From 5d75012b621292c8215f70f68b1640c5f07eb790 Mon Sep 17 00:00:00 2001 From: frantathefranta Date: Fri, 1 Aug 2025 09:44:03 -0400 Subject: [PATCH 1/3] maintainers: add frantathefranta --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 16dabe152051..cfd9a20f9bb1 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -8621,6 +8621,12 @@ githubId = 10290864; name = "Peter Frank"; }; + frantathefranta = { + github = "frantathefranta"; + githubId = 64412753; + name = "Franta Bartik"; + email = "fb@franta.us"; + }; franzmondlichtmann = { name = "Franz Schroepf"; email = "franz-schroepf@t-online.de"; From 725442d69ca3d0f7c902626665fca83c01602ce3 Mon Sep 17 00:00:00 2001 From: frantathefranta Date: Fri, 1 Aug 2025 09:52:39 -0400 Subject: [PATCH 2/3] conman: init at 0.3.1 Adding this package along with a service. https://github.com/dun/conman/releases/tag/conman-0.3.1 Changes to conman package as per review Enabled parallel building for the conman package --- pkgs/by-name/co/conman/package.nix | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pkgs/by-name/co/conman/package.nix diff --git a/pkgs/by-name/co/conman/package.nix b/pkgs/by-name/co/conman/package.nix new file mode 100644 index 000000000000..2826c65f7276 --- /dev/null +++ b/pkgs/by-name/co/conman/package.nix @@ -0,0 +1,45 @@ +{ + lib, + freeipmi, + autoreconfHook, + pkg-config, + fetchFromGitHub, + tcp_wrappers, + stdenv, + expect, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "conman"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "dun"; + repo = "conman"; + tag = "conman-${finalAttrs.version}"; + hash = "sha256-CHWvHYTmTiEpEfHm3TF5aCKBOW2GsT9Vv4ehpj775NQ="; + }; + + enableParallelBuilding = true; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + + buildInputs = [ + freeipmi # For libipmiconsole.so.2 + tcp_wrappers # For libwrap.so.0 + expect # For conman/*.exp scripts + ]; + + meta = { + description = "The Console Manager"; + homepage = "https://github.com/dun/conman"; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + frantathefranta + ]; + }; + +}) From 8b9723146053ce5b4b067567f679e08098cb1512 Mon Sep 17 00:00:00 2001 From: frantathefranta Date: Fri, 1 Aug 2025 10:05:15 -0400 Subject: [PATCH 3/3] nixos/conman: init module Adding a service for the conman package Changes to conman service as per review --- .../manual/release-notes/rl-2511.section.md | 2 + nixos/modules/module-list.nix | 1 + nixos/modules/services/misc/conman.nix | 89 +++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 nixos/modules/services/misc/conman.nix diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index eefc6d7f4cdd..3fca1a27143e 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -84,6 +84,8 @@ - [paisa](https://github.com/ananthakumaran/paisa), a personal finance tracker and dashboard. Available as [services.paisa](#opt-services.paisa.enable). +- [conman](https://github.com/dun/conman), a serial console management program. Available as [services.conman](#opt-services.conman.enable). + ## Backward Incompatibilities {#sec-release-25.11-incompatibilities} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 92899fd6115f..67be52fea567 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -806,6 +806,7 @@ ./services/misc/clipcat.nix ./services/misc/clipmenu.nix ./services/misc/confd.nix + ./services/misc/conman.nix ./services/misc/cpuminer-cryptonight.nix ./services/misc/db-rest.nix ./services/misc/devmon.nix diff --git a/nixos/modules/services/misc/conman.nix b/nixos/modules/services/misc/conman.nix new file mode 100644 index 000000000000..8d00b0353d6d --- /dev/null +++ b/nixos/modules/services/misc/conman.nix @@ -0,0 +1,89 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + options = { + services.conman = { + enable = lib.mkEnableOption '' + Enable the conman Console manager. + + Either `configFile` or `config` must be specified. + ''; + package = lib.mkPackageOption pkgs "conman" { }; + + configFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + example = "/run/secrets/conman.conf"; + description = '' + The absolute path to the configuration file. + + Either `configFile` or `config` must be specified. + + See . + ''; + }; + config = lib.mkOption { + type = lib.types.nullOr lib.types.lines; + default = null; + example = '' + server coredump=off + server keepalive=on + server loopback=off + server timestamp=1h + + # global config + global log="/var/log/conman/%N.log" + global seropts="9600,8n1" + global ipmiopts="U:,P:" + ''; + description = '' + The configuration object. + + Either `configFile` or `config` must be specified. + + See . + ''; + }; + }; + }; + meta.maintainers = with lib.maintainers; [ + frantathefranta + ]; + + config = + let + cfg = config.services.conman; + configFile = + if cfg.configFile != null then + cfg.configFile + else + pkgs.writeTextFile { + name = "conman.conf"; + text = cfg.config; + }; + in + lib.mkIf cfg.enable { + assertions = [ + { + assertion = + (cfg.configFile != null) && (cfg.config == null) || (cfg.configFile == null && cfg.config != null); + message = "Either but not both `configFile` and `config` must be specified for conman."; + } + ]; + environment.systemPackages = [ cfg.package ]; + systemd.services.conmand = { + description = "serial console management program"; + documentation = [ "man:conman(8)" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${cfg.package}/bin/conmand -F -c ${configFile}"; + KillMode = "process"; + }; + }; + }; +}