Merge pull request #220481 from uoleg/master

nixos/nano: refactor nanorc creation
This commit is contained in:
Pol Dellaiera 2023-06-06 21:35:26 +02:00 committed by GitHub
commit 43b346ea1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,8 +35,17 @@ in
###### implementation
config = lib.mkIf (cfg.nanorc != "" || cfg.syntaxHighlight) {
environment.etc.nanorc.text = lib.concatStrings [ cfg.nanorc
(lib.optionalString cfg.syntaxHighlight ''${LF}include "${pkgs.nano}/share/nano/*.nanorc"'') ];
environment.etc.nanorc.text = lib.concatStringsSep LF (
( lib.optionals cfg.syntaxHighlight [
"# The line below is added because value of programs.nano.syntaxHighlight is set to true"
''include "${pkgs.nano}/share/nano/*.nanorc"''
""
])
++ ( lib.optionals (cfg.nanorc != "") [
"# The lines below have been set from value of programs.nano.nanorc"
cfg.nanorc
])
);
};
}