Skip to content

Commit

Permalink
module: txt-file generation format added
Browse files Browse the repository at this point in the history
  • Loading branch information
arminius-smh authored and Misterio77 committed Dec 26, 2024
1 parent 2bc6a3c commit 8454a44
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/minecraft-servers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ let
then formatExtensions.${head extension} or error
else error;

txtList =
{ }:
{
type = with lib.types; listOf str;
generate = name: value: pkgs.writeText name (lib.concatStringsSep "\n" value);
};

formatExtensions = with pkgs.formats; {
"yml" = yaml { };
"yaml" = yaml { };
Expand All @@ -50,6 +57,7 @@ let
"properties" = keyValue { };
"toml" = toml { };
"ini" = ini { };
"txt" = txtList { };
};

configType = types.submodule {
Expand Down

0 comments on commit 8454a44

Please sign in to comment.