1
0
Fork 0
nixos-config/home-manager/roles/kassandra.nix
2023-02-11 16:57:14 +01:00

26 lines
1 KiB
Nix

{pkgs, ...}: let
dhallFiles = pkgs.runCommand "kassandra-config-src" {} ''
mkdir $out
${pkgs.kassandra-standalone}/bin/kassandra2 print-types > $out/types.dhall
ln -s ${./kassandra}/{config,backend}.dhall $out
ln -s ${pkgs.privateFile "kassandra-uiConfig.dhall"} $out/uiConfig.dhall
'';
backend = pkgs.dhallPackages.buildDhallPackage {
name = "kassandra-backend-config";
code = "${dhallFiles}/backend.dhall : (${dhallFiles}/types.dhall).BackendConfig";
source = true;
dependencies = [pkgs.dhallPackages.Prelude];
};
standalone = pkgs.dhallPackages.buildDhallPackage {
name = "kassandra-standalone-config";
code = "${dhallFiles}/config.dhall : (${dhallFiles}/types.dhall).StandaloneConfig";
source = true;
dependencies = [pkgs.dhallPackages.Prelude];
};
dhallResult = pkgs.recursiveLinkFarm "kassandra-config" {
"backend.dhall" = "${backend}/source.dhall";
"config.dhall" = "${standalone}/source.dhall";
};
in {
xdg.configFile.kassandra.source = dhallResult.out;
}