init: added flake.nix and shell home module

This commit is contained in:
Devyn Freet
2026-07-08 19:11:12 -04:00
parent e44fe413e0
commit 4164edf264
3 changed files with 123 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
flake.lock
+25
View File
@@ -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
];
};
};
};
}
+97
View File
@@ -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"
'';
};
};
}