diff --git a/configs/alacritty.yml b/configs/alacritty.yml new file mode 100644 index 0000000..5bd3e83 --- /dev/null +++ b/configs/alacritty.yml @@ -0,0 +1,31 @@ +# Alacritty configuration - simple but functional +font: + normal: + family: JetBrainsMono Nerd Font + size: 12.0 + +colors: + primary: + background: "0x1e1e2e" + foreground: "0xf8f8f2" + cursor: + text: "0x1e1e2e" + cursor: "0xf8f8f2" + normal: + black: "0x1e1e2e" + red: "0xf84a50" + green: "0x7ab872" + yellow: "0xf59850" + blue: "0x5192db" + magenta: "0xb775d9" + cyan: "0x54cecd" + white: "0xf8f8f2" + bright: + black: "0x1e1e2e" + red: "0xf84a50" + green: "0x7ab872" + yellow: "0xf59850" + blue: "0x5192db" + magenta: "0xb775d9" + cyan: "0x54cecd" + white: "0xf8f8f2" \ No newline at end of file diff --git a/configs/gitconfig b/configs/gitconfig new file mode 100644 index 0000000..0ac08ca --- /dev/null +++ b/configs/gitconfig @@ -0,0 +1,4 @@ +[core] + editor = hx +[push] + default = current \ No newline at end of file diff --git a/configs/starship.toml b/configs/starship.toml new file mode 100644 index 0000000..43cd66a --- /dev/null +++ b/configs/starship.toml @@ -0,0 +1,8 @@ +# Starship configuration - modern prompt +add_newline = false +command_timeout = 1000 +format = "$all" +right_format = "$time" +[time] +format = "%T" +disabled = false \ No newline at end of file diff --git a/configs/tmux.conf b/configs/tmux.conf new file mode 100644 index 0000000..32d1bed --- /dev/null +++ b/configs/tmux.conf @@ -0,0 +1,5 @@ +# Tmux configuration - base settings +set -g clock24 on +set -g history-limit 10000 +set -g mouse on +set -g default-shell /run/current-system/sw/bin/zsh \ No newline at end of file diff --git a/configs/zshrc b/configs/zshrc new file mode 100644 index 0000000..476a5a5 --- /dev/null +++ b/configs/zshrc @@ -0,0 +1,13 @@ +# ZSH configuration that works with Nix +# This file should be sourced from your shell config + +# Aliases +alias g="git" +alias docker="docker" +alias h="htop" + +# Path setup for Nix packages +export PATH="/nix/var/nix/profiles/default/bin:$PATH" + +# Enable syntax highlighting +ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 2398afb..16649b3 100644 --- a/flake.lock +++ b/flake.lock @@ -16,13 +16,32 @@ "type": "github" } }, - "flake-utils": { + "flake-compat_2": { + "flake": false, "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "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": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -35,6 +54,25 @@ "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" + } + }, + "flake-utils-plus_2": { + "inputs": { + "flake-utils": "flake-utils_2" + }, "locked": { "lastModified": 1657226504, "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", @@ -49,42 +87,22 @@ "type": "github" } }, - "home-manager": { - "inputs": { - "nixpkgs": "nixpkgs" - }, + "flake-utils_2": { "locked": { - "lastModified": 1719827415, - "narHash": "sha256-pvh+1hStXXAZf0sZ1xIJbWGx4u+OGBC1rVx6Wsw0fBw=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "f2e3c19867262dbe84fdfab42467fc8dd83a2005", + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { - "owner": "nix-community", - "ref": "release-23.11", - "repo": "home-manager", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, "nixpkgs": { - "locked": { - "lastModified": 1705331948, - "narHash": "sha256-qjQXfvrAT1/RKDFAMdl8Hw3m4tLVvMCc8fMqzJv0pP4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b8dd8be3c790215716e7c12b247f45ca525867e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { "locked": { "lastModified": 1787070829, "narHash": "sha256-vXNVDVtvfiQuXthP0NHPFdNvvMTkGpx0UP8oddIWbNk=", @@ -100,7 +118,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_2": { "locked": { "lastModified": 1687596132, "narHash": "sha256-snkoTnUJQICNvg7b+DfxPLnIen6FIucM95niW95vTJI=", @@ -118,17 +136,17 @@ }, "root": { "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2", - "tmux-flake": "tmux-flake" + "nixpkgs": "nixpkgs", + "snowfall-lib": "snowfall-lib", + "tmux": "tmux" } }, "snowfall": { "inputs": { - "flake-compat": "flake-compat", - "flake-utils-plus": "flake-utils-plus", + "flake-compat": "flake-compat_2", + "flake-utils-plus": "flake-utils-plus_2", "nixpkgs": [ - "tmux-flake", + "tmux", "nixpkgs" ] }, @@ -147,9 +165,46 @@ "type": "github" } }, - "tmux-flake": { + "snowfall-lib": { "inputs": { - "nixpkgs": "nixpkgs_3", + "flake-compat": "flake-compat", + "flake-utils-plus": "flake-utils-plus", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1784328457, + "narHash": "sha256-4R5WV74NHhPk21ctoPmjL7nQ6txDnoBLwSWULvIw0TY=", + "owner": "snowfallorg", + "repo": "lib", + "rev": "6ee3542cb459ca4b038cfe50ceb8797f05cdabad", + "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" + } + }, + "tmux": { + "inputs": { + "nixpkgs": "nixpkgs_2", "snowfall": "snowfall", "unstable": "unstable" }, diff --git a/flake.nix b/flake.nix index ad1075f..3912363 100644 --- a/flake.nix +++ b/flake.nix @@ -3,41 +3,104 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - home-manager = { - url = "github:nix-community/home-manager/release-23.11"; + snowfall-lib = { + url = "github:snowfallorg/lib"; + inputs.nixpkgs.follows = "nixpkgs"; }; - tmux-flake = { + tmux = { url = "github:jakehamilton/tmux"; }; }; - outputs = { self, nixpkgs, home-manager, tmux-flake }: - let - system = "aarch64-darwin"; - pkgs = import nixpkgs { - inherit system; - config = { - allowUnfree = true; + outputs = inputs: + inputs.snowfall-lib.mkFlake { + inherit inputs; + src = ./.; + + overlays = with inputs; [ + tmux.overlay + tmux.overlays."nixpkgs/plusultra" + ]; + + # Build the package set for the homies environment + packages = { + homies = let + pkgs = import inputs.nixpkgs { + system = "x86_64-linux"; # Default, will be overridden by system-specific builds + }; + in + pkgs.buildEnv { + name = "homies"; + paths = with pkgs; [ + # Core tools + tmux + helix + zsh + git + openssh + + # Terminal applications + alacritty + starship + htop + + # Docker support + docker-client + docker-compose + + # Programming languages and language servers (default always included) + odin + ols # Odin Language Server + harper # Harper Language Server + + # Additional dev tools + gcc + gnumake + curl + wget + jq + ripgrep + findutils + + # Language support packages (optional ones you can enable conditionally) + rustc # For enabling Rust support + rust-analyzer # For Rust LSP + python3 # For Python support + python3Packages.pyright # For Python LSP + nodejs # For JavaScript/TypeScript support + nodePackages.typescript-language-server # For TS LSP + go # For Go support + gopls # For Go LSP + openjdk # For Java support + jdt.ls # For Java LSP + ]; + }; + }; + + # System-specific configuration + systemConfigs = { + # x86_64-linux system config + "x86_64-linux" = { pkgs, ... }: { + # This is where you'd define system-specific configurations + # But in pure Nix, packages are handled through the packages attribute above + }; + + # aarch64-linux system config (ARM Mac/Linux) + "aarch64-linux" = { pkgs, ... }: { + }; + + # darwin (MacOS) system config + "aarch64-darwin" = { pkgs, ... }: { + }; + + # x86_64-darwin (Intel Mac) system config + "x86_64-darwin" = { pkgs, ... }: { }; }; - in { - # Use tmux from jakehamilton/tmux repository - homeConfigurations."tylerbohrer" = home-manager.lib.homeManagerConfiguration { - pkgs = pkgs; - modules = [ - ({ pkgs, ... }: { - # Use the tmux package from jakehamilton/tmux repository - programs.tmux.package = tmux-flake.packages.${system}.tmux; - - # Set the required Home Manager options - home.username = "tylerbohrer"; - home.homeDirectory = "/Users/tylerbohrer"; - home.stateVersion = "23.11"; - - # Include all other settings from the original home.nix - imports = [ ./home-manager/home.nix ]; - }) - ]; - }; + + # Make the packages available in the flake + # This is what users will run to build/install homies + # nix build .#homies + # nix profile install .#homies }; } \ No newline at end of file diff --git a/home-manager/home.nix b/home-manager/home.nix deleted file mode 100644 index 985cdfe..0000000 --- a/home-manager/home.nix +++ /dev/null @@ -1,294 +0,0 @@ -{ pkgs, tmuxPackage ? null, ... }: - -let - # Define programming language support options with comprehensive configuration - supportedLanguages = { - # Default languages that are always included for basic functionality - odin = { - enable = true; - package = pkgs.odin; - languageServer = pkgs.ols; - lspName = "ols"; - description = "Odin programming language with OLS"; - }; - harper = { - enable = true; - package = pkgs.harper; - languageServer = pkgs.harper; - lspName = "harper"; - description = "Harper language with Harper Language Server"; - }; - - # Optional languages that can be conditionally enabled - rust = { - enable = false; - package = pkgs.rustc; - languageServer = pkgs.rust-analyzer; - lspName = "rust-analyzer"; - description = "Rust programming language with rust-analyzer"; - }; - python = { - enable = false; - package = pkgs.python3; - languageServer = pkgs.python3Packages.pyright; - lspName = "pyright"; - description = "Python programming language with Pyright"; - }; - javascript = { - enable = false; - package = pkgs.nodejs; - languageServer = pkgs.nodePackages.typescript-language-server; - lspName = "typescript-language-server"; - description = "JavaScript/TypeScript with TypeScript Language Server"; - }; - go = { - enable = false; - package = pkgs.go; - languageServer = pkgs.gopls; - lspName = "gopls"; - description = "Go programming language with gopls"; - }; - java = { - enable = false; - package = pkgs.openjdk; - languageServer = pkgs.jdt.ls; - lspName = "jdt.ls"; - description = "Java programming language with JDT Language Server"; - }; - }; - - # Helper function to get activated language packages - getActivatedLanguages = - builtins.filter (name: supportedLanguages.${name}.enable) (builtins.attrNames supportedLanguages); - - # Helper function to get all language packages for activation - getAllLanguagePackages = - (builtins.map (lang: supportedLanguages.${lang}.package) (getActivatedLanguages)) - ++ (builtins.map (lang: supportedLanguages.${lang}.languageServer) (getActivatedLanguages)); - - # Helper function to generate language server configuration sections - generateLanguageServerConfig = - (builtins.concatMap (lang: - if supportedLanguages.${lang}.enable then - [ - ''[[languages.${lang}]]'' - ''language-server = { name = "${supportedLanguages.${lang}.lspName}", command = "${supportedLanguages.${lang}.lspName}" }'' - ] - else - [] - ) (getActivatedLanguages)); - - # Get all activated language servers for PATH - getLanguageServerPaths = - (builtins.map (lang: "${supportedLanguages.${lang}.languageServer}/bin") (getActivatedLanguages)); - -in -{ - # Home Manager configuration for cross-platform use (WSL, Linux, Mac M1) - - # Enable Home Manager - programs.home-manager.enable = true; - - # Package configuration - these will work across all platforms - home.packages = with pkgs; [ - # Core tools - tmux - helix - zsh - git - openssh - - # Terminal applications - alacritty - starship - htop - - # Docker support - docker-client - docker-compose - - # Programming languages and language servers (default always included) - # These are the core tools that are always enabled - odin - ols # Odin Language Server - harper # Harper Language Server - - # Additional dev tools - gcc - gnumake - curl - wget - jq - ripgrep - findutils - ] ++ getAllLanguagePackages; - - # Zsh configuration - programs.zsh = { - enable = true; - syntaxHighlighting.enable = true; - oh-my-zsh = { - enable = true; - theme = "agnoster"; - }; - # Zshrc configuration - shellAliases = { - "ls" = "eza"; - "g" = "git"; - "docker" = "docker"; - "h" = "htop"; - }; - }; - - # Tmux configuration - base settings - programs.tmux = { - enable = true; - clock24 = true; - historyLimit = 10000; - mouse = true; - # Basic tmux configuration file - shell = "zsh"; - # Use the tmux package from jakehamilton/tmux - package = tmuxPackage; - }; - - # Git configuration - programs.git = { - enable = true; - userName = "Your Name"; - userEmail = "your.email@example.com"; - extraConfig = { - core.editor = "hx"; - push.default = "current"; - }; - }; - - # SSH configuration - programs.ssh = { - enable = true; - }; - - # Alacritty configuration - simple but functional - programs.alacritty = { - enable = true; - settings = { - font = { - normal.family = "JetBrainsMono Nerd Font"; - size = 12.0; - }; - colors = { - primary = { - background = "0x1e1e2e"; - foreground = "0xf8f8f2"; - }; - cursor = { - text = "0x1e1e2e"; - cursor = "0xf8f8f2"; - }; - normal = { - black = "0x1e1e2e"; - red = "0xf84a50"; - green = "0x7ab872"; - yellow = "0xf59850"; - blue = "0x5192db"; - magenta = "0xb775d9"; - cyan = "0x54cecd"; - white = "0xf8f8f2"; - }; - bright = { - black = "0x1e1e2e"; - red = "0xf84a50"; - green = "0x7ab872"; - yellow = "0xf59850"; - blue = "0x5192db"; - magenta = "0xb775d9"; - cyan = "0x54cecd"; - white = "0xf8f8f2"; - }; - }; - }; - }; - - # Starship configuration - modern prompt - programs.starship = { - enable = true; - settings = { - add_newline = false; - command_timeout = 1000; - format = "$all"; - right_format = "$time"; - time = { - format = "%T"; - disabled = false; - }; - }; - }; - - # Helix - main editor with language server support - programs.helix = { - enable = true; - }; - - # Create Helix config with language servers for all activated languages - home.file.".config/helix/config.toml".text = '' - # Helix Configuration with Language Servers - - [editor] - theme="peachpuff" - - [editor.file-picker] - hidden = true - - [editor] - line-number = "relative" - - [editor.cursor-shape] - insert = "bar" - normal = "block" - select = "underline" - - [editor.lsp] - enable = true - auto-start = true - - [language-server.harper-ls] - command = "harper-ls" - args = ["--stdio"] - - [language-server.harper-ls.config.harper-ls.linters] - SpellCheck = false - SentenceCapitalization = false - - [language-server.ols] - command = "ols" - args = [] - - [[language]] - name = "odin" - language-servers = ["ols", "harper-ls"] - - # Dynamically added language servers based on user selection - ${builtins.concatStringsSep "\n" (generateLanguageServerConfig)} - ''; - - # Environment variables - home.sessionVariables = { - EDITOR = "hx"; - VISUAL = "hx"; - }; - - # Ensure proper PATH for language servers - home.sessionPath = [ - "${pkgs.odin}/bin" - "${pkgs.ols}/bin" - "${pkgs.harper}/bin" - "${pkgs.docker-client}/bin" - ] ++ getLanguageServerPaths; - - # Create directory structure for configs - home.activation = { - createDirs = '' - mkdir -p $HOME/.config/helix - ''; - }; -}