mirror of
https://github.com/youwen5/nixos.git
synced 2025-01-18 05:02:10 -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 = {
|
liminalOS = {
|
||||||
flakeLocation = "/home/youwen/.config/liminalOS";
|
flakeLocation = "/home/youwen/.config/liminalOS";
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
|
defaultEditor = inputs.viminal.packages.${pkgs.system}.default;
|
||||||
system = {
|
system = {
|
||||||
audio.prod.enable = true;
|
audio.prod.enable = true;
|
||||||
networking = {
|
networking = {
|
||||||
|
|
|
@ -84,10 +84,6 @@ in
|
||||||
inputs.viminal.packages.${pkgs.system}.default
|
inputs.viminal.packages.${pkgs.system}.default
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.variables = {
|
|
||||||
EDITOR = "nvim";
|
|
||||||
};
|
|
||||||
|
|
||||||
# tells electron apps to use Wayland
|
# tells electron apps to use Wayland
|
||||||
environment.sessionVariables = lib.mkIf cfg.waylandFixes {
|
environment.sessionVariables = lib.mkIf cfg.waylandFixes {
|
||||||
NIXOS_OZONE_WL = "1";
|
NIXOS_OZONE_WL = "1";
|
||||||
|
|
|
@ -50,6 +50,11 @@ in
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to use the en_US locale automatically";
|
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 = {
|
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.
|
# Select internationalisation properties.
|
||||||
i18n = lib.mkIf cfg.useEnUsLocale {
|
i18n = lib.mkIf cfg.useEnUsLocale {
|
||||||
defaultLocale = "en_US.UTF-8";
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
|
Loading…
Reference in a new issue