diff --git a/demilich/home.nix b/demilich/home.nix new file mode 100644 index 0000000..f384576 --- /dev/null +++ b/demilich/home.nix @@ -0,0 +1,342 @@ +{ + email, + pkgs, + username, + stateVersion, + inputs, + config, + ... +}: +{ + imports = [ + inputs.noctalia.homeModules.default + ]; + nixpkgs = { + config = { + allowUnfree = true; + }; + }; + home = { + usrname = "${username}"; + homeDirectory = "/home/${username}"; + preferXdgDirectories = true; + stateVersion = stateVersion; + packages = with pkgs; [ + bitwarden-cli + bitwarden-desktop + duf + dust + sd + seafile-client + stow + tealdeer + xh + ]; + }; + editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = false; + max_line_width = 80; + indent_style = "space"; + indent_size = 4; + }; + }; + }; + programs = { + bat = { + enable = true; + extraPackages = with pkgs.bat-extras; [ + batdiff + batman + batgrep + batwatch + ]; + }; + delta = { + enable = true; + enableGitIntegration = true; + }; + direnv = { + enable = true; + enableZshIntegration = true; + }; + eza = { + enable = true; + enableZshIntegration = true; + colors = "auto"; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + git = true; + icons = "auto"; + }; + fd = { + enable = true; + }; + fuzzel = { + enable = true; + settings = { + terminal = "${pkgs.ghostty}/bin/ghostty"; + layer = "overlay"; + }; + }; + fzf = { + enable = true; + enableZshIntegration = true; + }; + ghostty = { + enable = true; + enableZshIntegration = true; + installBatSyntax = true; + installVimSyntax = true; + settings = { + font-family = "JetBrainsMono Nerd Font"; + font-size = 13; + theme = "sproutingdark"; + macos-option-as-alt = true; + shell-integration-features = "no-cursor"; + cursor-style = "block"; + background-opacity = 0.75; + }; + themes = { + sproutingdark = { + palette = [ + "0=#1f2620" + "1=#e04b7c" + "2=#9dbf9e" + "3=#ccca7a" + "4=#5586db" + "5=#dc51de" + "6=#7ef3ef" + "7=#d8e5d8" + "8=#3f4c3f" + "9=#e8789d" + "10=#b1ccb1" + "11=#fffd98" + "12=#99b6e9" + "13=#ea97eb" + "14=#b2f8f5" + "15=#f5f9f5" + ]; + background = "1f2620"; + foreground = "eaeaea"; + cursor-color = "fffd98"; + cursor-text = "3f4c3f"; + cursor-opacity = 0.7; + cursor-style = "block"; + selection-background = "3f4c3f"; + selection-foreground = "ffffea"; + background-opacity = 1; + window-padding-x = "2,2"; + window-padding-y = "2,2"; + window-padding-balance = true; + window-height = 25; + window-width = 80; + }; + }; + }; + git = { + enable = true; + lfs = { + enable = true; + }; + userName = "Matthew Stobbs"; + userEmail = "${email}"; + extraConfig = { + init.defaultBranch = "main"; + }; + delta = { + enable = true; + options = { + decorations = { + commit-decoration-style = "bold yellow box ul"; + file-decoration-style = "none"; + file-style = "bold yellow ul"; + }; + features = "decorations"; + whitespace-error-style = "22 reverse"; + }; + }; + }; + go = { + enable = true; + env = { + GOPRIVATE = [ "git.sprouting.cloud" ]; + }; + }; + gpg = { + enable = true; + }; + home-manager = { + enable = true; + }; + jq = { + enable = true; + }; + lazygit = { + enable = true; + enableZshIntegration = true; + }; + neovide = { + enable = true; + }; + noctalia = { + enable = true; + settings = "${config.xdg.configHome}/dotfiles/niri/.config/niri/full.kdl"; + }; + pandoc = { + enable = true; + }; + ripgrep = { + enable = true; + }; + starship = { + enable = true; + enableZshIntegration = true; + settings = { + palette = "sproutingdark"; + add_newline = true; + command_timeout = 2000; + format = lib.concatStrings [ + "\$username" + "[](fg:yellow)\$git_status\$git_branch\$directory" + "[](fg:yellow bg:green)" + "\$fill" + "\$c" + "\$golang" + "\$nodejs" + "\$rust" + "\$fill" + "[](fg:silver bg:green)\$time[](fg:silver)" + "\$character" + ]; + character = { + success_symbol = "[ ](bold lime)"; + error_symbol = "[ ](bold red)"; + }; + username = { + show_always = false; + style_user = "bg:fuchsia fg:black"; + style_root = "bg:fuchsia fg:black"; + format = "[](fg:fuchsia)[\$user ](\$style)[](fg:fuchsia)"; + disabled = false; + }; + fill = { + symbol = " "; + style = "bg:green"; + }; + directory = { + style = "bg:yellow fg:black"; + format = "[  \$path ](\$style)"; + truncation_length = 3; + truncation_symbol = "…/"; + substitutions = { + "~" = ""; + "Documents" = "󰈙"; + "Downloads" = ""; + "Music" = ""; + "Pictures" = ""; + }; + }; + time = { + disabled = false; + time_format = " %F  %T"; + style = "bg:silver fg:black"; + format = "[ \$time ](\$style)"; + }; + docker_context = { + symbol = " "; + style = "bg:fuchsia fg:black"; + format = "[ \$symbol \$context ](\$style)"; + }; + git_branch = { + symbol = ""; + style = "bg:yellow fg:black"; + format = "[ \$symbol \$branch ](\$style)"; + }; + git_status = { + style = "bg:yellow fg:black"; + format = "[\$all_status\$ahead_behind ](\$style)"; + }; + c = { + symbol = " "; + style = "bg:aqua fg:black"; + format = "[](fg:aqua bg:green)[\$symbol (\$version) ](\$style)[](fg:aqua bg:green)"; + }; + golang = { + symbol = " "; + style = "bg:aqua fg:black"; + format = "[](fg:aqua bg:green)[\$symbol (\$version) ](\$style)[](fg:aqua bg:green)"; + }; + nodejs = { + symbol = " "; + style = "bg:aqua fg:black"; + format = "[](fg:aqua bg:green)[\$symbol (\$version) ](\$style)[](fg:aqua bg:green)"; + }; + rust = { + symbol = " "; + style = "bg:aqua fg:black"; + format = "[](fg:aqua bg:green)[\$symbol (\$version) ](\$style)[](fg:aqua bg:green)"; + }; + palettes = { + sproutingdark = { + black = "#1f2620"; + grey = "#3f4c3f"; + maroon = "#e04b7c"; + red = "#e8789d"; + green = "#9bdf9e"; + lime = "#b1ccb1"; + olive = "#ccca7a"; + yellow = "#fffd98"; + navy = "#5586db"; + blue = "#99b6e9"; + purple = "#dc51de"; + fuchsia = "#ea97eb"; + teal = "#7ef3ef"; + aqua = "#b2f8f5"; + silver = "#d8e5d8"; + white = "#f5f9f5"; + }; + sproutinglight = { + black = "#3f4c3f"; + grey = "#7e997e"; + maroon = "#ad1849"; + red = "#d81e5b"; + green = "#7e997e"; + lime = "#9dbf9e"; + olive = "#99985b"; + yellow = "#ccca7a"; + navy = "#779ee2"; + blue = "#446baf"; + purple = "#843185"; + fuchsia = "#b041b2"; + teal = "#4c928f"; + aqua = "#65c2bf"; + silver = "#f5f9f5"; + white = "#d8e5d8"; + }; + }; + }; + }; + tmux = { + enable = true; + }; + uv = { + enable = true; + }; + yazi = { + enable = true; + enableZshIntegration = true; + }; + zoxide = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/demilich/packages.nix b/demilich/packages.nix index f47ca17..2d33501 100644 --- a/demilich/packages.nix +++ b/demilich/packages.nix @@ -1,5 +1,9 @@ -{ pkgs, ... }: - +{ inputs, pkgs, ... }: +let + extraPackages = [ + inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; +in { nixpkgs.overlays = [ (final: prev: { @@ -10,71 +14,47 @@ ]; documentation = { man = { - generateCaches = true; + cache.enable = true; }; }; # List packages installed in system profile. # You can use https://search.nixos.org/ to find more packages (and options). - environment.systemPackages = with pkgs; [ - # language servers useful on a system level - bash-language-server - dockerfile-language-server - lua-language-server - nginx-language-server - nixd - systemd-language-server - yaml-language-server + environment.systemPackages = + with pkgs; + [ + # language servers useful on a system level + bash-language-server + dockerfile-language-server + lua-language-server + nginx-language-server + nixd + systemd-language-server + yaml-language-server - # tool replacements - bat # instead of cat - delta # instead of diff - drill # instead of dig - duf # instead of df - dust # instead of du - eza # instead of ls - fd # instead of find - ripgrep # instead of grep - sd # instead of sed - tealdeer # instead of man/tldr - uv # to manage python stuff - xh # instead of curl - zoxide # instead of cd - - # system wide applications - bitwarden-cli - bitwarden-desktop - btop - curl - direnv - firefox - fuzzel - fzf - ghostscript_headless - ghostty - git - imagemagick - lazygit - mako - mermaid-cli - neovide - neohtop - nixfmt - restic - rsync - seafile-client - sqlite - starship - stow - swayidle - swaylock - tectonic - trash-cli - tree-sitter - wl-clipboard - xwayland-satellite - yazi - ]; + # system wide applications + btop + curl + direnv + firefox + ghostscript_headless + git + imagemagick + mako + mermaid-cli + nixfmt + restic + rsync + sqlite + swayidle + swaylock + tectonic + trash-cli + tree-sitter + wl-clipboard + xwayland-satellite + ] + ++ extraPackages; fonts.packages = with pkgs; [ nerd-fonts.caskaydia-cove diff --git a/demilich/services.nix b/demilich/services.nix index 3b0ec85..997414d 100644 --- a/demilich/services.nix +++ b/demilich/services.nix @@ -26,6 +26,15 @@ NetworkManager-wait-online = { enable = false; }; + power-profiles-daemon = { + enable = true; + }; + tuned = { + enable = true; + }; + upower = { + enable = true; + }; }; network = { diff --git a/flake.nix b/flake.nix index 49f8759..9e9342a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,17 +1,85 @@ { inputs = { - # This is pointing to an unstable release. - # If you prefer a stable release instead, you can change the word unstable to the latest number shown here: https://nixos.org/download - # i.e. nixos-24.11 - # Use `nix flake update` to update the flake to the latest revision of the chosen release channel. nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + noctalia = { + url = "github:noctalia-dev/noctalia"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = - inputs@{ self, nixpkgs, ... }: + inputs@{ + self, + nixpkgs, + home-manager, + noctalia, + ... + }: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + bitwarden-desktop = prev.bitwarden-desktop // { + electron_39 = final.electron_39-bin; + }; + }) + ]; + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + }; + stateVersion = "26.05"; + username = "stobbsm"; + laptop = "demilich"; + system = "x86_64-linux"; + email = "matthew@stobbs.ca"; + in { - # NOTE: 'nixos' is the default hostname - nixosConfigurations."demilich" = nixpkgs.lib.nixosSystem { - modules = [ ./demilich/configuration.nix ]; + nixosConfigurations = { + ${laptop} = nixpkgs.lib.nixosSystem { + specialArgs = + let + hostname = "${laptop}"; + in + { + inherit + inputs + self + username + system + stateVersion + email + hostname + ; + }; + modules = [ ./${hostname}/configuration.nix ]; + }; + }; + homeConfigurations = { + "${username}@${laptop}" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ ./${laptop}/home.nix ]; + extraSpecialArgs = + let + hostname = "${laptop}"; + in + { + inherit + self + inputs + username + hostname + system + stateVersion + email + ; + }; + }; }; }; }