mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
programs/lieer: add activation script
This commit is contained in:
parent
e13aa9e287
commit
8be95502b6
2 changed files with 13 additions and 0 deletions
|
@ -31,6 +31,10 @@ let
|
||||||
({ account = account.address; } // account.lieer.settings);
|
({ account = account.address; } // account.lieer.settings);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
activationScript = account: ''
|
||||||
|
$DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG "${account.maildir.absPath}"/mail/{cur,new,tmp}
|
||||||
|
'';
|
||||||
|
|
||||||
settingsOpts = {
|
settingsOpts = {
|
||||||
drop_non_existing_label = mkOption {
|
drop_non_existing_label = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
@ -288,6 +292,13 @@ in {
|
||||||
programs.notmuch.new.ignore = [ "/.*[.](json|lock|bak)$/" ];
|
programs.notmuch.new.ignore = [ "/.*[.](json|lock|bak)$/" ];
|
||||||
|
|
||||||
home.file = listToAttrs (map configFile lieerAccounts);
|
home.file = listToAttrs (map configFile lieerAccounts);
|
||||||
|
|
||||||
|
# Lieer requires the maildir structure to exist before syncing will work.
|
||||||
|
# Normally this is done via 'gmi init', but 'gmi init' bails out if the
|
||||||
|
# config file alreasy exists.
|
||||||
|
home.activation.initLieer =
|
||||||
|
hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ]
|
||||||
|
(concatMapStringsSep "\n" activationScript lieerAccounts);
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ with lib;
|
||||||
assertFileContent home-files/Mail/hm@example.com/.gmailieer.json ${
|
assertFileContent home-files/Mail/hm@example.com/.gmailieer.json ${
|
||||||
./lieer-expected.json
|
./lieer-expected.json
|
||||||
}
|
}
|
||||||
|
assertFileContains activate \
|
||||||
|
'$DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG "/home/hm-user/Mail/hm@example.com"/mail/{cur,new,tmp}'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue