1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

tests/discord: make the basic configuration test cross platform

This commit is contained in:
prescientmoon 2025-11-06 17:55:02 +01:00
parent ce7cd8bbd0
commit cfc66b91ae
No known key found for this signature in database
2 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,4 @@
{ pkgs, ... }:
{
config = {
programs.discord = {
@ -5,11 +6,18 @@
enableDevtools = true;
};
nmt.script = ''
configDir=home-files/.config/discord
assertFileExists $configDir/settings.json
assertFileContent $configDir/settings.json \
${./basic-settings.json}
'';
nmt.script =
let
configDir =
if pkgs.stdenv.hostPlatform.isLinux then
"home-files/.config/discord"
else
"home-files/Library/Application Support/discord";
in
''
assertFileExists "${configDir}/settings.json"
assertFileContent "${configDir}/settings.json" \
${./basic-settings.json}
'';
};
}

View file

@ -1,4 +1,3 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
{
discord-basic-configuration = ./basic-configuration.nix;
}