Merge branch 'nix-community:master' into feat/darwin-emacs-service
This commit is contained in:
commit
b89404bc30
|
@ -107,7 +107,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = types.attrsOf types.string;
|
type = types.attrsOf types.str;
|
||||||
description = ''
|
description = ''
|
||||||
Extra key-value pairs to add to the `[Desktop Entry]` section.
|
Extra key-value pairs to add to the `[Desktop Entry]` section.
|
||||||
This may override other values.
|
This may override other values.
|
||||||
|
|
|
@ -29,6 +29,8 @@ in {
|
||||||
programs.mu = {
|
programs.mu = {
|
||||||
enable = mkEnableOption "mu, a maildir indexer and searcher";
|
enable = mkEnableOption "mu, a maildir indexer and searcher";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "mu" { };
|
||||||
|
|
||||||
# No options/config file present for mu, and program author will not be
|
# No options/config file present for mu, and program author will not be
|
||||||
# adding one soon. See https://github.com/djcb/mu/issues/882 for more
|
# adding one soon. See https://github.com/djcb/mu/issues/882 for more
|
||||||
# information about this.
|
# information about this.
|
||||||
|
@ -42,7 +44,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.mu ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
home.activation.runMuInit = let
|
home.activation.runMuInit = let
|
||||||
maildirOption = genCmdMaildir config.accounts.email.maildirBasePath;
|
maildirOption = genCmdMaildir config.accounts.email.maildirBasePath;
|
||||||
|
@ -52,7 +54,9 @@ in {
|
||||||
# In theory, mu is the only thing that creates that directory, and it is
|
# In theory, mu is the only thing that creates that directory, and it is
|
||||||
# only created during the initial index.
|
# only created during the initial index.
|
||||||
if [[ ! -d "${dbLocation}" ]]; then
|
if [[ ! -d "${dbLocation}" ]]; then
|
||||||
$DRY_RUN_CMD ${pkgs.mu}/bin/mu init ${maildirOption} ${myAddresses} $VERBOSE_ARG;
|
$DRY_RUN_CMD ${
|
||||||
|
getExe cfg.package
|
||||||
|
} init ${maildirOption} ${myAddresses} $VERBOSE_ARG;
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,7 +36,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
dsaFingerprint = mkOption {
|
dsaFingerprint = mkOption {
|
||||||
type = with types; nullOr string;
|
type = with types; nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
example = literalExpression
|
example = literalExpression
|
||||||
"SHA256:1111111111111111111111111111111111111111111";
|
"SHA256:1111111111111111111111111111111111111111111";
|
||||||
|
@ -44,7 +44,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
rsaFingerprint = mkOption {
|
rsaFingerprint = mkOption {
|
||||||
type = with types; nullOr string;
|
type = with types; nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
example = literalExpression
|
example = literalExpression
|
||||||
"SHA256:1111111111111111111111111111111111111111111";
|
"SHA256:1111111111111111111111111111111111111111111";
|
||||||
|
|
|
@ -80,15 +80,28 @@ let
|
||||||
Sets the output transform.
|
Sets the output transform.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
adaptiveSync = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
example = true;
|
||||||
|
description = ''
|
||||||
|
Enables or disables adaptive synchronization
|
||||||
|
(aka. Variable Refresh Rate).
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputStr = { criteria, status, mode, position, scale, transform, ... }:
|
outputStr =
|
||||||
|
{ criteria, status, mode, position, scale, transform, adaptiveSync, ... }:
|
||||||
''output "${criteria}"'' + optionalString (status != null) " ${status}"
|
''output "${criteria}"'' + optionalString (status != null) " ${status}"
|
||||||
+ optionalString (mode != null) " mode ${mode}"
|
+ optionalString (mode != null) " mode ${mode}"
|
||||||
+ optionalString (position != null) " position ${position}"
|
+ optionalString (position != null) " position ${position}"
|
||||||
+ optionalString (scale != null) " scale ${toString scale}"
|
+ optionalString (scale != null) " scale ${toString scale}"
|
||||||
+ optionalString (transform != null) " transform ${transform}";
|
+ optionalString (transform != null) " transform ${transform}"
|
||||||
|
+ optionalString (adaptiveSync != null)
|
||||||
|
" adaptive_sync ${if adaptiveSync then "on" else "off"}";
|
||||||
|
|
||||||
profileModule = types.submodule {
|
profileModule = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
programs.mu.enable = true;
|
programs.mu.enable = true;
|
||||||
|
|
||||||
test.stubs.mu = { };
|
test.stubs.mu = { name = "mu"; };
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertFileContains activate \
|
assertFileContains activate \
|
||||||
|
|
Loading…
Reference in a new issue