From e9cd6d91dc2c84c63f8564bbb048bc3c91ca6885 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Dec 2021 22:33:36 +0100 Subject: [PATCH 1/4] ergo: always merge default config --- krebs/3modules/ergo.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/ergo.nix b/krebs/3modules/ergo.nix index df9757db0..74e621fcb 100644 --- a/krebs/3modules/ergo.nix +++ b/krebs/3modules/ergo.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: let inherit (lib) mkEnableOption mkIf mkOption types; @@ -84,6 +84,9 @@ in config = mkIf cfg.enable ({ + krebs.ergo.config = + lib.mapAttrsRecursive (_: lib.mkDefault) options.krebs.ergo.config.default; + systemd.services.ergo = { description = "Ergo IRC daemon"; wantedBy = [ "multi-user.target" ]; From a59ed5197fc04424690ec3a3b58b5071d17a1be6 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Dec 2021 22:57:10 +0100 Subject: [PATCH 2/4] ircaids: 1.0.1 -> 1.1.0 --- krebs/5pkgs/simple/ircaids/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/ircaids/default.nix b/krebs/5pkgs/simple/ircaids/default.nix index a070cf948..d16622c2d 100644 --- a/krebs/5pkgs/simple/ircaids/default.nix +++ b/krebs/5pkgs/simple/ircaids/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "ircaids"; - version = "1.0.1"; + version = "1.1.0"; src = pkgs.fetchgit { url = "https://cgit.krebsco.de/ircaids"; rev = "refs/tags/${version}"; - sha256 = "0wp01pag58c72rmx8j3i1vlq60na8lc91743832f0h27cik8yqvh"; + sha256 = "05zd5dhsif00q8s1g5vzjd6x9n0c806nhfbdcgjdfgfy1j3kygyq"; }; buildPhase = null; From 69d266b76b88c7d6b416cc4aac24ca3f78aeaa7e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Dec 2021 23:53:27 +0100 Subject: [PATCH 3/4] ergo: kill dead code and stuff --- krebs/3modules/ergo.nix | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/krebs/3modules/ergo.nix b/krebs/3modules/ergo.nix index 74e621fcb..0ce0345d8 100644 --- a/krebs/3modules/ergo.nix +++ b/krebs/3modules/ergo.nix @@ -1,24 +1,8 @@ -{ config, lib, options, pkgs, ... }: - -let - inherit (lib) mkEnableOption mkIf mkOption types; - inherit (pkgs) coreutils ergo; - cfg = config.krebs.ergo; - - configFile = pkgs.writeText "ergo.conf" (builtins.toJSON cfg.config); -in - -{ - - ###### interface - +{ config, lib, options, pkgs, ... }: { options = { - krebs.ergo = { - - enable = mkEnableOption "Ergo IRC daemon"; - - config = mkOption { + enable = lib.mkEnableOption "Ergo IRC daemon"; + config = lib.mkOption { type = (pkgs.formats.json {}).type; description = '' Ergo IRC daemon configuration file. @@ -74,28 +58,22 @@ in }; }; }; - }; - }; - - - ###### implementation - - config = mkIf cfg.enable ({ - + config = let + cfg = config.krebs.ergo; + configFile = pkgs.writeJSON "ergo.conf" cfg.config; + in lib.mkIf cfg.enable ({ krebs.ergo.config = lib.mapAttrsRecursive (_: lib.mkDefault) options.krebs.ergo.config.default; - systemd.services.ergo = { description = "Ergo IRC daemon"; wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = "${ergo}/bin/ergo run --conf ${configFile}"; + ExecStart = "${pkgs.ergo}/bin/ergo run --conf ${configFile}"; DynamicUser = true; StateDirectory = "ergo"; }; }; - }); } From 687948cfe5154e03f93886dd27dc30c7910ba754 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 29 Dec 2021 00:12:22 +0100 Subject: [PATCH 4/4] ircaids: 1.1.0 -> 1.2.0 --- krebs/5pkgs/simple/ircaids/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/ircaids/default.nix b/krebs/5pkgs/simple/ircaids/default.nix index d16622c2d..cffd4aa76 100644 --- a/krebs/5pkgs/simple/ircaids/default.nix +++ b/krebs/5pkgs/simple/ircaids/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "ircaids"; - version = "1.1.0"; + version = "1.2.0"; src = pkgs.fetchgit { url = "https://cgit.krebsco.de/ircaids"; rev = "refs/tags/${version}"; - sha256 = "05zd5dhsif00q8s1g5vzjd6x9n0c806nhfbdcgjdfgfy1j3kygyq"; + sha256 = "049ln54llfrn99q0pzwlb7iaz4igd4f3n4rb6mpc9irsy32bv3qg"; }; buildPhase = null;