wip
This commit is contained in:
parent
53d0bdf0ce
commit
c24d6892ea
@ -1,16 +1,21 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
|
enableAutosuggestions = true;
|
||||||
|
enableSyntaxHighlighting = true;
|
||||||
|
|
||||||
# History settings
|
# History settings
|
||||||
history = {
|
history = {
|
||||||
size = 10000;
|
size = 5000;
|
||||||
path = "$HOME/.zsh_history";
|
path = "${config.xdg.stateHome}/zsh/history";
|
||||||
ignoreDups = true;
|
ignoreDups = true;
|
||||||
|
ignoreAllDups = true;
|
||||||
|
ignoreSpace = true;
|
||||||
share = true;
|
share = true;
|
||||||
|
extended = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
autosuggestion = {
|
autosuggestion = {
|
||||||
@ -19,40 +24,39 @@
|
|||||||
|
|
||||||
# Shell options
|
# Shell options
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
# Enable vi mode
|
# Keybindings
|
||||||
bindkey -v
|
bindkey -e
|
||||||
|
bindkey '^p' history-search-backward
|
||||||
|
bindkey '^n' history-search-forward
|
||||||
|
bindkey '^[w' kill-region
|
||||||
|
# Bind Home key to beginning-of-line
|
||||||
|
bindkey '^[[H' beginning-of-line
|
||||||
|
bindkey '^[[1~' beginning-of-line
|
||||||
|
# Bind End key to end-of-line
|
||||||
|
bindkey '^[[F' end-of-line
|
||||||
|
bindkey '^[[4~' end-of-line
|
||||||
|
# Bind Delete key to delete-char
|
||||||
|
bindkey '^[[3~' delete-char
|
||||||
|
|
||||||
# Better history search
|
# Terminal settings
|
||||||
bindkey '^R' history-incremental-search-backward
|
export TERM=xterm-256color
|
||||||
|
|
||||||
# Basic auto/tab completion
|
|
||||||
autoload -U compinit
|
|
||||||
zstyle ':completion:*' menu select
|
|
||||||
zmodload zsh/complist
|
|
||||||
compinit
|
|
||||||
_comp_options+=(globdots)
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
ll = "ls -la";
|
ls = "eza";
|
||||||
|
ll = "eza -alh";
|
||||||
|
tree = "eza --tree";
|
||||||
|
dcupd = "docker compose up -d --remove-orphans";
|
||||||
|
dcdown = "docker compose down";
|
||||||
|
dclogs = "docker logs -f --tail 100";
|
||||||
|
vi = "nvim";
|
||||||
|
vim = "nvim";
|
||||||
|
lg = "lazygit";
|
||||||
".." = "cd ..";
|
".." = "cd ..";
|
||||||
"..." = "cd ../..";
|
"..." = "cd ../..";
|
||||||
update = "sudo nixos-rebuild switch";
|
update = "sudo nixos-rebuild switch";
|
||||||
vim = "nvim";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins = [
|
|
||||||
{
|
|
||||||
name = "zsh-syntax-highlighting";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "zsh-users";
|
|
||||||
repo = "zsh-syntax-highlighting";
|
|
||||||
rev = "refs/tags/0.8.0";
|
|
||||||
sha256 = "1yl8zdip1z9inp280sfa5byjbf2vqh2iazsycar987khjsi5d5w8";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.oh-my-posh = {
|
programs.oh-my-posh = {
|
||||||
@ -61,4 +65,25 @@
|
|||||||
package = pkgs.oh-my-posh;
|
package = pkgs.oh-my-posh;
|
||||||
settings = builtins.fromJSON (builtins.readFile ./oh-my-posh/config.json);
|
settings = builtins.fromJSON (builtins.readFile ./oh-my-posh/config.json);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.zoxide = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
options = ["--cmd" "cd"];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.eza = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
zsh-syntax-highlighting
|
||||||
|
zsh-fzf-tab
|
||||||
|
zsh-completions
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
14
switch.sh
14
switch.sh
@ -7,11 +7,19 @@ set -e
|
|||||||
# Default to the nixos configuration if no argument is provided
|
# Default to the nixos configuration if no argument is provided
|
||||||
CONFIG=${1:-nixos}
|
CONFIG=${1:-nixos}
|
||||||
|
|
||||||
# Check if the configuration exists in flake.nix
|
# Use nix itself to list available configurations
|
||||||
if ! grep -q "nixosConfigurations.$CONFIG" flake.nix; then
|
AVAILABLE_CONFIGS=$(nix flake show --json | jq -r '.nixosConfigurations | keys[]' 2>/dev/null)
|
||||||
|
|
||||||
|
# If the above command fails, fall back to a simple grep method
|
||||||
|
if [ -z "$AVAILABLE_CONFIGS" ]; then
|
||||||
|
AVAILABLE_CONFIGS=$(grep -A 100 "nixosConfigurations = {" flake.nix | grep -E "^\s+[a-zA-Z0-9_-]+ = " | sed 's/^\s*\([a-zA-Z0-9_-]*\)\s*=.*/\1/')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if the configuration exists
|
||||||
|
if ! echo "$AVAILABLE_CONFIGS" | grep -q "^${CONFIG}$"; then
|
||||||
echo "Error: Configuration '$CONFIG' not found in flake.nix"
|
echo "Error: Configuration '$CONFIG' not found in flake.nix"
|
||||||
echo "Available configurations:"
|
echo "Available configurations:"
|
||||||
grep -o "nixosConfigurations\.[a-zA-Z0-9_-]*" flake.nix | sed 's/nixosConfigurations\./ - /'
|
echo "$AVAILABLE_CONFIGS" | sed 's/^/ - /'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -27,19 +27,4 @@
|
|||||||
|
|
||||||
services.displayManager.defaultSession = "none+i3";
|
services.displayManager.defaultSession = "none+i3";
|
||||||
|
|
||||||
# Additional desktop-specific packages
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
firefox
|
|
||||||
libreoffice
|
|
||||||
vlc
|
|
||||||
gimp
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enable sound
|
|
||||||
sound.enable = true;
|
|
||||||
hardware.pulseaudio.enable = true;
|
|
||||||
|
|
||||||
# Enable bluetooth
|
|
||||||
hardware.bluetooth.enable = true;
|
|
||||||
services.blueman.enable = true;
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user