programs/lieer: add activation script
This commit is contained in:
parent
e13aa9e287
commit
8be95502b6
|
@ -31,6 +31,10 @@ let
|
|||
({ account = account.address; } // account.lieer.settings);
|
||||
};
|
||||
|
||||
activationScript = account: ''
|
||||
$DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG "${account.maildir.absPath}"/mail/{cur,new,tmp}
|
||||
'';
|
||||
|
||||
settingsOpts = {
|
||||
drop_non_existing_label = mkOption {
|
||||
type = types.bool;
|
||||
|
@ -288,6 +292,13 @@ in {
|
|||
programs.notmuch.new.ignore = [ "/.*[.](json|lock|bak)$/" ];
|
||||
|
||||
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 ${
|
||||
./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