mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-23 05:35:53 -04:00
validate config in home-manager
This commit is contained in:
parent
8484093e32
commit
b033898761
1 changed files with 8 additions and 1 deletions
|
|
@ -12,6 +12,13 @@ self: {
|
|||
${lib.optionalString cfg.systemd.enable systemdActivation}
|
||||
${cfg.autostart_sh}
|
||||
'';
|
||||
validatedConfig = pkgs.runCommand "mango-config.conf" { } ''
|
||||
cat > "$out" <<'EOF'
|
||||
${cfg.settings}
|
||||
EOF
|
||||
|
||||
${cfg.package}/bin/mango -c "$out" -p || exit 1
|
||||
'';
|
||||
in {
|
||||
options = {
|
||||
wayland.windowManager.mango = with lib; {
|
||||
|
|
@ -99,7 +106,7 @@ in {
|
|||
home.packages = [cfg.package];
|
||||
xdg.configFile = {
|
||||
"mango/config.conf" = lib.mkIf (cfg.settings != "") {
|
||||
text = cfg.settings;
|
||||
source = validatedConfig;
|
||||
};
|
||||
"mango/autostart.sh" = lib.mkIf (cfg.autostart_sh != "") {
|
||||
source = autostart_sh;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue