.
This commit is contained in:
parent
eff0c1ad83
commit
0e1b0a36d1
3 changed files with 66 additions and 14 deletions
|
@ -36,18 +36,5 @@
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
programs.starship.enable = true;
|
programs.starship.enable = true;
|
||||||
|
|
||||||
programs.nano = {
|
|
||||||
enable = true;
|
|
||||||
syntaxHighlight = true;
|
|
||||||
nanorc = ''
|
|
||||||
set autoindent
|
|
||||||
set jumpyscrolling
|
|
||||||
set linenumbers
|
|
||||||
set mouse
|
|
||||||
set saveonexit
|
|
||||||
set smarthome
|
|
||||||
set tabstospaces
|
|
||||||
set tabsize 2
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
38
modules/desktop/editors/default.nix
Normal file
38
modules/desktop/editors/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.attrsets) attrValues;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
cfg = config.modules.desktop.editors;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.editors = let
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) nullOr enum;
|
||||||
|
in {
|
||||||
|
default = mkOption {
|
||||||
|
type = nullOr (enum [ "nano" "nvim" ]);
|
||||||
|
default = "nano";
|
||||||
|
description = "Default editor for text manipulation";
|
||||||
|
example = "nvim";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
(mkIf (cfg.default != null) {
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = cfg.default;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf (cfg.default == "nvim") {
|
||||||
|
user.packages = attrValues {
|
||||||
|
inherit (pkgs) imagemagick editorconfig-core-c sqlite deno pandoc nuspell;
|
||||||
|
inherit (pkgs.hunspellDicts) en_GB nl_NL;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
27
modules/desktop/editors/nano.nix
Normal file
27
modules/desktop/editors/nano.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.desktop.editors.nano = let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
in { enable = mkEnableOption "nano"; };
|
||||||
|
|
||||||
|
config = mkIf config.modules.desktop.editors.nano.enable {
|
||||||
|
programs.nano = {
|
||||||
|
enable = true;
|
||||||
|
syntaxHighlight = true;
|
||||||
|
nanorc = ''
|
||||||
|
set autoindent
|
||||||
|
set jumpyscrolling
|
||||||
|
set linenumbers
|
||||||
|
set mouse
|
||||||
|
set saveonexit
|
||||||
|
set smarthome
|
||||||
|
set tabstospaces
|
||||||
|
set tabsize 2
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue