Skip to content

Commit

Permalink
feat: shell choices based off of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Nov 28, 2024
1 parent 5481e75 commit 90d2779
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
7 changes: 4 additions & 3 deletions home/isabel/packages/cli/shell/nushell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
}:
let
inherit (lib.modules) mkIf mkAfter;
inherit (lib.attrsets) mapAttrs;
inherit (lib.strings) escapeShellArg concatMapStrings;
inherit (lib.strings) concatMapStrings;

cfg = osConfig.garden.programs.nushell;
in
Expand All @@ -29,10 +28,12 @@ in

shellAliases = builtins.removeAttrs config.home.shellAliases [ "mkdir" ];

# what a mess
# GPGHOME breaks all nushell really badly
environmentVariables = {
DIRENV_LOG_FORMAT = "";
# PATH = "($env.PATH | split row (char esep) | append [${escapeShellArgs config.home.sessionPath}])";
} // mapAttrs (_: v: (escapeShellArg v)) config.home.sessionVariables;
};

extraConfig =
let
Expand Down
13 changes: 12 additions & 1 deletion modules/base/options/programs/defaults.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
{ lib, ... }:
{ lib, pkgs, ... }:
let
inherit (lib.options) mkOption;
inherit (lib.types) enum nullOr;
inherit (lib.hardware) ldTernary;
in
{
options.garden.programs.defaults = {
shell = mkOption {
type = enum [
"bash"
"zsh"
"fish"
"nushell"
];
default = ldTernary pkgs "bash" "zsh";
};

terminal = mkOption {
type = enum [
"alacritty"
Expand Down
2 changes: 1 addition & 1 deletion modules/nixos/environment/paths.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let
inherit (lib.lists) optional;

cfg = config.programs;
cfg = config.garden.programs;
in
{
# if a given shell is enabled, add the corresponding completion paths
Expand Down

0 comments on commit 90d2779

Please sign in to comment.