From b026e6daf8b83db2a31d73b3be90c1f69476f525 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 11:35:54 +0000 Subject: [PATCH 1/8] Add GitHub Actions for nix flake check Co-authored-by: hiroakiendoh --- .github/workflows/nix-checks.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/nix-checks.yml diff --git a/.github/workflows/nix-checks.yml b/.github/workflows/nix-checks.yml new file mode 100644 index 0000000..dbe1917 --- /dev/null +++ b/.github/workflows/nix-checks.yml @@ -0,0 +1,22 @@ +name: nix-checks + +on: + push: + pull_request: + +jobs: + flake-check: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v27 + with: + extra_nix_config: | + experimental-features = nix-command flakes + - name: Nix flake check + run: nix flake check From a8c66e2c39025ac7dcce418985090ea7a82ee520 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 11:37:03 +0000 Subject: [PATCH 2/8] Document CI flake checks Co-authored-by: hiroakiendoh --- README.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.org b/README.org index 2ec016f..71c1742 100644 --- a/README.org +++ b/README.org @@ -30,6 +30,9 @@ Keyword: macOS, Xcode, Homebrew, Emacs, Zsh ./scripts/devcontainer-check.sh #+end_src +** CI +- GitHub Actions runs =nix flake check= on Ubuntu and macOS for every push and PR. + ** Legacy (stow + dotnet-script) #+begin_src sh /bin/zsh -c "$(curl -fsSL https://raw.githubusercontent.com/hiroakit/xcclt/HEAD/xcclt.sh)" && git clone https://github.com/hiroakit/profile --recursive && cd profile && sh install.sh From 636bf3dd102255f497fd1e88b016fefbbe9bf804 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 11:42:01 +0000 Subject: [PATCH 3/8] Fix flake homeConfigurations attribute names Co-authored-by: hiroakiendoh --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 2365319..c8d0f9e 100644 --- a/flake.nix +++ b/flake.nix @@ -62,9 +62,9 @@ darwinConfigurations.${hostConfig.darwinHost} = mkDarwin hostConfig.darwinSystem; - homeConfigurations.${username}@${hostConfig.wslHost} = + homeConfigurations."${username}@${hostConfig.wslHost}" = mkHome hostConfig.wslSystem; - homeConfigurations.${devcontainerHost.username}@${devcontainerHost.wslHost} = + homeConfigurations."${devcontainerHost.username}@${devcontainerHost.wslHost}" = mkHomeWith { system = devcontainerHost.wslSystem; hostCfg = devcontainerHost; }; checks = lib.genAttrs From 75ea0ef6105b614256554f630e1633ff8fa5a0c5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 11:46:13 +0000 Subject: [PATCH 4/8] Use no-daemon Nix install on macOS Co-authored-by: hiroakiendoh --- .github/workflows/nix-checks.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nix-checks.yml b/.github/workflows/nix-checks.yml index dbe1917..291b782 100644 --- a/.github/workflows/nix-checks.yml +++ b/.github/workflows/nix-checks.yml @@ -13,7 +13,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install Nix + - name: Install Nix (macOS) + if: runner.os == 'macOS' + uses: cachix/install-nix-action@v27 + with: + install_options: --no-daemon + extra_nix_config: | + experimental-features = nix-command flakes + - name: Install Nix (Linux) + if: runner.os == 'Linux' uses: cachix/install-nix-action@v27 with: extra_nix_config: | From 96a11d2cd664aea30d56b7ff620aad0b63daf5fe Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 11:50:20 +0000 Subject: [PATCH 5/8] Handle macOS Nix install preexisting state Co-authored-by: hiroakiendoh --- .github/workflows/nix-checks.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nix-checks.yml b/.github/workflows/nix-checks.yml index 291b782..16e07bf 100644 --- a/.github/workflows/nix-checks.yml +++ b/.github/workflows/nix-checks.yml @@ -15,16 +15,18 @@ jobs: uses: actions/checkout@v4 - name: Install Nix (macOS) if: runner.os == 'macOS' - uses: cachix/install-nix-action@v27 - with: - install_options: --no-daemon - extra_nix_config: | - experimental-features = nix-command flakes + run: | + set -euo pipefail + if [ -x /nix/var/nix/profiles/default/bin/nix ]; then + echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" + exit 0 + fi + curl -fsSL https://install.determinate.systems/nix | sh -s -- install --no-confirm + echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" - name: Install Nix (Linux) if: runner.os == 'Linux' uses: cachix/install-nix-action@v27 - with: - extra_nix_config: | - experimental-features = nix-command flakes - name: Nix flake check + env: + NIX_CONFIG: experimental-features = nix-command flakes run: nix flake check From 540d39b03f7ef7517cbd92b648c2035c7bee410e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 11:53:59 +0000 Subject: [PATCH 6/8] Add GitHub token for Nix flake fetch Co-authored-by: hiroakiendoh --- .github/workflows/nix-checks.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nix-checks.yml b/.github/workflows/nix-checks.yml index 16e07bf..c566db1 100644 --- a/.github/workflows/nix-checks.yml +++ b/.github/workflows/nix-checks.yml @@ -28,5 +28,7 @@ jobs: uses: cachix/install-nix-action@v27 - name: Nix flake check env: - NIX_CONFIG: experimental-features = nix-command flakes - run: nix flake check + NIX_CONFIG: | + experimental-features = nix-command flakes + access-tokens = github.com=${{ github.token }} + run: nix flake check --accept-flake-config From 8bd2857a6d162df2ecf0841b14f3c63a98025b83 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 12:02:50 +0000 Subject: [PATCH 7/8] Set darwin home directory in home-manager Co-authored-by: hiroakiendoh --- flake.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index c8d0f9e..2193e8e 100644 --- a/flake.nix +++ b/flake.nix @@ -50,10 +50,14 @@ ./nix/darwin.nix home-manager.darwinModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { inherit inputs hostConfig; }; - home-manager.users.${username} = import ./nix/home.nix; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs hostConfig; }; + home-manager.users.${username} = { ... }: { + imports = [ ./nix/home.nix ]; + home.username = username; + home.homeDirectory = "/Users/${username}"; + }; } ]; }; From 69874f590869aa019809ea01ea2935f22dd9a77c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 26 Jan 2026 12:09:10 +0000 Subject: [PATCH 8/8] Set darwin user home path Co-authored-by: hiroakiendoh --- nix/darwin.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix/darwin.nix b/nix/darwin.nix index 6c40ee9..e255002 100644 --- a/nix/darwin.nix +++ b/nix/darwin.nix @@ -1,6 +1,7 @@ -{ config, pkgs, ... }: +{ config, pkgs, hostConfig, ... }: { system.stateVersion = 4; nix.settings.experimental-features = [ "nix-command" "flakes" ]; programs.zsh.enable = true; + users.users.${hostConfig.username}.home = "/Users/${hostConfig.username}"; }