mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-08 08:21:16 -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}
|
${lib.optionalString cfg.systemd.enable systemdActivation}
|
||||||
${cfg.autostart_sh}
|
${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 {
|
in {
|
||||||
options = {
|
options = {
|
||||||
wayland.windowManager.mango = with lib; {
|
wayland.windowManager.mango = with lib; {
|
||||||
|
|
@ -99,7 +106,7 @@ in {
|
||||||
home.packages = [cfg.package];
|
home.packages = [cfg.package];
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"mango/config.conf" = lib.mkIf (cfg.settings != "") {
|
"mango/config.conf" = lib.mkIf (cfg.settings != "") {
|
||||||
text = cfg.settings;
|
source = validatedConfig;
|
||||||
};
|
};
|
||||||
"mango/autostart.sh" = lib.mkIf (cfg.autostart_sh != "") {
|
"mango/autostart.sh" = lib.mkIf (cfg.autostart_sh != "") {
|
||||||
source = autostart_sh;
|
source = autostart_sh;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue