mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
treewide: assertions at top of config
Moving assertions to be consistently at top of the config blocks. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
@@ -221,22 +221,6 @@ in
|
||||
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
warnings =
|
||||
if genAccountsConf && (cfg.extraConfig.general.unsafe-accounts-conf or false) == false then
|
||||
[
|
||||
''
|
||||
aerc: `programs.aerc.enable` is set, but `...extraConfig.general.unsafe-accounts-conf` is set to false or unset.
|
||||
This will prevent aerc from starting; see `unsafe-accounts-conf` in the man page aerc-config(5):
|
||||
> By default, the file permissions of accounts.conf must be restrictive and only allow reading by the file owner (0600).
|
||||
> Set this option to true to ignore this permission check. Use this with care as it may expose your credentials.
|
||||
These permissions are not possible with home-manager, since the generated file is in the nix-store (permissions 0444).
|
||||
Therefore, please set `programs.aerc.extraConfig.general.unsafe-accounts-conf = true`.
|
||||
This option is safe; if `passwordCommand` is properly set, no credentials will be written to the nix store.
|
||||
''
|
||||
]
|
||||
else
|
||||
[ ];
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
@@ -254,6 +238,22 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
warnings =
|
||||
if genAccountsConf && (cfg.extraConfig.general.unsafe-accounts-conf or false) == false then
|
||||
[
|
||||
''
|
||||
aerc: `programs.aerc.enable` is set, but `...extraConfig.general.unsafe-accounts-conf` is set to false or unset.
|
||||
This will prevent aerc from starting; see `unsafe-accounts-conf` in the man page aerc-config(5):
|
||||
> By default, the file permissions of accounts.conf must be restrictive and only allow reading by the file owner (0600).
|
||||
> Set this option to true to ignore this permission check. Use this with care as it may expose your credentials.
|
||||
These permissions are not possible with home-manager, since the generated file is in the nix-store (permissions 0444).
|
||||
Therefore, please set `programs.aerc.extraConfig.general.unsafe-accounts-conf = true`.
|
||||
This option is safe; if `passwordCommand` is properly set, no credentials will be written to the nix store.
|
||||
''
|
||||
]
|
||||
else
|
||||
[ ];
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file = {
|
||||
|
||||
Reference in New Issue
Block a user