From e16ea740c9d03fae640363ca39f308b4b48b380f Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 16 Jul 2024 07:45:17 +0100 Subject: [PATCH] Swap default login shell for bash Add readline variables to configure bash, add ~/.inputrc to rsync-local-config.sh --- flake.nix | 19 +++++++------------ home/scripts/shell/rsync-local-config.sh | 6 +++--- home/shell/default.nix | 22 +++++++++++++++++++++- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index 166885e2..efa227a2 100644 --- a/flake.nix +++ b/flake.nix @@ -73,7 +73,7 @@ system ? "x86_64-linux", username ? "pixelifytica", hostName ? "Atlas", - loginShell ? "zsh", + loginShell ? "bash", ... }: [ home-manager.nixosModules.home-manager @@ -89,7 +89,7 @@ networking = {inherit hostName;}; nix.settings.trusted-users = [username]; services.greetd.settings.initial_session.user = username; - programs.${loginShell}.enable = true; + programs.${loginShell} = lib.mkIf (loginShell != "bash") {enable = true;}; users.users.${username} = { shell = pkgs.${loginShell}; group = "users"; @@ -137,53 +137,48 @@ system = "x86_64-linux"; username = "pixelifytica"; hostName = "Legion"; - loginShell = "zsh"; in nixpkgs.lib.nixosSystem { specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName loginShell;}; + modules = defaultModules {inherit system username hostName;}; }; ## Personal Northstar = let system = "x86_64-linux"; username = "pixelifytica"; hostName = "Northstar"; - loginShell = "zsh"; in nixpkgs.lib.nixosSystem { specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName loginShell;}; + modules = defaultModules {inherit system username hostName;}; }; Vanguard = let system = "x86_64-linux"; username = "pixelifytica"; hostName = "Vanguard"; - loginShell = "zsh"; in nixpkgs.lib.nixosSystem { specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName loginShell;}; + modules = defaultModules {inherit system username hostName;}; }; ## Work Tone = let system = "x86_64-linux"; username = "elitherl"; hostName = "Tone"; - loginShell = "zsh"; in nixpkgs.lib.nixosSystem { specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName loginShell;}; + modules = defaultModules {inherit system username hostName;}; }; Scorch = let system = "x86_64-linux"; username = "elitherl"; hostName = "Scorch"; - loginShell = "zsh"; in nixpkgs.lib.nixosSystem { specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName loginShell;}; + modules = defaultModules {inherit system username hostName;}; }; }; }; diff --git a/home/scripts/shell/rsync-local-config.sh b/home/scripts/shell/rsync-local-config.sh index 021a906b..a8048b00 100755 --- a/home/scripts/shell/rsync-local-config.sh +++ b/home/scripts/shell/rsync-local-config.sh @@ -1,7 +1,7 @@ HOSTS=("$@") # Config files -for TARGET in bat starship.toml; do - SOURCE="$HOME/.config/$TARGET" +for TARGET in ".inputrc" ".config/bat/" ".config/starship.toml"; do + SOURCE="$HOME/$TARGET" echo "--- $SOURCE ---" TMP_TARGET=/tmp/rsync-local-config TMP_SOURCE=$TMP_TARGET @@ -16,7 +16,7 @@ for TARGET in bat starship.toml; do rsync -avzL --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$SOURCE" $TMP_TARGET sh -c "$NIX_REPLACE" for HOST in "${HOSTS[@]}"; do - rsync -avzL --delete --exclude=".git*" $TMP_SOURCE "$HOST:.config/$TARGET" + rsync -avzL --delete --exclude=".git*" $TMP_SOURCE "$HOST:$TARGET" done rm -rf $TMP_SOURCE fi diff --git a/home/shell/default.nix b/home/shell/default.nix index 84afbd20..55eb98c9 100644 --- a/home/shell/default.nix +++ b/home/shell/default.nix @@ -13,7 +13,10 @@ du-dust ]; programs = { - bash.enable = true; + bash = { + enable = true; + enableCompletion = true; + }; bat = { enable = true; config = { @@ -39,6 +42,23 @@ fileWidgetCommand = "${pkgs.fd}/bin/fd --type f"; }; jq.enable = true; + readline = { + enable = true; + variables = { + bell-style = "visible"; + blink-matching-paren = "On"; + colored-completion-prefix = "On"; + colored-stats = "On"; + completion-ignore-case = "On"; + completion-map-case = "On"; + editing-mode = "emacs"; + expand-tilde = "On"; + horizontal-scroll-mode = "On"; + mark-directories = "On"; + mark-symlinked-directories = "On"; + visible-stats = "On"; + }; + }; ripgrep.enable = true; }; }