-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add multi-platform support for macOS, Linux, and WSL2 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add multi-platform support for macOS, Linux, and WSL2 #7
Conversation
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThe project transitions from a macOS-centric (Darwin-only) configuration to a unified, multi-platform Nix-based setup supporting macOS, NixOS, non-NixOS Linux, and Windows/WSL2. The monolithic Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @ta93abe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly broadens the scope of the Nix flake configuration by introducing robust multi-platform support. The core changes involve a comprehensive restructuring of the configuration, breaking down platform-specific settings into modular components, and introducing a set of helper functions to simplify the definition of macOS, NixOS, and standalone Linux/WSL2 environments. This enhancement makes the configuration more adaptable and maintainable across diverse operating systems, moving towards a unified declarative approach for all personal computing environments. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This is an excellent refactoring that significantly improves the structure and maintainability of the Nix configuration by adding multi-platform support for macOS, Linux, and WSL2. The introduction of helper functions in the lib directory and the modularization of configurations into modules and machines are great design choices.
I've added a couple of suggestions to improve the robustness of the helper scripts and ensure all dependencies are correctly managed for standalone Home Manager configurations on Linux. Overall, this is a very solid pull request.
| { | ||
| imports = [ | ||
| # Package list | ||
| ./packages.nix | ||
|
|
||
| # Program configurations | ||
| ./programs/git.nix | ||
| ./programs/fish.nix | ||
| ./programs/starship.nix | ||
| ./programs/helix.nix | ||
| ./programs/fzf.nix | ||
| ./programs/zoxide.nix | ||
| ./programs/mcfly.nix | ||
| ./programs/claude.nix | ||
|
|
||
| # XDG configurations (Ghostty, Zellij) | ||
| ./xdg.nix | ||
| ]; | ||
|
|
||
| # Home Manager needs a bit of information about you and the paths it should manage | ||
| home = { | ||
| username = personal.username; | ||
| inherit homeDirectory; | ||
|
|
||
| # This value determines the Home Manager release that your configuration is compatible with | ||
| stateVersion = "24.11"; | ||
|
|
||
| # Environment variables | ||
| sessionVariables = { | ||
| EDITOR = "hx"; | ||
| }; | ||
| }; | ||
|
|
||
| # Let Home Manager install and manage itself | ||
| programs.home-manager.enable = true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your configurations for fzf and zellij (via xdg.nix) correctly use a platform-specific copyCommand. On Linux, this relies on xclip or wl-clipboard. While these are included in the systemPackages for NixOS, they are missing for standalone Home Manager setups (e.g., on non-NixOS Linux or WSL2).
To make your Home Manager configuration self-contained and ensure it works correctly across all supported platforms, I recommend conditionally adding xclip and wl-clipboard to home.packages for Linux systems directly within this main Home Manager module.
{
imports = [
# Package list
./packages.nix
# Program configurations
./programs/git.nix
./programs/fish.nix
./programs/starship.nix
./programs/helix.nix
./programs/fzf.nix
./programs/zoxide.nix
./programs/mcfly.nix
./programs/claude.nix
# XDG configurations (Ghostty, Zellij)
./xdg.nix
];
# Ensure clipboard tools are available on Linux for fzf, zellij, etc.
home.packages = lib.mkIf isLinux [ pkgs.xclip pkgs.wl-clipboard ];
# Home Manager needs a bit of information about you and the paths it should manage
home = {
username = personal.username;
inherit homeDirectory;
# This value determines the Home Manager release that your configuration is compatible with
stateVersion = "24.11";
# Environment variables
sessionVariables = {
EDITOR = "hx";
};
};
# Let Home Manager install and manage itself
programs.home-manager.enable = true;
}
| set -e | ||
| echo "Building configuration..." | ||
| # Try to build any available configuration | ||
| if nix build .#nixosConfigurations.${personal.hostname}.config.system.build.toplevel 2>/dev/null; then | ||
| echo "NixOS build successful!" | ||
| elif nix build .#homeConfigurations.${personal.username}@${personal.hostname}.activationPackage 2>/dev/null; then | ||
| echo "Home Manager build successful!" | ||
| else | ||
| echo "No matching configuration found for this hostname" | ||
| exit 1 | ||
| fi | ||
| '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation of the build app for non-Darwin systems attempts to automatically find and build a configuration. This approach has a couple of drawbacks:
- It uses
2>/dev/nullto suppress errors, which can hide legitimate build failures (like syntax errors in your Nix code), making debugging difficult. - The "magic" of auto-detection can be confusing. A more explicit approach is often clearer and more robust.
I suggest replacing this logic with a clear error message that instructs the user on how to build their specific configuration, similar to how the switch app is handled for non-Darwin systems.
set -e
echo "Error: 'build' app is not supported for non-Darwin systems. Please build explicitly." >&2
echo " For NixOS: nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel" >&2
echo " For Home Manager: nix build .#homeConfigurations.<user@hostname>.activationPackage" >&2
exit 1
''
PR レビュー: マルチプラットフォーム対応このPRはmacOS専用の設定をmacOS、Linux、WSL2の3プラットフォームに対応させる大規模なリファクタリングです。全体的に非常によく設計されており、コードの品質も高いです。 👍 良い点1. 優れたモジュール設計
2. プラットフォーム検出が適切
3. ヘルパー関数の抽象化
4. テンプレートファイルの提供
|
🔍 改善提案1. Wayland環境変数のチェック方法(優先度: 中)問題箇所: home/programs/fzf.nix:697, home/xdg.nix:727 懸念点:
推奨される修正案(実行時スクリプトで判定): 2. NixOS設定のロケールがハードコードされている(優先度: 低)問題箇所: modules/nixos/default.nix:21-35 推奨される修正:
3. nixpkgs URLの変更影響(優先度: 高 - 確認事項)変更箇所: flake.nix:342 確認事項:
|
🔒 セキュリティ特に懸念はありませんが、以下の点に注意:
📊 テストカバレッジ現時点ではmacOSのみの実装なので、以下のテストが必要です:
推奨: CI/CD パイプラインに複数プラットフォームのビルドテストを追加することをお勧めします。 🎯 結論このPRは非常によく設計されており、将来の拡張性を考慮した優れたリファクタリングです。上記の改善提案は主にエッジケースと堅牢性の向上に関するもので、コアの実装は十分に高品質です。 承認条件:
これらが確認できれば、自信を持ってマージできます。 |
e3478a9 to
a215644
Compare
PR #7 レビュー: マルチプラットフォーム対応概要このPRはdotfilesをmacOS専用からマルチプラットフォーム(macOS、Linux、WSL2)対応に拡張する大規模なリファクタリングです。全体的に非常によく設計されており、モジュール化と拡張性を高める優れた変更です。 良い点 ✅1. 優れたアーキテクチャ設計
2. 宣言的で拡張可能
3. プラットフォーム検出の実装
4. コードの保守性向上
改善提案 🔧1. セキュリティ: クリップボードコマンドの実行リスク
|
PR #7 レビュー: マルチプラットフォーム対応概要macOS専用のdotfilesを、Linux(NixOS/非NixOS)、WSL2まで対応させる大規模なリファクタリングです。全体的に非常に良い設計で、モジュール化とプラットフォーム抽象化が適切に実装されています。 ✅ 良い点1. アーキテクチャ設計
2. コード品質
3. プラットフォーム対応
|
a215644 to
c0726dc
Compare
コードレビュー: マルチプラットフォーム対応全体として非常によく設計されたリファクタリングです。macOS専用の構成からマルチプラットフォーム対応への移行が適切に行われています。以下、詳細なフィードバックをお伝えします。 ✅ 良い点1. アーキテクチャ設計
2. プラットフォーム検出isDarwin = pkgs.stdenv.isDarwin;
isLinux = pkgs.stdenv.isLinux;
3. ドキュメント
4. nixpkgs URL の変更# Before: nixpkgs-24.11-darwin
# After: nixos-24.11
🔧 改善提案1.
|
| 項目 | 評価 | 備考 |
|---|---|---|
| モジュール化 | ⭐⭐⭐⭐⭐ | 優れた設計 |
| 可読性 | ⭐⭐⭐⭐⭐ | コメントが適切 |
| 保守性 | ⭐⭐⭐⭐ | テンプレートの扱いに改善余地 |
| 移植性 | ⭐⭐⭐⭐ | 実機テストが必要 |
| セキュリティ | ⭐⭐⭐⭐ | 大きな問題なし |
🎯 優先度付き TODO
高優先度
-
flake.nixのappsセクションで Linux 環境でのpersonal.hostname参照を修正 - クリップボードコマンドの実行時判定を実装
中優先度
- NixOS 設定の実機テスト
- テンプレートファイルの assertion を実用的に修正
低優先度
- Windows setup.ps1 の管理者権限チェックを厳格化
- CI/CD での multi-platform ビルドテスト追加
🎉 総評
素晴らしいリファクタリングです!特に以下の点が評価できます:
- 段階的な移行: macOS の既存設定を壊さずに、Linux/WSL2 対応を追加
- ドキュメント充実: セットアップガイドが各プラットフォームで明確
- Nix-First 哲学の維持: Homebrew を GUI アプリのみに制限する方針が一貫
上記の改善提案を反映すれば、さらに堅牢な構成になると思います。特に flake.nix の apps セクションのバグは早めに修正することをお勧めします。
Great work! 🚀
…n build Address review feedback from gemini-code-assist: - Remove 2>/dev/null that hides legitimate build errors - Show explicit instructions for NixOS and Home Manager builds
c0726dc to
7d67550
Compare
PR レビュー: マルチプラットフォーム対応全体的に非常によく設計されたリファクタリングです。モノリシックな設定ファイルをモジュール化し、複数プラットフォームに対応する構造に変更されています。 ✅ 良い点1. 優れたアーキテクチャ設計
2. 適切なプラットフォーム検出
3. 包括的なドキュメント
🔍 改善提案1. nixpkgs URL変更の影響 (flake.nix:5)- nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.11-darwin";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";潜在的な問題:
推奨事項: # 明示的にDarwin用とNixOS用を分ける方が安全
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.11-darwin";
nixpkgs-nixos.url = "github:NixOS/nixpkgs/nixos-24.11";2. 環境変数によるクリップボード検出の脆弱性 (home/programs/fzf.nix:8, home/xdg.nix:9)else if builtins.getEnv "WAYLAND_DISPLAY" != "" then "wl-copy"問題点:
推奨修正: # ランタイムで切り替えるラッパースクリプトを使用
copyCommand = pkgs.writeShellScript "clipboard-copy" ''
if [ -n "$WAYLAND_DISPLAY" ]; then
wl-copy "$@"
else
xclip -selection clipboard "$@"
fi
'';3. NixOS設定のハードコーディング (modules/nixos/default.nix:21, 25-35)time.timeZone = "Asia/Tokyo";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "ja_JP.UTF-8";
# ...
};問題点:
推奨修正: # personal.nixに追加
{
timezone = "Asia/Tokyo";
locale = "en_US.UTF-8";
}
# modules/nixos/default.nixで使用
time.timeZone = personal.timezone or "UTC";
i18n.defaultLocale = personal.locale or "en_US.UTF-8";4. flake.nix の apps 定義の型安全性 (flake.nix:905-942)apps = lib.forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
isDarwin = pkgs.stdenv.isDarwin;潜在的な問題:
推奨修正: # personal が定義されているかチェック
program = toString (pkgs.writeShellScript "build" (
if isDarwin && personal ? hostname then ''
# Darwin build logic
'' else ''
echo "Error: 'build' app is not supported..." >&25. Windows setup.ps1 のエラーハンドリング (windows/setup.ps1:14-16)if (-not $isAdmin) {
Write-Host "Warning: Some packages may require Administrator privileges." -ForegroundColor Yellow
}問題点:
推奨修正: if (-not $isAdmin) {
Write-Host "Error: This script must be run as Administrator." -ForegroundColor Red
Write-Host "Please right-click and select 'Run as Administrator'." -ForegroundColor Yellow
exit 1
}6. パッケージの重複 (modules/darwin/default.nix:23-54, modules/nixos/default.nix:49-65)
推奨事項:
🔒 セキュリティに関する考慮事項1. NixOS ユーザーのsudoアクセス (modules/nixos/default.nix:41)extraGroups = [ "networkmanager" "wheel" "docker" ];
2. personal.nix の取り扱い
📊 テストカバレッジテストが推奨される項目:
推奨アクション:
🎯 パフォーマンスに関する考慮事項forAllSystems の使用 (lib/default.nix:14)forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems f;
📝 その他の細かい点
総評Score: 9/10 非常に質の高いリファクタリングで、以下の点が特に優れています:
主な改善点:
マージ判断: Great work! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Introduces a modular, multi-platform dotfiles setup to support macOS (nix-darwin), NixOS, standalone Home Manager on Linux/WSL2, and Windows (winget).
Changes:
- Restructures configuration into
modules/{common,darwin,nixos},machines/{darwin,nixos,linux}, and adds system builder helpers inlib/. - Modularizes the Home Manager entry point and adds platform-specific behaviors (home directory, clipboard integration).
- Adds Windows bootstrap scripts (
winget) and updates top-level documentation for multi-platform setup.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| windows/setup.ps1 | Adds a winget-based Windows setup script to import a declarative package list. |
| windows/packages.json | Declares Windows packages to install via winget import. |
| windows/README.md | Documents Windows + WSL2 setup flow. |
| modules/nixos/default.nix | Adds a baseline NixOS module with common settings, packages, users, and fonts. |
| modules/darwin/system.nix | Extracts macOS system defaults and security settings into a dedicated module. |
| modules/darwin/homebrew.nix | Extracts Homebrew (casks/taps) configuration into a dedicated module. |
| modules/darwin/default.nix | New macOS entry module composing common nix + system + homebrew modules. |
| modules/common/nix.nix | Introduces shared Nix settings (flakes, GC, store optimization). |
| machines/nixos/example.nix | Provides a template NixOS machine configuration scaffold. |
| machines/linux/example.nix | Provides a template standalone Home Manager machine configuration scaffold. |
| machines/darwin/000355-M.nix | Adds a placeholder macOS machine-specific module. |
| lib/mkSystem.nix | Removes legacy (unused) mkSystem helper. |
| lib/mkNixosSystem.nix | Adds a helper to build NixOS systems with Home Manager integration. |
| lib/mkHomeConfig.nix | Adds a helper to build standalone Home Manager configurations. |
| lib/mkDarwinSystem.nix | Adds a helper to build nix-darwin systems with Home Manager integration. |
| lib/default.nix | Adds shared lib utilities (supported systems, overlays, system builders). |
| home/xdg.nix | Adds platform-aware clipboard command injection into terminal configs. |
| home/programs/fzf.nix | Adds platform-aware clipboard binding for fzf. |
| home/packages.nix | Splits packages into common + darwin + linux sets and conditionally includes them. |
| home/default.nix | Adds new Home Manager entry point with platform-aware homeDirectory. |
| home.nix | Removes old Home Manager entry point (replaced by home/default.nix). |
| flake.nix | Switches to nixos-24.11 nixpkgs, adopts new lib helpers, and expands structure for multi-platform outputs. |
| darwin-configuration.nix | Removes monolithic macOS config (replaced by modules/darwin/*). |
| README.md | Updates documentation for multi-platform usage, setup flows, and new project structure. |
Comments suppressed due to low confidence (1)
flake.nix:21
- The
darwinandhome-managerflake inputs reference third-party GitHub repositories (LnL7/nix-darwinandnix-community/home-manager) only by branch/tag name without an accompanying immutable pin (e.g., viaflake.lockor a commit SHA), which creates a supply-chain risk. If either upstream repo is compromised or a malicious update is pushed to those branches, runningnix run .#switchor related commands would fetch and execute untrusted code with your local user (and often root) privileges. To harden this, ensure these inputs are pinned via a committedflake.lockor switch the URLs to immutable identifiers (specific commit hashes or content-addressed references) so that updates are explicit and reviewable.
# nix-darwin for macOS
darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Platform-specific clipboard command | ||
| copyCommand = if isDarwin then "pbcopy" | ||
| else if builtins.getEnv "WAYLAND_DISPLAY" != "" then "wl-copy" | ||
| else "xclip -selection clipboard"; |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using builtins.getEnv("WAYLAND_DISPLAY") to choose between wl-copy and xclip is evaluated at Nix evaluation time (flakes default to pure evaluation), so this will typically always be "" and select xclip even on Wayland. Prefer runtime detection (e.g., a small wrapper script that checks $WAYLAND_DISPLAY) or a Home Manager/NixOS option-based switch rather than builtins.getEnv here.
| # Platform-specific clipboard command | |
| copyCommand = if isDarwin then "pbcopy" | |
| else if builtins.getEnv "WAYLAND_DISPLAY" != "" then "wl-copy" | |
| else "xclip -selection clipboard"; | |
| # Runtime-detected clipboard command for non-Darwin platforms | |
| copyScript = pkgs.writeShellScriptBin "fzf-copy" '' | |
| if [ -n "$WAYLAND_DISPLAY" ] && command -v wl-copy >/dev/null 2>&1; then | |
| exec wl-copy "$@" | |
| elif command -v xclip >/dev/null 2>&1; then | |
| exec xclip -selection clipboard "$@" | |
| else | |
| echo "No clipboard utility found (need wl-copy or xclip)" >&2 | |
| exit 1 | |
| fi | |
| ''; | |
| # Platform-specific clipboard command | |
| copyCommand = if isDarwin then "pbcopy" | |
| else "${copyScript}/bin/fzf-copy"; |
| { system, personal, overlays ? [] }: | ||
|
|
||
| home-manager.lib.homeManagerConfiguration { |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkHomeConfig doesn’t allow callers to pass extra Home Manager modules (no modules ? [] parameter), which makes it hard to extend per-machine/per-host without editing this helper. Consider adding an optional modules argument and appending it to the modules list.
| users.users.${personal.username} = { | ||
| isNormalUser = true; | ||
| description = personal.name; | ||
| extraGroups = [ "networkmanager" "wheel" "docker" ]; |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
users.users..extraGroups includes "docker", but this module never enables Docker (virtualisation.docker.enable) or defines the docker group. On NixOS this commonly causes evaluation/activation failures due to a missing group. Either enable Docker here or remove "docker" from extraGroups and let machine-specific configs add it when needed.
| extraGroups = [ "networkmanager" "wheel" "docker" ]; | |
| extraGroups = [ "networkmanager" "wheel" ]; |
| "homebrew/cask-versions" | ||
| ]; | ||
|
|
||
| # Note: CLI tools are managed via Nix packages in home.nix |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment still references "home.nix", but the Home Manager entry point is now the ./home directory (home/default.nix). Please update this comment to avoid confusion.
| # Note: CLI tools are managed via Nix packages in home.nix | |
| # Note: CLI tools are managed via Nix packages in the Home Manager configuration (./home, e.g. home/default.nix) |
| # Ubuntu(デフォルト)が起動したら、Nixをインストール | ||
| curl -L https://nixos.org/nix/install | sh |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WSL2 section installs Nix via curl -L https://nixos.org/nix/install | sh, while the main README recommends Determinate Systems. Consider aligning on one installer (or explicitly documenting why they differ) to avoid inconsistent setup guidance.
| # Ubuntu(デフォルト)が起動したら、Nixをインストール | |
| curl -L https://nixos.org/nix/install | sh | |
| # Ubuntu(デフォルト)が起動したら、Nixをインストール(Determinate Systems インストーラーを使用) | |
| curl -L https://install.determinate.systems/nix | sh |
| # 詳細なエラー表示 | ||
| nix run .#build 2>&1 | less | ||
|
|
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix run .#build is documented here as a generic way to inspect build errors, but flake.nix intentionally errors on non-Darwin systems for the build app. Please qualify this as macOS-only or update the instructions to use the explicit nix build .#nixosConfigurations... / nix build .#homeConfigurations... commands for Linux.
| # 詳細なエラー表示 | |
| nix run .#build 2>&1 | less | |
| # macOS (nix-darwin) の場合: 詳細なエラー表示 | |
| nix run .#build 2>&1 | less | |
| # NixOS の場合: システム構成をビルド | |
| nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel --show-trace | |
| # 非NixOS Linux / WSL2 の場合: home-manager 構成をビルド | |
| nix build .#homeConfigurations."<user>@<host>".activationPackage --show-trace |
| # Usage: | ||
| # nix run .#switch - Build and apply configuration | ||
| # nix run .#switch - Build and apply configuration (Darwin) | ||
| # nix run .#build - Build only (test) |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage comment advertises nix run .#build as a generic build/test command, but the build app intentionally exits with an error on non-Darwin systems below. Consider updating this comment to clarify it’s Darwin-only (or extend the app to support NixOS/home-manager builds).
| # nix run .#build - Build only (test) | |
| # nix run .#build - Build only (Darwin test; use explicit nix build on NixOS/Home Manager) |
| # Platform-specific clipboard command | ||
| copyCommand = if isDarwin then "pbcopy" | ||
| else if builtins.getEnv "WAYLAND_DISPLAY" != "" then "wl-copy" | ||
| else "xclip -selection clipboard"; |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as in fzf.nix: builtins.getEnv("WAYLAND_DISPLAY") is evaluated during Nix evaluation, so Wayland sessions will usually not be detected and copy_command will default to xclip. Consider making copy_command a runtime check (wrapper script) instead of using builtins.getEnv.
| # Platform-specific clipboard command | |
| copyCommand = if isDarwin then "pbcopy" | |
| else if builtins.getEnv "WAYLAND_DISPLAY" != "" then "wl-copy" | |
| else "xclip -selection clipboard"; | |
| # Runtime wrapper for clipboard command on non-Darwin systems | |
| copyCommandBin = pkgs.writeShellScriptBin "clipboard-copy" '' | |
| if [ -n "$WAYLAND_DISPLAY" ]; then | |
| exec wl-copy "$@" | |
| else | |
| exec xclip -selection clipboard "$@" | |
| fi | |
| ''; | |
| # Platform-specific clipboard command | |
| copyCommand = if isDarwin then "pbcopy" | |
| else "${copyCommandBin}/bin/clipboard-copy"; |
| modules = [ | ||
| ../home | ||
|
|
||
| # Machine-specific Home Manager configuration (optional) | ||
| # Uncomment if you have machine-specific home configs | ||
| # (../machines/linux + "/${personal.hostname}.nix") | ||
| ]; |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Machine-specific Home Manager config for Linux (machines/linux/.nix) is commented out here, so creating those files (as suggested by machines/linux/example.nix / README) will have no effect. Either import it (optionally guarded by builtins.pathExists) or document that users must wire it in themselves.
| modules = [ | |
| ../home | |
| # Machine-specific Home Manager configuration (optional) | |
| # Uncomment if you have machine-specific home configs | |
| # (../machines/linux + "/${personal.hostname}.nix") | |
| ]; | |
| modules = | |
| let | |
| machineModulePath = ../machines/linux + "/${personal.hostname}.nix"; | |
| in | |
| [ ../home ] | |
| ++ lib.optional (builtins.pathExists machineModulePath) machineModulePath; |

Summary by CodeRabbit
Release Notes
New Features
Documentation
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.