mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-28 05:40:19 -04:00
Merge pull request #294 from JumpIn-Git/main
improve home-manager module
This commit is contained in:
commit
1f7a8a3ced
1 changed files with 9 additions and 20 deletions
|
|
@ -96,27 +96,16 @@ in {
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
home.activation =
|
||||
lib.optionalAttrs (cfg.autostart_sh != "") {
|
||||
createMangoScript = lib.hm.dag.entryAfter ["clearMangoConfig"] ''
|
||||
cat ${autostart_sh} > $HOME/.config/mango/autostart.sh
|
||||
chmod +x $HOME/.config/mango/autostart.sh
|
||||
'';
|
||||
}
|
||||
// lib.optionalAttrs (cfg.settings != "") {
|
||||
createMangoConfig = lib.hm.dag.entryAfter ["clearMangoConfig"] ''
|
||||
cat > $HOME/.config/mango/config.conf <<EOF
|
||||
${cfg.settings}
|
||||
EOF
|
||||
'';
|
||||
}
|
||||
// {
|
||||
clearMangoConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
rm -rf $HOME/.config/mango
|
||||
mkdir -p $HOME/.config/mango
|
||||
'';
|
||||
home.packages = [cfg.package];
|
||||
xdg.configFile = {
|
||||
"mango/config.conf" = lib.mkIf (cfg.settings != "") {
|
||||
text = cfg.settings;
|
||||
};
|
||||
"mango/autostart.sh" = lib.mkIf (cfg.autostart_sh != "") {
|
||||
source = autostart_sh;
|
||||
executable = true;
|
||||
};
|
||||
};
|
||||
systemd.user.targets.mango-session = lib.mkIf cfg.systemd.enable {
|
||||
Unit = {
|
||||
Description = "mango compositor session";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue