nixos/nano: add enable, package option, do not create /etc/nanorc by default
and remove nano from environment.defaultPackages. In addition also cleanup the file in general. This is a follow up to #220481 Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
This commit is contained in:
parent
d90e8fdfb7
commit
5b9cdda1c2
3 changed files with 20 additions and 21 deletions
|
@ -196,6 +196,10 @@
|
||||||
|
|
||||||
- `spamassassin` no longer supports the `Hashcash` module. The module needs to be removed from the `loadplugin` list if it was copied over from the default `initPreConf` option.
|
- `spamassassin` no longer supports the `Hashcash` module. The module needs to be removed from the `loadplugin` list if it was copied over from the default `initPreConf` option.
|
||||||
|
|
||||||
|
- `nano` was removed from `environment.defaultPackages`. To not leave systems without a editor, now `programs.nano.enable` is enabled by default.
|
||||||
|
|
||||||
|
- `programs.nano.nanorc` and `programs.nano.syntaxHighlight` no longer have an effect unless `programs.nano.enable` is set to true which is the default.
|
||||||
|
|
||||||
- `services.outline.sequelizeArguments` has been removed, as `outline` no longer executes database migrations via the `sequelize` cli.
|
- `services.outline.sequelizeArguments` has been removed, as `outline` no longer executes database migrations via the `sequelize` cli.
|
||||||
|
|
||||||
- The binary of the package `cloud-sql-proxy` has changed from `cloud_sql_proxy` to `cloud-sql-proxy`.
|
- The binary of the package `cloud-sql-proxy` has changed from `cloud_sql_proxy` to `cloud-sql-proxy`.
|
||||||
|
|
|
@ -42,8 +42,7 @@ let
|
||||||
];
|
];
|
||||||
|
|
||||||
defaultPackageNames =
|
defaultPackageNames =
|
||||||
[ "nano"
|
[ "perl"
|
||||||
"perl"
|
|
||||||
"rsync"
|
"rsync"
|
||||||
"strace"
|
"strace"
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,14 +2,16 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.nano;
|
cfg = config.programs.nano;
|
||||||
LF = "\n";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
###### interface
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
programs.nano = {
|
programs.nano = {
|
||||||
|
enable = lib.mkEnableOption (lib.mdDoc "nano") // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
package = lib.mkPackageOptionMD pkgs "nano" { };
|
||||||
|
|
||||||
nanorc = lib.mkOption {
|
nanorc = lib.mkOption {
|
||||||
type = lib.types.lines;
|
type = lib.types.lines;
|
||||||
|
@ -24,28 +26,22 @@ in
|
||||||
set tabsize 2
|
set tabsize 2
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
syntaxHighlight = lib.mkOption {
|
syntaxHighlight = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = true;
|
default = false;
|
||||||
description = lib.mdDoc "Whether to enable syntax highlight for various languages.";
|
description = lib.mdDoc "Whether to enable syntax highlight for various languages.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
###### implementation
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment = {
|
||||||
config = lib.mkIf (cfg.nanorc != "" || cfg.syntaxHighlight) {
|
etc.nanorc.text = (lib.optionalString cfg.syntaxHighlight ''
|
||||||
environment.etc.nanorc.text = lib.concatStringsSep LF (
|
# load syntax highlighting files
|
||||||
( lib.optionals cfg.syntaxHighlight [
|
include "${cfg.package}/share/nano/*.nanorc"
|
||||||
"# The line below is added because value of programs.nano.syntaxHighlight is set to true"
|
'') + cfg.nanorc;
|
||||||
''include "${pkgs.nano}/share/nano/*.nanorc"''
|
systemPackages = [ cfg.package ];
|
||||||
""
|
};
|
||||||
])
|
|
||||||
++ ( lib.optionals (cfg.nanorc != "") [
|
|
||||||
"# The lines below have been set from value of programs.nano.nanorc"
|
|
||||||
cfg.nanorc
|
|
||||||
])
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue