From 88baae6581ebc71d96967ea6b1b17592d3ad1254 Mon Sep 17 00:00:00 2001 From: Poby Date: Wed, 4 Mar 2026 22:30:52 +0900 Subject: [PATCH] feat: some more home-manager programs --- flake.nix | 2 +- home/core.nix | 58 ---------------------------------------------- home/default.nix | 5 ++-- home/lazygit.nix | 7 ++++++ home/mise.nix | 18 ++++++++++++++ home/zsh.nix | 5 ++-- modules/apps.nix | 19 +++------------ modules/system.nix | 39 +------------------------------ 8 files changed, 35 insertions(+), 118 deletions(-) delete mode 100644 home/core.nix create mode 100644 home/lazygit.nix create mode 100644 home/mise.nix diff --git a/flake.nix b/flake.nix index 50e4403..3c01595 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ inputs.nixpkgs.follows = "nixpkgs-darwin"; }; darwin = { - url = "github:lnl7/nix-darwin/nix-darwin-${stableVersion}"; + url = "github:nix-darwin/nix-darwin/nix-darwin-${stableVersion}"; inputs.nixpkgs.follows = "nixpkgs-darwin"; }; diff --git a/home/core.nix b/home/core.nix deleted file mode 100644 index 460ac07..0000000 --- a/home/core.nix +++ /dev/null @@ -1,58 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - # archives - zip - xz - unzip - p7zip - (pkgs.writeShellApplication { - name = "ns"; - runtimeInputs = with pkgs; [ - fzf - nix-search-tv - ]; - text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh"; - }) - # utils - - aria2 # A lightweight multi-protocol & multi-source command-line download utility - socat # replacement of openbsd-netcat - nmap # A utility for network discovery and security auditing - - # misc - cowsay - file - which - tree - gnused - gnutar - gawk - zstd - caddy - gnupg - - # productivity - glow # markdown previewer in terminal - ]; - - programs = { - # terminal file manager - yazi = { - enable = true; - enableZshIntegration = true; - settings = { - manager = { - show_hidden = true; - sort_dir_first = true; - }; - }; - }; - - # skim provides a single executable: sk. - # Basically anywhere you would want to use grep, try sk instead. - skim = { - enable = true; - enableBashIntegration = true; - }; - }; -} diff --git a/home/default.nix b/home/default.nix index d2039f0..c01bc07 100755 --- a/home/default.nix +++ b/home/default.nix @@ -15,6 +15,8 @@ ./zsh.nix ./eza.nix ./jq.nix + ./lazygit.nix + ./mise.nix ]; home = { @@ -22,9 +24,8 @@ homeDirectory = "/Users/${username}"; stateVersion = "25.11"; + # packages that are not available via programs packages = with pkgs; [ - tree - yq-go # nix-search-tv (writeShellApplication { name = "ns"; diff --git a/home/lazygit.nix b/home/lazygit.nix new file mode 100644 index 0000000..c24f855 --- /dev/null +++ b/home/lazygit.nix @@ -0,0 +1,7 @@ +{ + programs.lazygit = { + enable = true; + enableZshIntegration = true; + enableBashIntegration = true; + }; +} diff --git a/home/mise.nix b/home/mise.nix new file mode 100644 index 0000000..c6e424f --- /dev/null +++ b/home/mise.nix @@ -0,0 +1,18 @@ +{ + progrmas.mise = { + enable = true; + enableZshIntegration = true; + enableBashIntegration = true; + + globalConfig = { + tools = { + node = "lts"; + uv = "latest"; + }; + settings = { + experimental = true; + env_file = ".env"; + }; + }; + }; +} diff --git a/home/zsh.nix b/home/zsh.nix index 40edcdb..99f0b7b 100755 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -13,9 +13,8 @@ shellAliases = { poby = "echo my name is poby"; - nrs = "sudo nixos-rebuild switch --flake ~/nixos#$(hostname)"; - nrt = "sudo nixos-rebuild test --flake ~/nixos#$(hostname)"; - hms = "home-manager switch -b backup --flake ~/nixos#$(whoami)"; + drs = "sudo darwin-rebuild switch --flake ~/nix-darwin#$(hostname)"; + drt = "sudo darwin-rebuild test --flake ~/nix-darwin#$(hostname)"; }; sessionVariables = { diff --git a/modules/apps.nix b/modules/apps.nix index 77b5802..1896353 100644 --- a/modules/apps.nix +++ b/modules/apps.nix @@ -5,6 +5,7 @@ git neovim just # use Justfile to simplify nix-darwin's commands + tree ]; environment.variables.EDITOR = "nvim"; @@ -26,15 +27,12 @@ taps = []; # WARNING only include those not in nixpkgs - brews = [ - # "neovim" - # "ripgrep" - # "fd" - ]; + brews = []; casks = [ "batfi" "hammerspoon" + # TODO use nixpkgs when possible # "google-chrome" # "iina" # "jordanbaird-ice" @@ -42,17 +40,6 @@ # "shottr" # "raycast" # "stats" - - # Fonts - "font-fontawesome" - "font-jetbrains-mono-nerd-font" - "font-meslo-lg-nerd-font" - "font-d2coding" - "font-fira-code-nerd-font" - "font-symbols-only-nerd-font" - "font-material-design-icons-webfont" - "font-pretendard" - "font-maple-mono-nf" ]; }; } diff --git a/modules/system.nix b/modules/system.nix index 2ce74b2..feed9c6 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -11,6 +11,7 @@ primaryUser = username; stateVersion = 6; + # symlink /Applications/Nix Apps to /Applications for Spotlight activationScripts.extraActivation.text = '' # activateSettings -u will reload the settings from the database and apply them to the current session, # so we do not need to logout and login again to make the changes take effect. @@ -177,52 +178,14 @@ # Add ability to used TouchID for sudo authentication security.pam.services.sudo_local.touchIdAuth = true; - # Create /etc/zshrc that loads the nix-darwin environment. - # this is required if you want to use darwin's default shell - zsh programs.zsh = { enable = true; - # enableCompletion = true; - # enableAutosuggestions = true; - # enableFastSyntaxHighlighting = true; - # enableFzfCompletion = true; - # enableFzfGit = true; - # enableFzfHistory = true; - # promptInit = '' - # source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme - # source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh - # ''; }; environment = { shells = [ pkgs.zsh ]; - # shellAliases = { - # ls = "lsd --color=auto"; - # l = "lsd -lhG"; - # lt = "l --tree"; - # ll = "lsd -alhG"; - # lh = "lsd -dl .*"; - # lsd = "lsd --group-directories-first"; - # filecount = "find . -type f | wc -l"; - # cat = "bat --color=always"; - # man = "tldr"; - # nixrebuild = "sudo darwin-rebuild switch --flake ~/.config/nix-darwin"; - # nixupgrade = "cd ~/.config/nix-darwin && nix flake update"; - # nixconfig = "nvim ~/.config/nix-darwin"; - # sshconfig = "nvim ~/.ssh/config"; - # - # # git - # g = "git"; - # gaa = "git add --all"; - # gcm = "git commit -m"; - # gca = "git commit --amend"; - # gst = "git status"; - # gco = "git checkout"; - # gl = "git pull"; - # gp = "git push"; - # glg = "git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"; - # }; }; fonts = {