Merge remote-tracking branch 'tv/master'

This commit is contained in:
makefu 2021-12-29 00:20:28 +01:00
commit 7766b006a8
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 12 additions and 31 deletions

View File

@ -1,24 +1,8 @@
{ config, lib, 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,25 +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";
};
};
});
}

View File

@ -2,12 +2,12 @@
stdenv.mkDerivation rec {
pname = "ircaids";
version = "1.0.1";
version = "1.2.0";
src = pkgs.fetchgit {
url = "https://cgit.krebsco.de/ircaids";
rev = "refs/tags/${version}";
sha256 = "0wp01pag58c72rmx8j3i1vlq60na8lc91743832f0h27cik8yqvh";
sha256 = "049ln54llfrn99q0pzwlb7iaz4igd4f3n4rb6mpc9irsy32bv3qg";
};
buildPhase = null;