update and move inputs, WIP ezpc hyprland, improve elvish module, improve locking, disable systemd initrd by default

This commit is contained in:
notgne2 2022-12-26 22:29:11 -07:00
parent cc56729c13
commit 6c6556b8d6
No known key found for this signature in database
6 changed files with 255 additions and 79 deletions

View file

@ -7,6 +7,30 @@
with lib; let
cfg = config.programs.elvish;
in {
options.programs.starship.elvishIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Elvish integration.
'';
};
options.programs.zoxide.elvishIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Elvish integration.
'';
};
options.programs.direnv.elvishIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Elvish integration.
'';
};
options.programs.elvish = {
enable = mkEnableOption "Elvish, a friendly interactive shell and an expressive programming";
@ -18,30 +42,6 @@ in {
'';
};
zoxide = mkOption {
type = types.bool;
default = false;
description = ''
Enable zoxide smart directory switcher
'';
};
starship = mkOption {
type = types.bool;
default = false;
description = ''
Use the starship prompt
'';
};
direnv = mkOption {
type = types.bool;
default = false;
description = ''
Enable direnv integration for elvish
'';
};
package = mkOption {
type = types.package;
default = pkgs.elvish;
@ -73,22 +73,21 @@ in {
exec elvish
'';
# Don't do things twice if we're just passing through :)
programs.starship.enableBashIntegration = mkIf cfg.defaultFromBash false;
programs.starship.enable = mkIf cfg.starship true;
programs.zoxide.enable = mkIf cfg.zoxide true;
programs.direnv.enable = mkIf cfg.direnv true;
programs.zoxide.enableBashIntegration = mkIf cfg.defaultFromBash false;
programs.direnv.enableBashIntegration = mkIf cfg.defaultFromBash false;
programs.elvish.initExtra = mkMerge [
(mkIf cfg.starship ''
(mkIf (config.programs.starship.elvishIntegration && config.programs.starship.enable) ''
if (and (not-eq $E:TERM "dumb") (or (not (has-env "INSIDE_EMACS")) (eq $E:INSIDE_EMACS "vterm"))) {
eval (${config.home.profileDirectory}/bin/starship init elvish)
}
'')
(mkIf cfg.zoxide ''
(mkIf (config.programs.zoxide.elvishIntegration && config.programs.zoxide.enable) ''
eval (${config.programs.zoxide.package}/bin/zoxide init elvish | slurp)
'')
(mkIf cfg.direnv ''
(mkIf (config.programs.direnv.elvishIntegration && config.programs.direnv.enable) ''
eval (${pkgs.direnv}/bin/direnv hook elvish | ${pkgs.gnused}/bin/sed 's/except/catch/' | slurp)
'')
];