Swap default login shell for bash

Add readline variables to configure bash, add ~/.inputrc to
rsync-local-config.sh
This commit is contained in:
Evie Litherland-Smith 2024-07-16 07:45:17 +01:00
parent ca6997fb9a
commit e16ea740c9
3 changed files with 31 additions and 16 deletions

View file

@ -73,7 +73,7 @@
system ? "x86_64-linux", system ? "x86_64-linux",
username ? "pixelifytica", username ? "pixelifytica",
hostName ? "Atlas", hostName ? "Atlas",
loginShell ? "zsh", loginShell ? "bash",
... ...
}: [ }: [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@ -89,7 +89,7 @@
networking = {inherit hostName;}; networking = {inherit hostName;};
nix.settings.trusted-users = [username]; nix.settings.trusted-users = [username];
services.greetd.settings.initial_session.user = username; services.greetd.settings.initial_session.user = username;
programs.${loginShell}.enable = true; programs.${loginShell} = lib.mkIf (loginShell != "bash") {enable = true;};
users.users.${username} = { users.users.${username} = {
shell = pkgs.${loginShell}; shell = pkgs.${loginShell};
group = "users"; group = "users";
@ -137,53 +137,48 @@
system = "x86_64-linux"; system = "x86_64-linux";
username = "pixelifytica"; username = "pixelifytica";
hostName = "Legion"; hostName = "Legion";
loginShell = "zsh";
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;}; specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;}; modules = defaultModules {inherit system username hostName;};
}; };
## Personal ## Personal
Northstar = let Northstar = let
system = "x86_64-linux"; system = "x86_64-linux";
username = "pixelifytica"; username = "pixelifytica";
hostName = "Northstar"; hostName = "Northstar";
loginShell = "zsh";
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;}; specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;}; modules = defaultModules {inherit system username hostName;};
}; };
Vanguard = let Vanguard = let
system = "x86_64-linux"; system = "x86_64-linux";
username = "pixelifytica"; username = "pixelifytica";
hostName = "Vanguard"; hostName = "Vanguard";
loginShell = "zsh";
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;}; specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;}; modules = defaultModules {inherit system username hostName;};
}; };
## Work ## Work
Tone = let Tone = let
system = "x86_64-linux"; system = "x86_64-linux";
username = "elitherl"; username = "elitherl";
hostName = "Tone"; hostName = "Tone";
loginShell = "zsh";
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;}; specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;}; modules = defaultModules {inherit system username hostName;};
}; };
Scorch = let Scorch = let
system = "x86_64-linux"; system = "x86_64-linux";
username = "elitherl"; username = "elitherl";
hostName = "Scorch"; hostName = "Scorch";
loginShell = "zsh";
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;}; specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;}; modules = defaultModules {inherit system username hostName;};
}; };
}; };
}; };

View file

@ -1,7 +1,7 @@
HOSTS=("$@") HOSTS=("$@")
# Config files # Config files
for TARGET in bat starship.toml; do for TARGET in ".inputrc" ".config/bat/" ".config/starship.toml"; do
SOURCE="$HOME/.config/$TARGET" SOURCE="$HOME/$TARGET"
echo "--- $SOURCE ---" echo "--- $SOURCE ---"
TMP_TARGET=/tmp/rsync-local-config TMP_TARGET=/tmp/rsync-local-config
TMP_SOURCE=$TMP_TARGET 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 rsync -avzL --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$SOURCE" $TMP_TARGET
sh -c "$NIX_REPLACE" sh -c "$NIX_REPLACE"
for HOST in "${HOSTS[@]}"; do 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 done
rm -rf $TMP_SOURCE rm -rf $TMP_SOURCE
fi fi

View file

@ -13,7 +13,10 @@
du-dust du-dust
]; ];
programs = { programs = {
bash.enable = true; bash = {
enable = true;
enableCompletion = true;
};
bat = { bat = {
enable = true; enable = true;
config = { config = {
@ -39,6 +42,23 @@
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f"; fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
}; };
jq.enable = true; 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; ripgrep.enable = true;
}; };
} }