Advertisement
Guest User

home.nix

a guest
Jan 17th, 2025
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. #home.nix
  2. { config, pkgs, ... }:
  3.  
  4. {
  5.  
  6. home.username = "ben";
  7. home.homeDirectory = "/Users/ben";
  8. home.stateVersion = "24.05";
  9.  
  10. home.packages = with pkgs; [
  11. ripgrep #
  12. zsh-autosuggestions
  13. zsh-autocomplete
  14. zsh-fast-syntax-highlighting
  15. lsof
  16. zoxide
  17. thefuck
  18. wget
  19. tealdeer
  20. trash-cli
  21. nixpkgs-fmt
  22. nixd
  23. ani-cli
  24. aria2
  25. fzf
  26. yt-dlp
  27. wget
  28. helix
  29. ];
  30.  
  31. home.file = {
  32. # ".config/path/to/file".text = ''{ text }'';
  33.  
  34. };
  35.  
  36. home.sessionVariables = {
  37. ZSH = "$HOME/.oh-my-zsh";
  38. PATH = let
  39. homebrewPaths = "/opt/homebrew/bin:/opt/homebrew/sbin";
  40. nixPaths = "/run/current-system/sw/bin:${pkgs.nix}/bin:/nix/var/nix/profiles/default/bin";
  41. customPaths = "${pkgs.bat}/bin;${pkgs.ripgrep}/bin;${pkgs.helix}/bin;${pkgs.trash-cli}/bin;${pkgs.qemu}/bin;${pkgs.coreutils}/bin:${pkgs.tealdeer}/bin:${pkgs.wget}/bin:${pkgs.ani-cli}/bin:${pkgs.zoxide}/bin:${pkgs.lsof}/bin:${pkgs.eza}/bin:${pkgs.fzf}/bin:${pkgs.thefuck}/bin";
  42. systemPaths = "/usr/local/bin:/usr/bin:/bin:/sbin";
  43. whalebrewPath = "/opt/whalebrew/bin";
  44. in
  45. "${homebrewPaths}:${customPaths}:${nixPaths}:${systemPaths}:${whalebrewPath}";
  46. HOMEBREW_CASK_OPTS = "--no-quarantine";
  47. WHALEBREW_INSTALL_PATH = "/opt/homebrew/bin";
  48. };
  49.  
  50.  
  51. programs.home-manager.enable = true;
  52.  
  53. programs.alacritty = {
  54. enable = true;
  55. settings = {
  56. font = {
  57. normal = {
  58. family = "JetBrainsMono Nerd Font";
  59. style = "Regular";
  60. };
  61. bold = {
  62. family = "JetBrainsMono Nerd Font";
  63. style = "Bold";
  64. };
  65. size = 12.0;
  66. };
  67. window = {
  68. padding = {
  69. x = 10;
  70. y = 10;
  71. };
  72. decorations = "full"; # Can be set to "full", "none", etc.
  73. opacity = 0.95;
  74. };
  75. };
  76. };
  77.  
  78. programs.eza = {
  79. enable = true;
  80. enableZshIntegration = true;
  81. icons = "auto";
  82. extraOptions = [
  83. "--header"
  84. "-1"
  85. "--no-filesize"
  86. "--no-user"
  87. "--long"
  88. "--classify=always"
  89. "--group-directories-first"
  90. ];
  91. };
  92.  
  93. programs.zsh = {
  94. enable = true;
  95. oh-my-zsh = {
  96. enable = true;
  97. theme = "robbyrussell";
  98. plugins = [
  99. "eza"
  100. "macos"
  101. "history"
  102. "history-substring-search"
  103. ];
  104. };
  105. shellAliases = {
  106. darwin-switch = "darwin-rebuild switch --flake ~/.config/nix-darwin#mini";
  107. darwin-upgrade = "nix upgrade-nix && darwin-rebuild switch --flake ~/.config/nix-darwin#mini";
  108. ls = "eza";
  109. };
  110. initExtra = ''
  111. eval "$(fzf --zsh)"
  112. eval "$(conda shell.zsh hook)"
  113. eval "$(thefuck --alias)"
  114. eval "$(/opt/homebrew/bin/brew shellenv)"
  115. if command -v ngrok &>/dev/null; then
  116. eval "$(ngrok completion)"
  117. fi
  118. '';
  119. };
  120.  
  121. programs.zoxide = {
  122. enable = true;
  123. enableZshIntegration = true;
  124. options = [
  125. "--cmd cd"
  126. ];
  127.  
  128. };
  129. programs.helix = {
  130. enable = true;
  131. languages.language = [
  132. {
  133. name = "nix";
  134. scope = "source.nix";
  135. injection-regex = "nix";
  136. file-types = [ "nix" ];
  137. comment-token = "#";
  138. auto-format = true;
  139. formatter = {
  140. command = "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt";
  141. };
  142. language-servers = [
  143. "nil"
  144. "nixd"
  145. ];
  146. indent = {
  147. tab-width = 2;
  148. unit = " ";
  149. };
  150. grammar = "nix";
  151. }
  152. ];
  153. settings = {
  154. theme = "onedarker";
  155. editor = {
  156. line-number = "relative";
  157. mouse = false;
  158. cursor-shape = {
  159. insert = "bar";
  160. normal = "block";
  161. select = "underline";
  162. };
  163. file-picker = {
  164. hidden = false;
  165. };
  166. };
  167. };
  168. };
  169. }
  170.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement