mirror of
https://github.com/youwen5/nixos.git
synced 2025-01-17 20:52:09 -08:00
feat: add default editor option and configuration
This commit is contained in:
parent
f889514d7d
commit
2823e5284e
3 changed files with 12 additions and 4 deletions
|
@ -19,6 +19,7 @@
|
|||
liminalOS = {
|
||||
flakeLocation = "/home/youwen/.config/liminalOS";
|
||||
config.allowUnfree = true;
|
||||
defaultEditor = inputs.viminal.packages.${pkgs.system}.default;
|
||||
system = {
|
||||
audio.prod.enable = true;
|
||||
networking = {
|
||||
|
|
|
@ -84,10 +84,6 @@ in
|
|||
inputs.viminal.packages.${pkgs.system}.default
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
# tells electron apps to use Wayland
|
||||
environment.sessionVariables = lib.mkIf cfg.waylandFixes {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
|
|
|
@ -50,6 +50,11 @@ in
|
|||
default = true;
|
||||
description = "Whether to use the en_US locale automatically";
|
||||
};
|
||||
defaultEditor = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
default = pkgs.neovim;
|
||||
description = "Default text editor that will be installed and set as $EDITOR. Set to null to disable setting and installing default text editor.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
@ -86,6 +91,12 @@ in
|
|||
)
|
||||
);
|
||||
|
||||
environment.variables.EDITOR = lib.mkIf (
|
||||
cfg.defaultEditor != null
|
||||
) cfg.defaultEditor.meta.mainProgram;
|
||||
|
||||
environment.systemPackages = lib.mkIf (cfg.defaultEditor != null) [ cfg.defaultEditor ];
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n = lib.mkIf cfg.useEnUsLocale {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
|
|
Loading…
Reference in a new issue