diff --git a/flake.lock b/flake.lock index 879b4b4..defdca3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,27 @@ { "nodes": { + "apple-silicon": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1742098834, + "narHash": "sha256-l98XVpNXW6hr0AsxCeQZbdf6EGT8OpHdkWBi7sdel4s=", + "owner": "tpwrules", + "repo": "nixos-apple-silicon", + "rev": "8457960249bcfd34c22838e20eaa7d8261428688", + "type": "github" + }, + "original": { + "owner": "tpwrules", + "repo": "nixos-apple-silicon", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": "nixpkgs" @@ -18,6 +40,95 @@ "type": "github" } }, + "flake-compat": { + "locked": { + "lastModified": 1688025799, + "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils-plus": { + "inputs": { + "flake-utils": "flake-utils" + }, + "locked": { + "lastModified": 1715533576, + "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742655702, + "narHash": "sha256-jbqlw4sPArFtNtA1s3kLg7/A4fzP4GLk9bGbtUJg0JQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0948aeedc296f964140d9429223c7e4a0702a1ff", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, "nixlib": { "locked": { "lastModified": 1736643958, @@ -88,9 +199,65 @@ }, "root": { "inputs": { + "apple-silicon": "apple-silicon", "disko": "disko", + "home-manager": "home-manager", "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "snowfall-lib": "snowfall-lib" + } + }, + "rust-overlay": { + "flake": false, + "locked": { + "lastModified": 1686795910, + "narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "snowfall-lib": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils-plus": "flake-utils-plus", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736130495, + "narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=", + "owner": "snowfallorg", + "repo": "lib", + "rev": "02d941739f98a09e81f3d2d9b3ab08918958beac", + "type": "github" + }, + "original": { + "owner": "snowfallorg", + "repo": "lib", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index b3e466c..72e0884 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,14 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; disko.url = "github:nix-community/disko"; + snowfall-lib = { + url = "github:snowfallorg/lib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager/release-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; apple-silicon = { url = "github:tpwrules/nixos-apple-silicon"; inputs.nixpkgs.follows = "nixpkgs"; @@ -14,96 +22,113 @@ }; }; - outputs = { self, nixpkgs, disko, nixos-generators, apple-silicon }: - let - mkSystem = { systemConfig ? { }, moduleConfig }: nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - disko.nixosModules.disko - ./lib/disk-config.nix - ./lib/common-system.nix - systemConfig - ({ ... }: moduleConfig) - ]; - }; - in - { - # NixOS Generators - packages.x86_64-linux = { - # RKE2 - rke2-image = nixos-generators.nixosGenerate { - system = "x86_64-linux"; - format = "vmware"; - modules = [ - ./hosts/rke2-image.nix - ]; + outputs = inputs: + inputs.snowfall-lib.mkFlake { + inherit inputs; + src = ./.; + + snowfall = { + meta = { + name = "reichardnix"; + title = "ReichardNix"; }; - usb-image = nixos-generators.nixosGenerate { - system = "x86_64-linux"; - format = "raw-efi"; - modules = [ - ./hosts/usb-image.nix - ]; - }; + namespace = "reichardnix"; }; - # NixOS Configurations - nixosConfigurations = { - # MBP NixOS Asahi - mpb-asahi = nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = [ - apple-silicon.nixosModules.default - ./hosts/mbp-asahi.nix - ]; - }; - - # Office Server (LLaMA / ADS-B) - lin-va-office = mkSystem { - systemConfig = ./hosts/office-server.nix; - moduleConfig = { - hostName = "lin-va-office"; - mainDiskID = "/dev/disk/by-id/ata-MTFDDAK512MBF-1AN1ZABHA_161212233628"; - network = { - interface = "enp5s0"; - address = "10.0.50.120"; - defaultGateway = "10.0.50.254"; - nameservers = [ "10.0.50.254" ]; - }; - }; - }; - - # Utility Room Desktop - lin-va-utility = mkSystem { - systemConfig = ./hosts/utility-desktop.nix; - moduleConfig = { - hostName = "lin-va-utility"; - mainDiskID = "/dev/disk/by-id/nvme-eui.0026b768429d3eb5"; - network = { - interface = "eno1"; - address = "10.0.20.50"; - defaultGateway = "10.0.20.254"; - nameservers = [ "10.0.20.254" ]; - }; - }; - }; - - # Nix Builder - lin-va-nix-builder = mkSystem { - systemConfig = ./hosts/builder.nix; - moduleConfig = { - hostName = "lin-va-nix-builder"; - mainDiskID = "/dev/xvda"; - enableXenGuest = true; - network = { - interface = "enX0"; - address = "10.0.50.130"; - defaultGateway = "10.0.50.254"; - nameservers = [ "10.0.50.254" ]; - }; - }; - }; - }; + # home-manager.enable = true; }; } + +# outputs = { self, nixpkgs, disko, nixos-generators, apple-silicon }: +# let +# mkSystem = { systemConfig ? { }, moduleConfig }: nixpkgs.lib.nixosSystem { +# system = "x86_64-linux"; +# modules = [ +# disko.nixosModules.disko +# ./lib/disk-config.nix +# ./lib/common-system.nix +# systemConfig +# ({ ... }: moduleConfig) +# ]; +# }; +# in +# { +# # NixOS Generators +# packages.x86_64-linux = { +# # RKE2 +# rke2-image = nixos-generators.nixosGenerate { +# system = "x86_64-linux"; +# format = "vmware"; +# modules = [ +# ./hosts/rke2-image.nix +# ]; +# }; + +# usb-image = nixos-generators.nixosGenerate { +# system = "x86_64-linux"; +# format = "raw-efi"; +# modules = [ +# ./hosts/usb-image.nix +# ]; +# }; +# }; + +# # NixOS Configurations +# nixosConfigurations = { +# # MBP NixOS Asahi +# mpb-asahi = nixpkgs.lib.nixosSystem { +# system = "aarch64-linux"; +# modules = [ +# apple-silicon.nixosModules.default +# ./hosts/mbp-asahi.nix +# ]; +# }; + +# # Office Server (LLaMA / ADS-B) +# lin-va-office = mkSystem { +# systemConfig = ./hosts/office-server.nix; +# moduleConfig = { +# hostName = "lin-va-office"; +# mainDiskID = "/dev/disk/by-id/ata-MTFDDAK512MBF-1AN1ZABHA_161212233628"; +# network = { +# interface = "enp5s0"; +# address = "10.0.50.120"; +# defaultGateway = "10.0.50.254"; +# nameservers = [ "10.0.50.254" ]; +# }; +# }; +# }; + +# # Utility Room Desktop +# lin-va-utility = mkSystem { +# systemConfig = ./hosts/utility-desktop.nix; +# moduleConfig = { +# hostName = "lin-va-utility"; +# mainDiskID = "/dev/disk/by-id/nvme-eui.0026b768429d3eb5"; +# network = { +# interface = "eno1"; +# address = "10.0.20.50"; +# defaultGateway = "10.0.20.254"; +# nameservers = [ "10.0.20.254" ]; +# }; +# }; +# }; + +# # Nix Builder +# lin-va-nix-builder = mkSystem { +# systemConfig = ./hosts/builder.nix; +# moduleConfig = { +# hostName = "lin-va-nix-builder"; +# mainDiskID = "/dev/xvda"; +# enableXenGuest = true; +# network = { +# interface = "enX0"; +# address = "10.0.50.130"; +# defaultGateway = "10.0.50.254"; +# nameservers = [ "10.0.50.254" ]; +# }; +# }; +# }; +# }; +# }; diff --git a/home-manager/bash/default.nix b/home-manager/bash/default.nix deleted file mode 100644 index a4342bd..0000000 --- a/home-manager/bash/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - programs.bash = { - enable = true; - shellAliases = { - grep = "grep --color"; - ssh = "TERM=xterm-256color ssh"; - flush_dns = "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"; - }; - profileExtra = '' - SHELL="$BASH" - PATH=~/.bin:$PATH - eval "$(thefuck --alias)" - set -o vi - bind "set show-mode-in-prompt on" - fastfetch - ''; - }; -} diff --git a/home-manager/fastfetch/default.nix b/home-manager/fastfetch/default.nix deleted file mode 100644 index 68bcfb8..0000000 --- a/home-manager/fastfetch/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - xdg.configFile = { - "fastfetch/config.jsonc" = { - source = ./config/config.jsonc; - }; - }; -} diff --git a/home-manager/ghostty/default.nix b/home-manager/ghostty/default.nix deleted file mode 100644 index c59774f..0000000 --- a/home-manager/ghostty/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - xdg.configFile = { - "ghostty/config" = { - source = ./config/ghostty.conf; - }; - }; -} diff --git a/home-manager/git/default.nix b/home-manager/git/default.nix deleted file mode 100644 index 3bee355..0000000 --- a/home-manager/git/default.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - programs.git = { - enable = true; - userName = "Evan Reichard"; - aliases = { - lg = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15"; - }; - includes = [ - { - path = "~/.config/git/work"; - condition = "gitdir:~/Development/git/work/"; - } - { - path = "~/.config/git/personal"; - condition = "gitdir:~/Development/git/personal/"; - } - ]; - extraConfig = { - core = { - autocrlf = "input"; - safecrlf = "true"; - excludesFile = "~/.config/git/.gitignore"; - }; - column = { - ui = "auto"; - }; - fetch = { - prune = true; - pruneTags = true; - all = true; - }; - help = { - autocorrect = true; - }; - diff = { - algorithm = "histogram"; - colorMoved = "plain"; - mnemonicPrefix = true; - renames = true; - }; - rebase = { - autoSquash = true; - autoStash = true; - updateRefs = true; - }; - rerere = { - enabled = true; - autoupdate = true; - }; - commit = { - verbose = true; - }; - branch = { - sort = "-committerdate"; - }; - merge = { - conflictstyle = "zdiff3"; - }; - push = { - autoSetupRemote = true; - }; - }; - }; - - # Copy Configuration - xdg.configFile = { - git = { - source = ./config; - recursive = true; - }; - }; -} diff --git a/home-manager/nvim/default.nix b/home-manager/nvim/default.nix deleted file mode 100644 index 24b25b2..0000000 --- a/home-manager/nvim/default.nix +++ /dev/null @@ -1,194 +0,0 @@ -{ pkgs, ... }: -{ - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; - withNodeJs = true; - withPython3 = true; - - plugins = with pkgs.vimPlugins; [ - # ------------------ - # --- Completion --- - # ------------------ - cmp-buffer # Buffer Word Completion - cmp-cmdline # Command Line Completion - cmp-nvim-lsp # Main LSP - cmp-path # Path Completion - cmp_luasnip # Snippets Completion - friendly-snippets # Snippets - lsp_lines-nvim # Inline Diagnostics - luasnip # Snippets - nvim-cmp # Completions - nvim-lspconfig # LSP Config - - # ------------------- - # ----- Helpers ----- - # ------------------- - aerial-nvim # Code Outline - comment-nvim # Code Comments - diffview-nvim # Diff View - gitsigns-nvim # Git Blame - leap-nvim # Quick Movement - markdown-preview-nvim # Markdown Preview - neo-tree-nvim # File Explorer - none-ls-nvim # Formatters - numb-nvim # Peek / Jump to Lines - nvim-autopairs # Automatically Close Pairs (),[],{} - telescope-fzf-native-nvim # Faster Telescope - telescope-nvim # Fuzzy Finder - telescope-ui-select-nvim # UI - toggleterm-nvim # Terminal Helper - vim-nix # Nix Helpers - which-key-nvim # Shortcut Helper - - # ------------------ - # --- Theme / UI --- - # ------------------ - lualine-nvim # Bottom Line - noice-nvim # UI Tweaks - # nord-nvim # Theme - melange-nvim # Theme - nvim-notify # Noice Dependency - nvim-web-devicons # Dev Icons - - # ------------------ - # --- Treesitter --- - # ------------------ - nvim-treesitter-context - nvim-treesitter.withAllGrammars - - # ------------------- - # ------- DAP ------- - # ------------------- - nvim-dap - nvim-dap-go - nvim-dap-ui - - # -------------------- - # -- NONE-LS EXTRAS -- - # -------------------- - ( - pkgs.vimUtils.buildVimPlugin { - pname = "none-ls-extras.nvim"; - version = "2024-06-11"; - src = pkgs.fetchFromGitHub { - owner = "nvimtools"; - repo = "none-ls-extras.nvim"; - rev = "336e84b9e43c0effb735b08798ffac382920053b"; - sha256 = "sha256-UtU4oWSRTKdEoMz3w8Pk95sROuo3LEwxSDAm169wxwk="; - }; - meta.homepage = "https://github.com/nvimtools/none-ls-extras.nvim/"; - } - ) - - # ------------------- - # ----- Silicon ----- - # ------------------- - ( - pkgs.vimUtils.buildVimPlugin { - pname = "silicon.lua"; - version = "2022-12-03"; - src = pkgs.fetchFromGitHub { - owner = "mhanberg"; - repo = "silicon.lua"; - rev = "5ca462bee0a39b058786bc7fbeb5d16ea49f3a23"; - sha256 = "0vlp645d5mmii513v72jca931miyrhkvhwb9bfzhix1199zx7vi2"; - }; - meta.homepage = "https://github.com/mhanberg/silicon.lua/"; - } - ) - - # ------------------- - # ------- LLM ------- - # ------------------- - ( - pkgs.vimUtils.buildVimPlugin { - pname = "llm.nvim"; - version = "2024-05-25"; - src = pkgs.fetchFromGitHub { - owner = "David-Kunz"; - repo = "gen.nvim"; - rev = "bd19cf584b5b82123de977b44105e855e61e5f39"; - sha256 = "sha256-0AEB6im8Jz5foYzmL6KEGSAYo48g1bkFpjlCSWT6JeE="; - }; - meta.homepage = "https://github.com/David-Kunz/gen.nvim/"; - } - ) - - # ------------------- - # ---- LLAMA.VIM ---- - # ------------------- - ( - pkgs.vimUtils.buildVimPlugin { - pname = "llama.vim"; - version = "2025-01-23"; - src = pkgs.fetchFromGitHub { - owner = "ggml-org"; - repo = "llama.vim"; - rev = "143fe910b8d47a054ed464c38d8b7c17d5354468"; - sha256 = "sha256-PW0HKzhSxcZiWzpDOuy98rl/X0o2nE7tMjZjwwh0qLE="; - }; - meta.homepage = "https://github.com/ggml-org/llama.vim/"; - } - ) - - ]; - - extraPackages = with pkgs; [ - # Telescope Dependencies - fd - ripgrep - tree-sitter - - # LSP Dependencies - go - golangci-lint - golangci-lint-langserver - gopls - lua-language-server - nil - nodePackages.eslint - nodePackages.svelte-language-server - nodePackages.typescript - nodePackages.typescript-language-server - nodePackages.vscode-langservers-extracted - pyright - eslint_d - - # Formatters - luaformatter - nixpkgs-fmt - nodePackages.prettier - sqlfluff - stylua - - # Silicon - silicon - ]; - - extraConfig = ":luafile ~/.config/nvim/lua/init.lua"; - }; - - - xdg.configFile = { - # Copy Configuration - nvim = { - source = ./config; - recursive = true; - }; - - # Generate Nix Vars - "nvim/lua/nix-vars.lua".text = '' - local nix_vars = { - gopls = "${pkgs.gopls}/bin/gopls", - luals = "${pkgs.lua-language-server}/bin/lua-language-server", - sveltels = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver", - tsls = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server", - golintls = "${pkgs.golangci-lint-langserver}/bin/golangci-lint-langserver", - vscls = "${pkgs.nodePackages.vscode-langservers-extracted}", - } - return nix_vars - ''; - }; -} diff --git a/home-manager/README.md b/homes/aarch64-darwin/evanreichard@MBP-Personal/README.md similarity index 100% rename from home-manager/README.md rename to homes/aarch64-darwin/evanreichard@MBP-Personal/README.md diff --git a/home-manager/btop/config/btop.conf b/homes/aarch64-darwin/evanreichard@MBP-Personal/btop/config/btop.conf similarity index 100% rename from home-manager/btop/config/btop.conf rename to homes/aarch64-darwin/evanreichard@MBP-Personal/btop/config/btop.conf diff --git a/home-manager/btop/config/catppuccin_mocha.theme b/homes/aarch64-darwin/evanreichard@MBP-Personal/btop/config/catppuccin_mocha.theme similarity index 100% rename from home-manager/btop/config/catppuccin_mocha.theme rename to homes/aarch64-darwin/evanreichard@MBP-Personal/btop/config/catppuccin_mocha.theme diff --git a/home-manager/btop/default.nix b/homes/aarch64-darwin/evanreichard@MBP-Personal/btop/default.nix similarity index 100% rename from home-manager/btop/default.nix rename to homes/aarch64-darwin/evanreichard@MBP-Personal/btop/default.nix diff --git a/home-manager/home.nix b/homes/aarch64-darwin/evanreichard@MBP-Personal/default.nix similarity index 77% rename from home-manager/home.nix rename to homes/aarch64-darwin/evanreichard@MBP-Personal/default.nix index 87bfced..bdd1949 100644 --- a/home-manager/home.nix +++ b/homes/aarch64-darwin/evanreichard@MBP-Personal/default.nix @@ -4,21 +4,21 @@ let inherit (pkgs.stdenv) isLinux isDarwin; in { - imports = [ - ./bash ./btop ./direnv - ./fastfetch - ./ghostty - ./git - ./nvim ./powerline ./readline ./hyprland ./waybar ]; + reichardnix = { + programs.nvim.enable = true; + programs.ghostty.enable = true; + programs.git.enable = true; + }; + # Home Manager Config home.stateVersion = "24.11"; home.username = "evanreichard"; @@ -27,24 +27,24 @@ in # Global Packages home.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "Meslo" ]; }) - # ghostty - Pending Darwin @ https://github.com/NixOS/nixpkgs/pull/369788 + # --- Android Dev --- android-tools - awscli2 - bashInteractive + + # --- AWS --- cw - fastfetch - gitAndTools.gh - google-cloud-sdk - imagemagick + awscli2 + ssm-session-manager-plugin + + # --- Kubernetes --- kubectl kubernetes-helm + + # --- Uncategorized --- + imagemagick mosh - pre-commit python311 - ssm-session-manager-plugin texliveSmall # Pandoc PDF Dep - thefuck + google-cloud-sdk tldr ] ++ optionals isLinux [ @@ -54,14 +54,6 @@ in ] ++ optionals isDarwin [ ]; - # GitHub CLI - programs.gh = { - enable = true; - settings = { - git_protocol = "ssh"; - }; - }; - # Misc Programs programs.jq.enable = true; programs.k9s.enable = true; diff --git a/home-manager/direnv/default.nix b/homes/aarch64-darwin/evanreichard@MBP-Personal/direnv/default.nix similarity index 100% rename from home-manager/direnv/default.nix rename to homes/aarch64-darwin/evanreichard@MBP-Personal/direnv/default.nix diff --git a/home-manager/hyprland/config/hyprland.conf b/homes/aarch64-darwin/evanreichard@MBP-Personal/hyprland/config/hyprland.conf similarity index 100% rename from home-manager/hyprland/config/hyprland.conf rename to homes/aarch64-darwin/evanreichard@MBP-Personal/hyprland/config/hyprland.conf diff --git a/home-manager/hyprland/default.nix b/homes/aarch64-darwin/evanreichard@MBP-Personal/hyprland/default.nix similarity index 100% rename from home-manager/hyprland/default.nix rename to homes/aarch64-darwin/evanreichard@MBP-Personal/hyprland/default.nix diff --git a/home-manager/powerline/default.nix b/homes/aarch64-darwin/evanreichard@MBP-Personal/powerline/default.nix similarity index 100% rename from home-manager/powerline/default.nix rename to homes/aarch64-darwin/evanreichard@MBP-Personal/powerline/default.nix diff --git a/home-manager/readline/default.nix b/homes/aarch64-darwin/evanreichard@MBP-Personal/readline/default.nix similarity index 100% rename from home-manager/readline/default.nix rename to homes/aarch64-darwin/evanreichard@MBP-Personal/readline/default.nix diff --git a/home-manager/waybar/config/style.css b/homes/aarch64-darwin/evanreichard@MBP-Personal/waybar/config/style.css similarity index 100% rename from home-manager/waybar/config/style.css rename to homes/aarch64-darwin/evanreichard@MBP-Personal/waybar/config/style.css diff --git a/home-manager/waybar/default.nix b/homes/aarch64-darwin/evanreichard@MBP-Personal/waybar/default.nix similarity index 100% rename from home-manager/waybar/default.nix rename to homes/aarch64-darwin/evanreichard@MBP-Personal/waybar/default.nix diff --git a/homes/aarch64-darwin/evanreichard@MBP-Work/default.nix b/homes/aarch64-darwin/evanreichard@MBP-Work/default.nix new file mode 100644 index 0000000..3fc2de9 --- /dev/null +++ b/homes/aarch64-darwin/evanreichard@MBP-Work/default.nix @@ -0,0 +1,75 @@ +{ pkgs, ... }: +let + inherit (pkgs.lib) mkForce; + inherit (pkgs.stdenv) isLinux; +in +{ + reichardnix = { + programs.nvim.enable = true; + }; + + # Home Manager Config + home.stateVersion = "24.11"; + home.username = "evanreichard"; + home.homeDirectory = mkForce (if isLinux then "/home/evanreichard" else "/Users/evanreichard"); + programs.home-manager.enable = true; + + # Global Packages + # home.packages = with pkgs; [ + # (nerdfonts.override { fonts = [ "Meslo" ]; }) + # # ghostty - Pending Darwin @ https://github.com/NixOS/nixpkgs/pull/369788 + # android-tools + # awscli2 + # bashInteractive + # cw + # fastfetch + # gitAndTools.gh + # google-cloud-sdk + # imagemagick + # kubectl + # kubernetes-helm + # mosh + # pre-commit + # python311 + # ssm-session-manager-plugin + # texliveSmall # Pandoc PDF Dep + # thefuck + # tldr + # ] + # ++ optionals isLinux [ + # ghostty + # hyprpaper + # firefox + # ] + # ++ optionals isDarwin [ ]; + + # # GitHub CLI + # programs.gh = { + # enable = true; + # settings = { + # git_protocol = "ssh"; + # }; + # }; + + # # Misc Programs + # programs.jq.enable = true; + # programs.k9s.enable = true; + # programs.pandoc.enable = true; + + # # Enable Flakes & Commands + # nix = { + # package = mkForce pkgs.nix; + # settings = { + # experimental-features = "nix-command flakes"; + # }; + # }; + + # # SQLite Configuration + # home.file.".sqliterc".text = '' + # .headers on + # .mode column + # ''; + + # # Darwin Spotlight Indexing Hack + # disabledModules = [ "targets/darwin/linkapps.nix" ]; +} diff --git a/home-manager/fastfetch/config/config.jsonc b/modules/home/programs/ghostty/config/fastfetch.jsonc similarity index 100% rename from home-manager/fastfetch/config/config.jsonc rename to modules/home/programs/ghostty/config/fastfetch.jsonc diff --git a/home-manager/ghostty/config/ghostty.conf b/modules/home/programs/ghostty/config/ghostty.conf similarity index 95% rename from home-manager/ghostty/config/ghostty.conf rename to modules/home/programs/ghostty/config/ghostty.conf index b5d687d..51140be 100644 --- a/home-manager/ghostty/config/ghostty.conf +++ b/modules/home/programs/ghostty/config/ghostty.conf @@ -1,4 +1,4 @@ -command = bash --login +command = @BASH_PATH@ --login macos-titlebar-style = tabs auto-update = off font-family = "MesloLGM Nerd Font Mono" diff --git a/modules/home/programs/ghostty/default.nix b/modules/home/programs/ghostty/default.nix new file mode 100644 index 0000000..89ab732 --- /dev/null +++ b/modules/home/programs/ghostty/default.nix @@ -0,0 +1,49 @@ +{ pkgs, lib, config, namespace, ... }: +let + inherit (lib) mkIf; + cfg = config.${namespace}.programs.ghostty; +in +{ + options.${namespace}.programs.ghostty = { + enable = lib.mkEnableOption "Ghostty"; + }; + + config = mkIf cfg.enable { + programs.bash = { + enable = true; + shellAliases = { + grep = "grep --color"; + ssh = "TERM=xterm-256color ssh"; + flush_dns = "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"; + }; + profileExtra = '' + SHELL="$BASH" + PATH=~/.bin:$PATH + eval "$(thefuck --alias)" + set -o vi + bind "set show-mode-in-prompt on" + fastfetch + ''; + }; + + home.packages = with pkgs; [ + # Pending Darwin @ https://github.com/NixOS/nixpkgs/pull/369788 + # ghostty + thefuck + fastfetch + bashInteractive + (nerdfonts.override { fonts = [ "Meslo" ]; }) + ]; + + home.file.".config/fastfetch/config.jsonc".text = builtins.readFile ./config/fastfetch.jsonc; + home.file.".config/ghostty/config".text = + let + bashPath = "${pkgs.bashInteractive}/bin/bash"; + in + builtins.replaceStrings + [ "@BASH_PATH@" ] + [ bashPath ] + (builtins.readFile ./config/ghostty.conf); + + }; +} diff --git a/home-manager/git/config/.gitignore b/modules/home/programs/git/config/.gitignore similarity index 100% rename from home-manager/git/config/.gitignore rename to modules/home/programs/git/config/.gitignore diff --git a/home-manager/git/config/personal b/modules/home/programs/git/config/personal similarity index 100% rename from home-manager/git/config/personal rename to modules/home/programs/git/config/personal diff --git a/home-manager/git/config/work b/modules/home/programs/git/config/work similarity index 100% rename from home-manager/git/config/work rename to modules/home/programs/git/config/work diff --git a/modules/home/programs/git/default.nix b/modules/home/programs/git/default.nix new file mode 100644 index 0000000..e92eaba --- /dev/null +++ b/modules/home/programs/git/default.nix @@ -0,0 +1,95 @@ +{ pkgs, lib, config, namespace, ... }: +let + inherit (lib) mkIf; + cfg = config.${namespace}.programs.git; +in +{ + options.${namespace}.programs.git = { + enable = lib.mkEnableOption "Git"; + }; + + config = mkIf cfg.enable { + programs.git = { + enable = true; + userName = "Evan Reichard"; + aliases = { + lg = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15"; + }; + includes = [ + { + path = "~/.config/git/work"; + condition = "gitdir:~/Development/git/work/"; + } + { + path = "~/.config/git/personal"; + condition = "gitdir:~/Development/git/personal/"; + } + ]; + extraConfig = { + core = { + autocrlf = "input"; + safecrlf = "true"; + excludesFile = "~/.config/git/.gitignore"; + }; + column = { + ui = "auto"; + }; + fetch = { + prune = true; + pruneTags = true; + all = true; + }; + help = { + autocorrect = true; + }; + diff = { + algorithm = "histogram"; + colorMoved = "plain"; + mnemonicPrefix = true; + renames = true; + }; + rebase = { + autoSquash = true; + autoStash = true; + updateRefs = true; + }; + rerere = { + enabled = true; + autoupdate = true; + }; + commit = { + verbose = true; + }; + branch = { + sort = "-committerdate"; + }; + merge = { + conflictstyle = "zdiff3"; + }; + push = { + autoSetupRemote = true; + }; + }; + }; + + programs.gh = { + enable = true; + settings = { + git_protocol = "ssh"; + }; + }; + + home.packages = with pkgs; [ + gitAndTools.gh + pre-commit + ]; + + # Copy Configuration + xdg.configFile = { + git = { + source = ./config; + recursive = true; + }; + }; + }; +} diff --git a/home-manager/nvim/config/lua/.luarc.json b/modules/home/programs/nvim/config/lua/.luarc.json similarity index 100% rename from home-manager/nvim/config/lua/.luarc.json rename to modules/home/programs/nvim/config/lua/.luarc.json diff --git a/home-manager/nvim/config/lua/aerial-config.lua b/modules/home/programs/nvim/config/lua/aerial-config.lua similarity index 100% rename from home-manager/nvim/config/lua/aerial-config.lua rename to modules/home/programs/nvim/config/lua/aerial-config.lua diff --git a/home-manager/nvim/config/lua/autopairs-config.lua b/modules/home/programs/nvim/config/lua/autopairs-config.lua similarity index 100% rename from home-manager/nvim/config/lua/autopairs-config.lua rename to modules/home/programs/nvim/config/lua/autopairs-config.lua diff --git a/home-manager/nvim/config/lua/base.lua b/modules/home/programs/nvim/config/lua/base.lua similarity index 100% rename from home-manager/nvim/config/lua/base.lua rename to modules/home/programs/nvim/config/lua/base.lua diff --git a/home-manager/nvim/config/lua/cmp-config.lua b/modules/home/programs/nvim/config/lua/cmp-config.lua similarity index 100% rename from home-manager/nvim/config/lua/cmp-config.lua rename to modules/home/programs/nvim/config/lua/cmp-config.lua diff --git a/home-manager/nvim/config/lua/comment-config.lua b/modules/home/programs/nvim/config/lua/comment-config.lua similarity index 100% rename from home-manager/nvim/config/lua/comment-config.lua rename to modules/home/programs/nvim/config/lua/comment-config.lua diff --git a/home-manager/nvim/config/lua/dap-config.lua b/modules/home/programs/nvim/config/lua/dap-config.lua similarity index 100% rename from home-manager/nvim/config/lua/dap-config.lua rename to modules/home/programs/nvim/config/lua/dap-config.lua diff --git a/home-manager/nvim/config/lua/diffview-config.lua b/modules/home/programs/nvim/config/lua/diffview-config.lua similarity index 100% rename from home-manager/nvim/config/lua/diffview-config.lua rename to modules/home/programs/nvim/config/lua/diffview-config.lua diff --git a/home-manager/nvim/config/lua/git-ref.lua b/modules/home/programs/nvim/config/lua/git-ref.lua similarity index 100% rename from home-manager/nvim/config/lua/git-ref.lua rename to modules/home/programs/nvim/config/lua/git-ref.lua diff --git a/home-manager/nvim/config/lua/git-signs.lua b/modules/home/programs/nvim/config/lua/git-signs.lua similarity index 100% rename from home-manager/nvim/config/lua/git-signs.lua rename to modules/home/programs/nvim/config/lua/git-signs.lua diff --git a/home-manager/nvim/config/lua/init.lua b/modules/home/programs/nvim/config/lua/init.lua similarity index 100% rename from home-manager/nvim/config/lua/init.lua rename to modules/home/programs/nvim/config/lua/init.lua diff --git a/home-manager/nvim/config/lua/leap-config.lua b/modules/home/programs/nvim/config/lua/leap-config.lua similarity index 100% rename from home-manager/nvim/config/lua/leap-config.lua rename to modules/home/programs/nvim/config/lua/leap-config.lua diff --git a/home-manager/nvim/config/lua/llm.lua b/modules/home/programs/nvim/config/lua/llm.lua similarity index 100% rename from home-manager/nvim/config/lua/llm.lua rename to modules/home/programs/nvim/config/lua/llm.lua diff --git a/home-manager/nvim/config/lua/lsp-config.lua b/modules/home/programs/nvim/config/lua/lsp-config.lua similarity index 100% rename from home-manager/nvim/config/lua/lsp-config.lua rename to modules/home/programs/nvim/config/lua/lsp-config.lua diff --git a/home-manager/nvim/config/lua/lsp-lines-config.lua b/modules/home/programs/nvim/config/lua/lsp-lines-config.lua similarity index 100% rename from home-manager/nvim/config/lua/lsp-lines-config.lua rename to modules/home/programs/nvim/config/lua/lsp-lines-config.lua diff --git a/home-manager/nvim/config/lua/lualine-config.lua b/modules/home/programs/nvim/config/lua/lualine-config.lua similarity index 100% rename from home-manager/nvim/config/lua/lualine-config.lua rename to modules/home/programs/nvim/config/lua/lualine-config.lua diff --git a/home-manager/nvim/config/lua/neotree-config.lua b/modules/home/programs/nvim/config/lua/neotree-config.lua similarity index 100% rename from home-manager/nvim/config/lua/neotree-config.lua rename to modules/home/programs/nvim/config/lua/neotree-config.lua diff --git a/home-manager/nvim/config/lua/noice-config.lua b/modules/home/programs/nvim/config/lua/noice-config.lua similarity index 100% rename from home-manager/nvim/config/lua/noice-config.lua rename to modules/home/programs/nvim/config/lua/noice-config.lua diff --git a/home-manager/nvim/config/lua/numb-config.lua b/modules/home/programs/nvim/config/lua/numb-config.lua similarity index 100% rename from home-manager/nvim/config/lua/numb-config.lua rename to modules/home/programs/nvim/config/lua/numb-config.lua diff --git a/home-manager/nvim/config/lua/silicon-config.lua b/modules/home/programs/nvim/config/lua/silicon-config.lua similarity index 100% rename from home-manager/nvim/config/lua/silicon-config.lua rename to modules/home/programs/nvim/config/lua/silicon-config.lua diff --git a/home-manager/nvim/config/lua/telescope-config.lua b/modules/home/programs/nvim/config/lua/telescope-config.lua similarity index 100% rename from home-manager/nvim/config/lua/telescope-config.lua rename to modules/home/programs/nvim/config/lua/telescope-config.lua diff --git a/home-manager/nvim/config/lua/toggleterm-config.lua b/modules/home/programs/nvim/config/lua/toggleterm-config.lua similarity index 100% rename from home-manager/nvim/config/lua/toggleterm-config.lua rename to modules/home/programs/nvim/config/lua/toggleterm-config.lua diff --git a/home-manager/nvim/config/lua/ts-config.lua b/modules/home/programs/nvim/config/lua/ts-config.lua similarity index 100% rename from home-manager/nvim/config/lua/ts-config.lua rename to modules/home/programs/nvim/config/lua/ts-config.lua diff --git a/home-manager/nvim/config/lua/weird-chars.lua b/modules/home/programs/nvim/config/lua/weird-chars.lua similarity index 100% rename from home-manager/nvim/config/lua/weird-chars.lua rename to modules/home/programs/nvim/config/lua/weird-chars.lua diff --git a/home-manager/nvim/config/lua/which-key-config.lua b/modules/home/programs/nvim/config/lua/which-key-config.lua similarity index 100% rename from home-manager/nvim/config/lua/which-key-config.lua rename to modules/home/programs/nvim/config/lua/which-key-config.lua diff --git a/modules/home/programs/nvim/default.nix b/modules/home/programs/nvim/default.nix new file mode 100644 index 0000000..e8de836 --- /dev/null +++ b/modules/home/programs/nvim/default.nix @@ -0,0 +1,203 @@ +{ pkgs, lib, config, namespace, ... }: +let + inherit (lib) mkIf; + cfg = config.${namespace}.programs.nvim; +in +{ + options.${namespace}.programs.nvim = { + enable = lib.mkEnableOption "NeoVim"; + }; + + config = mkIf cfg.enable { + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + withNodeJs = true; + withPython3 = true; + + plugins = with pkgs.vimPlugins; [ + # ------------------ + # --- Completion --- + # ------------------ + cmp-buffer # Buffer Word Completion + cmp-cmdline # Command Line Completion + cmp-nvim-lsp # Main LSP + cmp-path # Path Completion + cmp_luasnip # Snippets Completion + friendly-snippets # Snippets + lsp_lines-nvim # Inline Diagnostics + luasnip # Snippets + nvim-cmp # Completions + nvim-lspconfig # LSP Config + + # ------------------- + # ----- Helpers ----- + # ------------------- + aerial-nvim # Code Outline + comment-nvim # Code Comments + diffview-nvim # Diff View + gitsigns-nvim # Git Blame + leap-nvim # Quick Movement + markdown-preview-nvim # Markdown Preview + neo-tree-nvim # File Explorer + none-ls-nvim # Formatters + numb-nvim # Peek / Jump to Lines + nvim-autopairs # Automatically Close Pairs (),[],{} + telescope-fzf-native-nvim # Faster Telescope + telescope-nvim # Fuzzy Finder + telescope-ui-select-nvim # UI + toggleterm-nvim # Terminal Helper + vim-nix # Nix Helpers + which-key-nvim # Shortcut Helper + + # ------------------ + # --- Theme / UI --- + # ------------------ + lualine-nvim # Bottom Line + noice-nvim # UI Tweaks + # nord-nvim # Theme + melange-nvim # Theme + nvim-notify # Noice Dependency + nvim-web-devicons # Dev Icons + + # ------------------ + # --- Treesitter --- + # ------------------ + nvim-treesitter-context + nvim-treesitter.withAllGrammars + + # ------------------- + # ------- DAP ------- + # ------------------- + nvim-dap + nvim-dap-go + nvim-dap-ui + + # -------------------- + # -- NONE-LS EXTRAS -- + # -------------------- + ( + pkgs.vimUtils.buildVimPlugin { + pname = "none-ls-extras.nvim"; + version = "2024-06-11"; + src = pkgs.fetchFromGitHub { + owner = "nvimtools"; + repo = "none-ls-extras.nvim"; + rev = "336e84b9e43c0effb735b08798ffac382920053b"; + sha256 = "sha256-UtU4oWSRTKdEoMz3w8Pk95sROuo3LEwxSDAm169wxwk="; + }; + meta.homepage = "https://github.com/nvimtools/none-ls-extras.nvim/"; + } + ) + + # ------------------- + # ----- Silicon ----- + # ------------------- + ( + pkgs.vimUtils.buildVimPlugin { + pname = "silicon.lua"; + version = "2022-12-03"; + src = pkgs.fetchFromGitHub { + owner = "mhanberg"; + repo = "silicon.lua"; + rev = "5ca462bee0a39b058786bc7fbeb5d16ea49f3a23"; + sha256 = "0vlp645d5mmii513v72jca931miyrhkvhwb9bfzhix1199zx7vi2"; + }; + meta.homepage = "https://github.com/mhanberg/silicon.lua/"; + } + ) + + # ------------------- + # ------- LLM ------- + # ------------------- + ( + pkgs.vimUtils.buildVimPlugin { + pname = "llm.nvim"; + version = "2024-05-25"; + src = pkgs.fetchFromGitHub { + owner = "David-Kunz"; + repo = "gen.nvim"; + rev = "bd19cf584b5b82123de977b44105e855e61e5f39"; + sha256 = "sha256-0AEB6im8Jz5foYzmL6KEGSAYo48g1bkFpjlCSWT6JeE="; + }; + meta.homepage = "https://github.com/David-Kunz/gen.nvim/"; + } + ) + + # ------------------- + # ---- LLAMA.VIM ---- + # ------------------- + ( + pkgs.vimUtils.buildVimPlugin { + pname = "llama.vim"; + version = "2025-01-23"; + src = pkgs.fetchFromGitHub { + owner = "ggml-org"; + repo = "llama.vim"; + rev = "143fe910b8d47a054ed464c38d8b7c17d5354468"; + sha256 = "sha256-PW0HKzhSxcZiWzpDOuy98rl/X0o2nE7tMjZjwwh0qLE="; + }; + meta.homepage = "https://github.com/ggml-org/llama.vim/"; + } + ) + + ]; + + extraPackages = with pkgs; [ + # Telescope Dependencies + fd + ripgrep + tree-sitter + + # LSP Dependencies + go + golangci-lint + golangci-lint-langserver + gopls + lua-language-server + nil + nodePackages.eslint + nodePackages.svelte-language-server + nodePackages.typescript + nodePackages.typescript-language-server + nodePackages.vscode-langservers-extracted + pyright + eslint_d + + # Formatters + luaformatter + nixpkgs-fmt + nodePackages.prettier + sqlfluff + stylua + + # Silicon + silicon + ]; + + extraConfig = ":luafile ~/.config/nvim/lua/init.lua"; + }; + + xdg.configFile = { + # Copy Configuration + nvim = { + source = ./config; + recursive = true; + }; + + # Generate Nix Vars + "nvim/lua/nix-vars.lua".text = '' + local nix_vars = { + gopls = "${pkgs.gopls}/bin/gopls", + luals = "${pkgs.lua-language-server}/bin/lua-language-server", + sveltels = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver", + tsls = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server", + golintls = "${pkgs.golangci-lint-langserver}/bin/golangci-lint-langserver", + vscls = "${pkgs.nodePackages.vscode-langservers-extracted}", + } + return nix_vars + ''; + }; + }; +} diff --git a/hosts/mbp-asahi.nix b/systems/aarch64-linux/mbp-asahi.nix similarity index 100% rename from hosts/mbp-asahi.nix rename to systems/aarch64-linux/mbp-asahi.nix diff --git a/hosts/builder.nix b/systems/x86_64-linux/nixos-builder/default.nix similarity index 100% rename from hosts/builder.nix rename to systems/x86_64-linux/nixos-builder/default.nix diff --git a/hosts/office-server.nix b/systems/x86_64-linux/office-server/default.nix similarity index 100% rename from hosts/office-server.nix rename to systems/x86_64-linux/office-server/default.nix diff --git a/hosts/utility-desktop.nix b/systems/x86_64-linux/utility-desktop/default.nix similarity index 100% rename from hosts/utility-desktop.nix rename to systems/x86_64-linux/utility-desktop/default.nix diff --git a/hosts/rke2-image.nix b/systems/x86_64-virtual/rke2-image.nix similarity index 100% rename from hosts/rke2-image.nix rename to systems/x86_64-virtual/rke2-image.nix diff --git a/hosts/usb-image.nix b/systems/x86_64-virtual/usb-image.nix similarity index 100% rename from hosts/usb-image.nix rename to systems/x86_64-virtual/usb-image.nix