From 708c34448ab20bb9610cd86bf3def9405da53afa Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Mon, 9 Oct 2023 16:18:11 -0400 Subject: [PATCH] modularized --- flake.nix | 5 ++- home.nix | 89 ++++++++++++++------------------------------ programs/default.nix | 5 +++ programs/kitty.nix | 34 +++++++++++++++++ shell/bash.nix | 24 ++++++++++++ shell/default.nix | 8 ++++ shell/zsh.nix | 44 ++++++++++++++++++++++ 7 files changed, 146 insertions(+), 63 deletions(-) create mode 100644 programs/default.nix create mode 100644 programs/kitty.nix create mode 100644 shell/bash.nix create mode 100644 shell/default.nix create mode 100644 shell/zsh.nix diff --git a/flake.nix b/flake.nix index d1bb426..42205cc 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,10 @@ # Specify your home configuration modules here, for example, # the path to your home.nix. - modules = [ ./home.nix ]; + modules = [ + ./home.nix + ./shell + ]; # Optionally use extraSpecialArgs # to pass through arguments to home.nix diff --git a/home.nix b/home.nix index ceb39c8..9ffc454 100644 --- a/home.nix +++ b/home.nix @@ -10,76 +10,41 @@ }; packages = with pkgs; [ wineWowPackages.unstable - gcc-arm-embedded ]; }; - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableVteIntegration = true; - cdpath = [ - "/mnt/nixos/etc/nixos/" - "/mnt/stuff/school/" - ]; - defaultKeymap = null; # was "vicmd" - dotDir = ".config/zsh"; - history = { - ignoreSpace = true; - path = "${config.xdg.dataHome}/zsh/zsh_history"; - save = 10000; - }; - historySubstringSearch.enable = true; - oh-my-zsh = { - enable = true; - plugins = [ - "z" - "git" - "vi-mode" - "thefuck" - ]; - theme = "bira"; # TODO: figure out how to source custom theme - # other cool themes: - # duellj - # simonoff - # strug - # bira - }; - sessionVariables = { + programs.kitty = { + enable = true; + package = pkgs.runCommandLocal "no-kitty" {} "mkdir $out"; + # use kitty provided by your distro's package manager + # can cause weird behaviour if anyhting depends on this package + font.name = "FiraCode Nerd Font Mono"; + # font.package = pkgs.maple-mono-NF; + font.package = pkgs.nerdfonts.override {fonts = ["FiraCode"];}; + font.size = 12.0; + shellIntegration.enableZshIntegration = true; + theme = "Rosé Pine Moon"; + settings = { + cursor = "none"; + cursor_shape = "block"; + cursor_blink_interval = 0; + shell = "zsh"; + shell_integration = "no-cursor"; + background_opacity = "0.9"; + tab_bar_style = "powerline"; + tab_separator = " |"; + tab_powerline_style = "slanted"; + enable_audio_bell = "no"; + # allow_remote_control = "password"; + update_check_interval = 0; + linux_display_server = "wayland"; }; - shellAliases = { - ls = "eza"; + keybindings = { + "kitty_mod+b" = "select_tab"; }; }; - programs.bash = { - enable = true; - enableCompletion = true; - enableVteIntegration = true; - bashrcExtra = '' - -if [ -d "$HOME/.local/bin" ] ; then - PATH="$HOME/.local/bin:$PATH" -fi - - ''; # this should be changed to use home.sessionVariables - - profileExtra = '' - -eval "$(ssh-agent -s)" -ssh-add ~/.ssh/git_school -ssh-add ~/.ssh/git_personal -ssh-add ~/.ssh/id_ed25519 - - ''; - }; - - # programs.kitty = { - # enable = true; - # }; - # gtk = { # enable = true; # theme.package = pkgs.adw-gtk3; diff --git a/programs/default.nix b/programs/default.nix new file mode 100644 index 0000000..82c0af1 --- /dev/null +++ b/programs/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./kitty.nix + ]; +} diff --git a/programs/kitty.nix b/programs/kitty.nix new file mode 100644 index 0000000..84661b0 --- /dev/null +++ b/programs/kitty.nix @@ -0,0 +1,34 @@ +{ config, pkgs, ... }: + +{ + programs.kitty = { + enable = true; + package = pkgs.runCommandLocal "no-kitty" {} "mkdir $out"; + # use kitty provided by your distro's package manager + # can cause weird behaviour if anyhting depends on this package + font.name = "FiraCode Nerd Font Mono"; + # font.package = pkgs.maple-mono-NF; + font.package = pkgs.nerdfonts.override {fonts = ["FiraCode"];}; + font.size = 12.0; + shellIntegration.enableZshIntegration = true; + theme = "Rosé Pine Moon"; + settings = { + cursor = "none"; + cursor_shape = "block"; + cursor_blink_interval = 0; + shell = "zsh"; + shell_integration = "no-cursor"; + background_opacity = "0.9"; + tab_bar_style = "powerline"; + tab_separator = " |"; + tab_powerline_style = "slanted"; + enable_audio_bell = "no"; + # allow_remote_control = "password"; + update_check_interval = 0; + linux_display_server = "wayland"; + }; + keybindings = { + "kitty_mod+b" = "select_tab"; + }; + }; +} diff --git a/shell/bash.nix b/shell/bash.nix new file mode 100644 index 0000000..bf2ed63 --- /dev/null +++ b/shell/bash.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: +{ + programs.bash = { + enable = true; + enableCompletion = true; + enableVteIntegration = true; + bashrcExtra = '' + +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi + + ''; # this should be changed to use home.sessionVariables + + profileExtra = '' + +eval "$(ssh-agent -s)" +ssh-add ~/.ssh/git_school +ssh-add ~/.ssh/git_personal +ssh-add ~/.ssh/id_ed25519 + + ''; + }; +} diff --git a/shell/default.nix b/shell/default.nix new file mode 100644 index 0000000..76ffca9 --- /dev/null +++ b/shell/default.nix @@ -0,0 +1,8 @@ +{ + +imports = [ + ./zsh.nix + ./bash.nix +]; + +} diff --git a/shell/zsh.nix b/shell/zsh.nix new file mode 100644 index 0000000..332ceaf --- /dev/null +++ b/shell/zsh.nix @@ -0,0 +1,44 @@ +{ config, pkgs, ... }: + +{ + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableVteIntegration = true; + cdpath = [ + "/mnt/nixos/etc/nixos/" + "/mnt/stuff/school/" + ]; + defaultKeymap = null; # was "vicmd" + dotDir = ".config/zsh"; + history = { + ignoreSpace = true; + path = "${config.xdg.dataHome}/zsh/zsh_history"; + save = 10000; + }; + historySubstringSearch.enable = true; + oh-my-zsh = { + enable = true; + plugins = [ + "z" + "git" + "vi-mode" + "thefuck" + ]; + theme = "bira"; # TODO: figure out how to source custom theme + # other cool themes: + # duellj + # simonoff + # strug + # bira + }; + sessionVariables = { + + }; + shellAliases = { + ls = "eza"; + }; + }; + +}