Configure zsh, cleanup worf

This commit is contained in:
Felix Albrigtsen 2023-07-27 11:33:44 +02:00
parent a71e0e80b7
commit b1d57cc4a6
3 changed files with 86 additions and 13 deletions

View File

@ -14,11 +14,19 @@
}; };
# System packages for all users # System packages for all users
environment.systemPackages = [ environment = {
pkgs.ripgrep systemPackages = with pkgs; [
pkgs.wget ripgrep
wget
git
]; ];
variables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
};
users.users.felixalb = { users.users.felixalb = {
home = "/Users/felixalb"; home = "/Users/felixalb";
shell = pkgs.zsh; shell = pkgs.zsh;
@ -27,6 +35,21 @@
programs.zsh.enable = true; programs.zsh.enable = true;
system.activationScripts.postActivation.text = ''sudo chsh -s ${pkgs.zsh}/bin/zsh''; # Since it's not possible to declare default shell, run this command after build system.activationScripts.postActivation.text = ''sudo chsh -s ${pkgs.zsh}/bin/zsh''; # Since it's not possible to declare default shell, run this command after build
fonts = {
fontDir.enable = true;
fonts = with pkgs; [
source-code-pro
font-awesome
hack-font
(nerdfonts.override {
fonts = [
"FiraCode"
];
})
];
};
system.defaults = { system.defaults = {
# login window settings # login window settings
loginwindow = { loginwindow = {

View File

@ -5,24 +5,21 @@
, ... , ...
}: { }: {
imports = [
./zsh.nix
];
home.packages = with pkgs; [ home.packages = with pkgs; [
bottom
discord discord
exa exa
iterm2 iterm2
neovim neovim
slack
spotify
vscode vscode
]; ];
programs = {
zsh = {
enable = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
history.size = 10000;
};
};
# Copy Applications to ~/Applications to allow them to be launched from Spotlight # Copy Applications to ~/Applications to allow them to be launched from Spotlight
disabledModules = [ "targets/darwin/linkapps.nix" ]; disabledModules = [ "targets/darwin/linkapps.nix" ];
home.activation = lib.mkIf pkgs.stdenv.isDarwin { home.activation = lib.mkIf pkgs.stdenv.isDarwin {

53
hosts/worf/zsh.nix Normal file
View File

@ -0,0 +1,53 @@
{ pkgs
, lib
, inputs
, config
, ...
}: {
programs = {
zsh = {
enable = true;
prezto = {
enable = true;
editor = {
keymap = "vi";
dotExpansion = true;
};
prompt = {
theme = "paradox";
pwdLength = "long";
showReturnVal = true;
};
terminal.autoTitle = true;
pmodules = [
"environment"
"terminal"
"editor"
"history"
"directory"
"spectrum"
"utility"
"ssh"
"completion"
"git"
"autosuggestions"
"syntax-highlighting"
"history-substring-search"
"prompt"
];
};
shellAliases = {
l = "exa -l";
tree = "exa --tree --icons";
rebuild = "darwin-rebuild switch --flake /Users/felixalb/nix";
gst = "git status -sb";
gcm = "git commit -m";
gps = "git push";
gpl = "git pull";
};
};
};
}