This commit is contained in:
Jet Pham 2024-07-04 05:19:21 +00:00
parent 0a759878ec
commit f4f9a00296
7 changed files with 4 additions and 144 deletions

View file

@ -23,7 +23,7 @@ in {
sumneko-lua-language-server stylua # Lua
];
programs.zsh = {
programs.nushell = {
initExtra = ''
export EDITOR="nvim"
'';

View file

@ -32,7 +32,7 @@ g.mapleader = ' '
-- Performance
o.lazyredraw = true;
o.shell = "zsh"
o.shell = "nushell"
o.shadafile = "NONE"
-- Colors

View file

@ -11,12 +11,6 @@ in {
options.modules.packages = { enable = mkEnableOption "packages"; };
config = mkIf cfg.enable {
home.packages = with pkgs; [
# C
gcc
gdb
gnumake
clang
clang-tools
# nix
nil
alejandra

View file

@ -5,7 +5,7 @@
environment.defaultPackages = [ ];
services.xserver.desktopManager.xterm.enable = false;
programs.zsh.enable = true;
programs.nushell.enable = true;
# Laptop-specific packages (the other ones are installed in `packages.nix`)
environment.systemPackages = with pkgs; [
@ -89,7 +89,7 @@ xdg = {
users.users.jet = {
isNormalUser = true;
extraGroups = [ "input" "wheel" "networkmanager"];
shell = pkgs.zsh;
shell = pkgs.nushell;
};
# Set up networking and secure it

View file

@ -1,79 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.modules.zsh;
in {
options.modules.zsh = { enable = mkEnableOption "zsh"; };
config = mkIf cfg.enable {
home.packages = [
pkgs.zsh
];
programs.zsh = {
enable = true;
# directory to put config files in
dotDir = ".config/zsh";
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
# .zshrc
initExtra = ''
PROMPT="%F{blue}%m %~%b "$'\n'"%(?.%F{green}%Bλ%b |.%F{red}?) %f"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store";
export ZK_NOTEBOOK_DIR="~/stuff/notes";
export DIRENV_LOG_FORMAT="";
bindkey '^ ' autosuggest-accept
edir() { tar -cz $1 | age -p > $1.tar.gz.age && rm -rf $1 &>/dev/null && echo "$1 encrypted" }
ddir() { age -d $1 | tar -xz && rm -rf $1 &>/dev/null && echo "$1 decrypted" }
'';
# basically aliases for directories:
# `cd ~dots` will cd into ~/.config/nixos
dirHashes = {
dots = "$HOME/.config/nixos";
stuff = "$HOME/stuff";
media = "/run/media/$USER";
junk = "$HOME/stuff/other";
};
# Tweak settings for history
history = {
save = 1000;
size = 1000;
path = "$HOME/.cache/zsh_history";
};
# Set some aliases
shellAliases = {
c = "clear";
mkdir = "mkdir -vp";
rm = "rm -rifv";
mv = "mv -iv";
cp = "cp -riv";
cat = "bat --paging=never --style=plain";
ls = "exa -a --icons";
tree = "exa --tree --icons";
nd = "nix develop -c $SHELL";
rebuild = "sudo nixos-rebuild switch --flake $NIXOS_CONFIG_DIR --fast; notify-send 'Rebuild complete\!'";
};
# Source all plugins, nix-style
plugins = [
{
name = "auto-ls";
src = pkgs.fetchFromGitHub {
owner = "notusknot";
repo = "auto-ls";
rev = "62a176120b9deb81a8efec992d8d6ed99c2bd1a1";
sha256 = "08wgs3sj7hy30x03m8j6lxns8r2kpjahb9wr0s0zyzrmr4xwccj0";
};
}
];
};
};
}