From 4164edf264763bf564b095b5d0abc2d6a274654a Mon Sep 17 00:00:00 2001 From: Devyn Freet Date: Wed, 8 Jul 2026 19:11:12 -0400 Subject: [PATCH] init: added flake.nix and shell home module --- .gitignore | 1 + flake.nix | 25 +++++++++++++ home/shell.nix | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 .gitignore create mode 100644 flake.nix create mode 100644 home/shell.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..301d47e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +flake.lock diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2598a0b --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Core nixos and home-manager modules for use across systems"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-26.05"; + home-manager = { + url = "github:nix-community/home-manager/release-26.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = { self, nixpkgs, home-manager }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + homeConfigurations = { + shell = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ + ./home/modules/shell.nix + ]; + }; + }; + }; +} diff --git a/home/shell.nix b/home/shell.nix new file mode 100644 index 0000000..3e20631 --- /dev/null +++ b/home/shell.nix @@ -0,0 +1,97 @@ +# Universal shell tools and configuration +{ pkgs, config, ... }: + +let + name = "${config.home.username}"; + homeDir = "${config.home.homeDirectory}"; + myAliases = { + ll = "ls -hl"; + la = "ls -ahl"; + cl = "clear; ls -hl"; + cla = "clear; ls -ahl"; + home-manager = "home-manager -b \"hm-backup\""; + home-switch = "home-manager -b \"hm-backup\" switch --flake ~/.dotfiles"; + gdiff = "git diff HEAD"; + cdot = "cd ${homeDir}/.dotfiles"; + cg = "cd $(git rev-parse --show-toplevel)"; + sudo = "sudo TERMINFO=\"$TERMINFO\""; + }; +in +{ + home = { + sessionVariables = { + EDITOR = "nvim"; + XDG_CONFIG_HOME = "${homeDir}/.config"; + DOTFILES = "${homeDir}/.dotfiles"; + UTILITY = "${homeDir}/.dotfiles/scripts/utility"; + ZVM_VI_INSERT_ESCAPE_BINDKEY = "jk"; + }; + packages = with pkgs; [ + unzip # decompress files + hyfetch # pretty system display tool + tree # recursive directory list + glow # cli markdown display tool + lynx # cli web browser + lua5_5 # scripting language + htop # system monitor + file # identify file type + sops # secret management tool + ]; + }; + + programs = { + zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + shellAliases = myAliases; + history.size = 10000; + setOptions = [ "NO_BEEP" ]; + plugins = [ + { + name = "vi-mode"; + src = pkgs.zsh-vi-mode; + file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; + } + ]; + }; + git = { + enable = true; + settings.user = { + inherit name; + email = config.accounts.email.accounts.${name}.address; + }; + }; + starship = { + enable = true; + enableZshIntegration = true; + }; + yazi = { + enable = true; + shellWrapperName = "y"; + enableZshIntegration = true; + plugins = { + git = { + package = pkgs.yaziPlugins.git; + setup = true; + settings = { + order = 1500; + }; + }; + }; + settings = fromTOML '' + [[plugin.prepend_fetchers]] + url = "*" + run = "git" + group = "git" + + [[plugin.prepend_fetchers]] + url = "*/" + run = "git" + group = "git" + ''; + }; + + }; +}