From 7b6131a1145134537ea83c4e3f7817804068076b Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 27 Jul 2023 11:33:44 +0200 Subject: [PATCH] Configure zsh, cleanup worf --- hosts/worf/configuration.nix | 31 ++++++++++++++++++--- hosts/worf/home.nix | 15 ++++------ hosts/worf/zsh.nix | 53 ++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 hosts/worf/zsh.nix diff --git a/hosts/worf/configuration.nix b/hosts/worf/configuration.nix index f115ff8..477b7c0 100644 --- a/hosts/worf/configuration.nix +++ b/hosts/worf/configuration.nix @@ -14,10 +14,18 @@ }; # System packages for all users - environment.systemPackages = [ - pkgs.ripgrep - pkgs.wget - ]; + environment = { + systemPackages = with pkgs; [ + ripgrep + wget + git + ]; + + variables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + }; + }; users.users.felixalb = { home = "/Users/felixalb"; @@ -27,6 +35,21 @@ 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 + + fonts = { + fontDir.enable = true; + fonts = with pkgs; [ + source-code-pro + font-awesome + hack-font + (nerdfonts.override { + fonts = [ + "FiraCode" + ]; + }) + ]; + }; + system.defaults = { # login window settings loginwindow = { diff --git a/hosts/worf/home.nix b/hosts/worf/home.nix index 8335979..112a68e 100644 --- a/hosts/worf/home.nix +++ b/hosts/worf/home.nix @@ -5,24 +5,21 @@ , ... }: { + imports = [ + ./zsh.nix + ]; home.packages = with pkgs; [ + bottom discord exa iterm2 neovim + slack + spotify vscode ]; - programs = { - zsh = { - enable = true; - enableAutosuggestions = true; - enableSyntaxHighlighting = true; - history.size = 10000; - }; - }; - # Copy Applications to ~/Applications to allow them to be launched from Spotlight disabledModules = [ "targets/darwin/linkapps.nix" ]; home.activation = lib.mkIf pkgs.stdenv.isDarwin { diff --git a/hosts/worf/zsh.nix b/hosts/worf/zsh.nix new file mode 100644 index 0000000..96ac24b --- /dev/null +++ b/hosts/worf/zsh.nix @@ -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"; + }; + }; + }; +} \ No newline at end of file