mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
This commit is contained in:
parent
5df48c4255
commit
cba2f9ce95
1051 changed files with 37028 additions and 26594 deletions
|
|
@ -1,15 +1,25 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.zsh.antidote;
|
||||
|
||||
zPluginStr = (pluginNames:
|
||||
lib.optionalString (pluginNames != [ ]) "${lib.concatStrings (map (name: ''
|
||||
${name}
|
||||
'') pluginNames)}");
|
||||
zPluginStr = (
|
||||
pluginNames:
|
||||
lib.optionalString (pluginNames != [ ])
|
||||
"${lib.concatStrings (
|
||||
map (name: ''
|
||||
${name}
|
||||
'') pluginNames
|
||||
)}"
|
||||
);
|
||||
|
||||
parseHashId = path:
|
||||
lib.elemAt (builtins.match "${builtins.storeDir}/([a-zA-Z0-9]+)-.*" path) 0;
|
||||
in {
|
||||
parseHashId = path: lib.elemAt (builtins.match "${builtins.storeDir}/([a-zA-Z0-9]+)-.*" path) 0;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.hitsmaxft ];
|
||||
|
||||
options.programs.zsh.antidote = {
|
||||
|
|
@ -30,25 +40,26 @@ in {
|
|||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
programs.zsh.initContent = let
|
||||
configFiles = pkgs.runCommand "hm_antidote-files" { } ''
|
||||
echo "${zPluginStr cfg.plugins}" > $out
|
||||
'';
|
||||
hashId = parseHashId "${configFiles}";
|
||||
in (lib.mkOrder 550 ''
|
||||
## home-manager/antidote begin :
|
||||
source ${cfg.package}/share/antidote/antidote.zsh
|
||||
${lib.optionalString cfg.useFriendlyNames
|
||||
"zstyle ':antidote:bundle' use-friendly-names 'yes'"}
|
||||
programs.zsh.initContent =
|
||||
let
|
||||
configFiles = pkgs.runCommand "hm_antidote-files" { } ''
|
||||
echo "${zPluginStr cfg.plugins}" > $out
|
||||
'';
|
||||
hashId = parseHashId "${configFiles}";
|
||||
in
|
||||
(lib.mkOrder 550 ''
|
||||
## home-manager/antidote begin :
|
||||
source ${cfg.package}/share/antidote/antidote.zsh
|
||||
${lib.optionalString cfg.useFriendlyNames "zstyle ':antidote:bundle' use-friendly-names 'yes'"}
|
||||
|
||||
bundlefile=${configFiles}
|
||||
zstyle ':antidote:bundle' file $bundlefile
|
||||
staticfile=/tmp/tmp_hm_zsh_plugins.zsh-${hashId}
|
||||
zstyle ':antidote:static' file $staticfile
|
||||
bundlefile=${configFiles}
|
||||
zstyle ':antidote:bundle' file $bundlefile
|
||||
staticfile=/tmp/tmp_hm_zsh_plugins.zsh-${hashId}
|
||||
zstyle ':antidote:static' file $staticfile
|
||||
|
||||
antidote load $bundlefile $staticfile
|
||||
antidote load $bundlefile $staticfile
|
||||
|
||||
## home-manager/antidote end
|
||||
'');
|
||||
## home-manager/antidote end
|
||||
'');
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue