From 006eaf33be876342c1adcf95dd2aa1afc1c11f15 Mon Sep 17 00:00:00 2001 From: Poby <87608318+smg1024@users.noreply.github.com> Date: Fri, 13 Mar 2026 23:50:30 +0900 Subject: [PATCH] fix: typo for config and temporarily disable dependencies --- .gitignore | 1 + flake.lock | 353 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 57 +++++-- home/aerospace.nix | 54 +++++-- home/default.nix | 19 +-- home/eza.nix | 2 +- home/mise.nix | 2 +- modules/host-users.nix | 3 +- modules/nix-core.nix | 10 +- modules/system.nix | 20 +-- 10 files changed, 471 insertions(+), 50 deletions(-) create mode 100644 flake.lock diff --git a/.gitignore b/.gitignore index e43b0f9..d5fec98 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1fc81ad --- /dev/null +++ b/flake.lock @@ -0,0 +1,353 @@ +{ + "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs-darwin" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1770165109, + "narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=", + "owner": "ryantm", + "repo": "agenix", + "rev": "b027ee29d959fda4b60b57566d64c98a202e0feb", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "brew-src": { + "flake": false, + "locked": { + "lastModified": 1769363988, + "narHash": "sha256-BiGPeulrDVetXP+tjxhMcGLUROZAtZIhU5m4MqawCfM=", + "owner": "Homebrew", + "repo": "brew", + "rev": "d01011cac6d72032c75fd2cd9489909e95d9faf2", + "type": "github" + }, + "original": { + "owner": "Homebrew", + "ref": "5.0.12", + "repo": "brew", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "darwin_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs-darwin" + ] + }, + "locked": { + "lastModified": 1772129556, + "narHash": "sha256-Utk0zd8STPsUJPyjabhzPc5BpPodLTXrwkpXBHYnpeg=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "ebec37af18215214173c98cf6356d0aca24a2585", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "nix-darwin-25.11", + "repo": "nix-darwin", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1751685974, + "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", + "ref": "refs/heads/main", + "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", + "revCount": 92, + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nvf", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs-darwin" + ] + }, + "locked": { + "lastModified": 1773264488, + "narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "homebrew-cask": { + "flake": false, + "locked": { + "lastModified": 1773410126, + "narHash": "sha256-3a9X78TmrHH9eNhj87TBL5HWQaAzD5z8/YcF/5Hpf+8=", + "owner": "homebrew", + "repo": "homebrew-cask", + "rev": "c94484c7d98b6442d80524eca84968bf8558075a", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-cask", + "type": "github" + } + }, + "homebrew-core": { + "flake": false, + "locked": { + "lastModified": 1773409445, + "narHash": "sha256-3/WrGHe9vdH98DXzD4ZYQkEEonKeCOKj0Bkq3WFKxbk=", + "owner": "homebrew", + "repo": "homebrew-core", + "rev": "7a2962491e67edec68819e691817349558618d31", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-core", + "type": "github" + } + }, + "mnw": { + "locked": { + "lastModified": 1770419553, + "narHash": "sha256-b1XqsH7AtVf2dXmq2iyRr2NC1yG7skY7Z6N2MpWHlK4=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "2aaffa8030d0b262176146adbb6b0e6374ce2957", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, + "ndg": { + "inputs": { + "nixpkgs": [ + "nvf", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768214250, + "narHash": "sha256-hnBZDQWUxJV3KbtvyGW5BKLO/fAwydrxm5WHCWMQTbw=", + "owner": "feel-co", + "repo": "ndg", + "rev": "a6bd3c1ce2668d096e4fdaaa03ad7f03ba1fbca8", + "type": "github" + }, + "original": { + "owner": "feel-co", + "ref": "refs/tags/v2.6.0", + "repo": "ndg", + "type": "github" + } + }, + "nix-homebrew": { + "inputs": { + "brew-src": "brew-src" + }, + "locked": { + "lastModified": 1769437432, + "narHash": "sha256-8d7KnCpT2LweRvSzZYEGd9IM3eFX+A78opcnDM0+ndk=", + "owner": "zhaofengli", + "repo": "nix-homebrew", + "rev": "a5409abd0d5013d79775d3419bcac10eacb9d8c5", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "nix-homebrew", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773231277, + "narHash": "sha256-Xy3WEpUAbpsz8ydgvVAQAGGB/WB+8cNA5cshiL0McTI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "75690239f08f885ca9b0267580101f60d10fbe62", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs-darwin": { + "locked": { + "lastModified": 1773282714, + "narHash": "sha256-at2PNNVNoTfXBe3bA6pgff+CKOwdBWUZCUBIfXGrXsU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a8556879c286b4a40a717a416ae61818c26d1ac8", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-25.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nvf": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "mnw": "mnw", + "ndg": "ndg", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1773343795, + "narHash": "sha256-0+HEuOytpwyPt7i1jj6v2QJ+NXXisCYnL2XNwPBltvg=", + "owner": "notashelf", + "repo": "nvf", + "rev": "83b44eaf50b96bd5d06b1a56a3a51f1b2362db52", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "nvf", + "type": "github" + } + }, + "root": { + "inputs": { + "agenix": "agenix", + "darwin": "darwin_2", + "home-manager": "home-manager_2", + "homebrew-cask": "homebrew-cask", + "homebrew-core": "homebrew-core", + "nix-homebrew": "nix-homebrew", + "nixpkgs": "nixpkgs", + "nixpkgs-darwin": "nixpkgs-darwin", + "nvf": "nvf" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index e07504f..1b48fa4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,29 +1,41 @@ { description = "Nix for Poby's MacOS"; - nixConfig = { - substituters = [ - "https://nix-community.cachix.org" - "https://cache.nixos.org" - ]; - }; + # TODO: is this necessary? + # nixConfig = { + # substituters = [ + # "https://nix-community.cachix.org" + # "https://cache.nixos.org" + # ]; + # }; - inputs = let - stableVersion = "25.11"; # FIXME to bump to latest stable version - in { + inputs = { # nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # comment out for unstable version - nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-${stableVersion}-darwin"; + nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-25.11-darwin"; home-manager = { - url = "github:nix-community/home-manager/release-${stableVersion}"; + url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs-darwin"; }; darwin = { - url = "github:nix-darwin/nix-darwin/nix-darwin-${stableVersion}"; + url = "github:nix-darwin/nix-darwin/nix-darwin-25.11"; inputs.nixpkgs.follows = "nixpkgs-darwin"; }; + # Homebrew + nix-homebrew.url = "github:zhaofengli/nix-homebrew"; + + # Optional: Declarative tap management + homebrew-core = { + url = "github:homebrew/homebrew-core"; + flake = false; + }; + homebrew-cask = { + url = "github:homebrew/homebrew-cask"; + flake = false; + }; + # NVF for neovim nvf = { url = "github:notashelf/nvf"; @@ -34,7 +46,7 @@ agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs-darwin"; - } + }; }; outputs = inputs @ { @@ -44,6 +56,9 @@ home-manager, nvf, agenix, + nix-homebrew, + homebrew-core, + homebrew-cask, ... }: let system = "aarch64-darwin"; @@ -64,6 +79,22 @@ ./modules/system.nix ./modules/apps.nix ./modules/host-users.nix + nix-homebrew.darwinModules.nix-homebrew + { + nix-homebrew = { + enable = true; + enableRosetta = true; + user = username; + taps = { + "homebrew/homebrew-core" = homebrew-core; + "homebrew/homebrew-cask" = homebrew-cask; + }; + mutableTaps = false; + }; + } + ({config, ...}: { + homebrew.taps = builtins.attrNames config.nix-homebrew.taps; + }) agenix.darwinModules.default home-manager.darwinModules.home-manager { diff --git a/home/aerospace.nix b/home/aerospace.nix index d0e69a9..f97b5ba 100644 --- a/home/aerospace.nix +++ b/home/aerospace.nix @@ -6,9 +6,19 @@ accordion-padding = 10; default-root-container-layout = "tiles"; default-root-container-orientation = "auto"; - on-focus-monitor-changed = ["move-mouse monitor-lazy-center"]; + on-focus-monitor-changed = [ "move-mouse monitor-lazy-center" ]; automatically-unhide-macos-hidden-apps = false; - persistent-workspaces = ["1" "2" "3" "4" "5" "6" "7" "8" "9"]; + persistent-workspaces = [ + "1" + "2" + "3" + "4" + "5" + "6" + "7" + "8" + "9" + ]; keymapping = { preset = "qwerty"; @@ -67,15 +77,39 @@ }; mode.service.binding = { - esc = ["reload-config" "mode main"]; - r = ["flatten-workspace-tree" "mode main"]; - f = ["layout floating tiling" "mode main"]; - backspace = ["close-all-windows-but-current" "mode main"]; + esc = [ + "reload-config" + "mode main" + ]; + r = [ + "flatten-workspace-tree" + "mode main" + ]; + f = [ + "layout floating tiling" + "mode main" + ]; + backspace = [ + "close-all-windows-but-current" + "mode main" + ]; - alt-shift-h = ["join-with left" "mode main"]; - alt-shift-j = ["join-with down" "mode main"]; - alt-shift-k = ["join-with up" "mode main"]; - alt-shift-l = ["join-with right" "mode main"]; + alt-shift-h = [ + "join-with left" + "mode main" + ]; + alt-shift-j = [ + "join-with down" + "mode main" + ]; + alt-shift-k = [ + "join-with up" + "mode main" + ]; + alt-shift-l = [ + "join-with right" + "mode main" + ]; }; }; }; diff --git a/home/default.nix b/home/default.nix index 4e11147..c22be8f 100755 --- a/home/default.nix +++ b/home/default.nix @@ -17,7 +17,7 @@ ./jq.nix ./lazygit.nix ./mise.nix - ./ghostty.nix + # ./ghostty.nix # FIXME: ghostty home-manager program not available in aarch64-darwin ./bat.nix ./aerospace.nix # TODO ./pass.nix @@ -31,14 +31,15 @@ # packages that are not available via programs packages = with pkgs; [ # nix-search-tv - (writeShellApplication { - name = "ns"; - runtimeInputs = with pkgs; [ - fzf - nix-search-tv - ]; - text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh"; - }) + # FIXME: NIX_SHELL_CMD='nix-shell --run $SHELL -p $(echo "{}" | sed "s:nixpkgs/::g"' ^-- SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. + # (writeShellApplication { + # name = "ns"; + # runtimeInputs = with pkgs; [ + # fzf + # nix-search-tv + # ]; + # text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh"; + # }) ]; }; diff --git a/home/eza.nix b/home/eza.nix index 02ca600..348e54a 100644 --- a/home/eza.nix +++ b/home/eza.nix @@ -1,7 +1,7 @@ { programs.eza = { enable = true; - color = "auto"; + colors = "auto"; git = true; icons = "auto"; enableZshIntegration = true; diff --git a/home/mise.nix b/home/mise.nix index c6e424f..8e9456f 100644 --- a/home/mise.nix +++ b/home/mise.nix @@ -1,5 +1,5 @@ { - progrmas.mise = { + programs.mise = { enable = true; enableZshIntegration = true; enableBashIntegration = true; diff --git a/modules/host-users.nix b/modules/host-users.nix index 5d258d6..9df535e 100644 --- a/modules/host-users.nix +++ b/modules/host-users.nix @@ -7,10 +7,9 @@ hostName = hostname; computerName = hostname; localHostName = hostname; - } + }; users.users."${username}" = { - description = "Sangmin Kim"; home = "/Users/${username}"; description = username; }; diff --git a/modules/nix-core.nix b/modules/nix-core.nix index d85af49..ed71a0d 100644 --- a/modules/nix-core.nix +++ b/modules/nix-core.nix @@ -13,13 +13,13 @@ trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; - builders-user-substitutes = true; + builders-use-substitutes = true; auto-optimise-store = false; # issue https://github.com/NixOS/nix/issues/7273 }; - }; - gc = { - automatic = lib.mkDefault true; - options = lib.mkDefault "--delete-older-than 7d"; + gc = { + automatic = lib.mkDefault true; + options = lib.mkDefault "--delete-older-than 7d"; + }; }; } diff --git a/modules/system.nix b/modules/system.nix index feed9c6..98b5a83 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -4,7 +4,8 @@ username, hostname, ... -}: { +}: +{ time.timeZone = "Asia/Seoul"; system = { @@ -18,13 +19,14 @@ sudo -u ${username} /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u ''; - activationScripts.applications.text = let - env = pkgs.buildEnv { - name = "system-applications"; - paths = config.environment.systemPackages; - pathsToLink = "/Applications"; - }; - in + activationScripts.applications.text = + let + env = pkgs.buildEnv { + name = "system-applications"; + paths = config.environment.systemPackages; + pathsToLink = [ "/Applications" ]; + }; + in pkgs.lib.mkForce '' # Set up applications. echo "setting up /Applications..." >&2 @@ -97,7 +99,7 @@ TrackpadFourFingerHorizSwipeGesture = 2; # swipe between full-screen applications TrackpadFourFingerVertSwipeGesture = 2; # down for Mission Control, up for App Expose TrackpadPinch = true; - TrackpadThreeFingerHorizSwipGesture = 0; # disable for three finger drag + TrackpadThreeFingerHorizSwipeGesture = 0; # disable for three finger drag TrackpadThreeFingerVertSwipeGesture = 0; # disable for three finger drag TrackpadTwoFingerDoubleTapGesture = true; # smart zoom TrackpadTwoFingerFromRightEdgeSwipeGesture = 0;