From 0433cdc76fecdeb0885a4a5f04b4c0c032471b60 Mon Sep 17 00:00:00 2001 From: Wittano Bonarotti Date: Wed, 21 Aug 2024 21:27:59 +0200 Subject: [PATCH] fix(nixos): updated configuration --- nixos.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos.nix b/nixos.nix index d751f70..8c1eb81 100644 --- a/nixos.nix +++ b/nixos.nix @@ -15,7 +15,8 @@ in description = "komputer package"; }; guildID = mkOption { - type = types.str; + type = types nullOr types.str; + default = null; description = "Discord server id, that you deploy bot"; }; applicationID = mkOption { @@ -43,16 +44,12 @@ in assertion = cfg.token != ""; message = "Option komputer.token is empty"; } - { - assertion = cfg.guildID != ""; - message = "Option komputer.guildID is empty"; - } { assertion = cfg.applicationID != ""; message = "Option komputer.applicationID is empty"; } { - assertion = cfg.mongodb != ""; + assertion = cfg.mongodbURI != ""; message = "Option komputer.mongodbURI is empty"; } ]; @@ -60,12 +57,12 @@ in systemd.services.komputer = { description = "Komputer - Discord bot behave as like 'komputer'. One of character in Star Track parody series created by Dem3000"; wantedBy = [ "multi-user.target" ]; + path = cfg.package.propagatedBuildInputs or []; environment = { DISCORD_BOT_TOKEN = cfg.token; APPLICATION_ID = cfg.applicationID; - SERVER_GUID = cfg.guildID; MONGODB_URI = cfg.mongodbURI; - }; + } // attrsets.optionAtts (cfg.guildID != null) { SERVER_GUID = cfg.guildID; }; script = "${cfg.package}/bin/komputer"; }; };