-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make most packages refer darwin special channel if run on macOS (#924)
* Make most packages refers darwin special channel if run on macOS Fixes GH-910 * flake.lock: Update Flake lock file updates: • Updated input 'edge-nixpkgs': 'github:NixOS/nixpkgs/4aa36568d413aca0ea84a1684d2d46f55dbabad7?narHash=sha256-Zwl8YgTVJTEum%2BL%2B0zVAWvXAGbWAuXHax3KzuejaDyo%3D' (2024-11-05) → 'github:NixOS/nixpkgs/76612b17c0ce71689921ca12d9ffdc9c23ce40b2?narHash=sha256-IigrKK3vYRpUu%2BHEjPL/phrfh7Ox881er1UEsZvw9Q4%3D' (2024-11-09) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/dba414932936fde69f0606b4f1d87c5bc0003ede?narHash=sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE%3D' (2024-11-06) → 'github:NixOS/nixpkgs/83fb6c028368e465cd19bb127b86f971a5e41ebc?narHash=sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0%3D' (2024-11-07) * Fix to branch nix channel in homemade packages * Enable magic-nix-cache-action in home-manager CI only on darwin * Revert "Enable magic-nix-cache-action in home-manager CI only on darwin" This reverts commit f14cdff. * Sync same channel in home-manager * Remove garbage code in GH-796 * Enable decadent magic nix cache only in macos-13 * fix? to specify intel mac * Enable decadent magic nix cache only in macos-13 also in ci-nix * Don't maintain this repository on darwin, use lima To avoid rate limit * Drop macos-15 runner in CI matrix I just experienced with arch problems, not for the OS version problems in home-manager And I want to reduce macos related code with GH-911 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fb5f31a
commit 9cf737b
Showing
7 changed files
with
84 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,18 @@ | |
# - https://discourse.nixos.org/t/differences-between-nix-channels/13998 | ||
# How to update the revision | ||
# - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html | ||
# TODO: Use nixpkgs-24.05-darwin only in macOS. See GH-910 | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; | ||
edge-nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
edge-nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Unfit for darwin, might be broken. See https://github.com/NixOS/nixpkgs/issues/107466 | ||
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; | ||
# https://github.com/nix-community/home-manager/blob/release-24.05/docs/manual/nix-flakes.md | ||
home-manager = { | ||
home-manager-linux = { | ||
url = "github:nix-community/home-manager/release-24.05"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
home-manager-darwin = { | ||
url = "github:nix-community/home-manager/release-24.05"; | ||
inputs.nixpkgs.follows = "nixpkgs-darwin"; | ||
}; | ||
nixos-wsl = { | ||
url = "github:nix-community/NixOS-WSL/2405.5.4"; | ||
# https://github.com/nix-community/NixOS-WSL/blob/5a965cb108fb1f30b29a26dbc29b473f49e80b41/flake.nix#L5 | ||
|
@@ -36,7 +40,9 @@ | |
self, | ||
nixpkgs, | ||
edge-nixpkgs, | ||
home-manager, | ||
nixpkgs-darwin, | ||
home-manager-linux, | ||
home-manager-darwin, | ||
... | ||
}@inputs: | ||
let | ||
|
@@ -51,9 +57,12 @@ | |
|
||
homemade-packages = forAllSystems ( | ||
system: | ||
(nixpkgs.legacyPackages.${system}.callPackage ./pkgs { | ||
edge-pkgs = edge-nixpkgs.legacyPackages.${system}; | ||
}) | ||
( | ||
(if (nixpkgs.lib.strings.hasSuffix "-darwin" system) then nixpkgs-darwin else nixpkgs) | ||
.legacyPackages.${system}.callPackage | ||
./pkgs | ||
{ edge-pkgs = edge-nixpkgs.legacyPackages.${system}; } | ||
) | ||
); | ||
in | ||
{ | ||
|
@@ -164,7 +173,8 @@ | |
# https://github.com/NixOS/nix/issues/6448#issuecomment-1132855605 | ||
{ | ||
name = "home-manager"; | ||
value = mkApp home-manager.defaultPackage.${system}; | ||
# FIXME: Use home-manager-darwin in macOS | ||
value = mkApp home-manager-linux.defaultPackage.${system}; | ||
} | ||
] | ||
) | ||
|
@@ -209,23 +219,15 @@ | |
}; | ||
|
||
x86-macOS = { | ||
pkgs = nixpkgs.legacyPackages.x86_64-darwin; | ||
pkgs = nixpkgs-darwin.legacyPackages.x86_64-darwin; | ||
extraSpecialArgs = { | ||
homemade-pkgs = homemade-packages.x86_64-darwin; | ||
edge-pkgs = edge-nixpkgs.legacyPackages.x86_64-darwin; | ||
}; | ||
}; | ||
|
||
aarch64-macOS = { | ||
pkgs = nixpkgs.legacyPackages.aarch64-darwin; | ||
extraSpecialArgs = { | ||
homemade-pkgs = homemade-packages.aarch64-darwin; | ||
edge-pkgs = edge-nixpkgs.legacyPackages.aarch64-darwin; | ||
}; | ||
}; | ||
in | ||
{ | ||
"kachick@desktop" = home-manager.lib.homeManagerConfiguration ( | ||
"kachick@desktop" = home-manager-linux.lib.homeManagerConfiguration ( | ||
x86-Linux | ||
// { | ||
modules = [ | ||
|
@@ -236,7 +238,7 @@ | |
} | ||
); | ||
|
||
"kachick@wsl-ubuntu" = home-manager.lib.homeManagerConfiguration ( | ||
"kachick@wsl-ubuntu" = home-manager-linux.lib.homeManagerConfiguration ( | ||
x86-Linux | ||
// { | ||
modules = [ | ||
|
@@ -246,7 +248,7 @@ | |
} | ||
); | ||
|
||
"nixos@wsl-nixos" = home-manager.lib.homeManagerConfiguration ( | ||
"nixos@wsl-nixos" = home-manager-linux.lib.homeManagerConfiguration ( | ||
x86-Linux | ||
// { | ||
modules = [ | ||
|
@@ -257,11 +259,11 @@ | |
} | ||
); | ||
|
||
"kachick@macbook" = home-manager.lib.homeManagerConfiguration ( | ||
"kachick@macbook" = home-manager-darwin.lib.homeManagerConfiguration ( | ||
x86-macOS // { modules = [ ./home-manager/kachick.nix ]; } | ||
); | ||
|
||
"kachick@lima" = home-manager.lib.homeManagerConfiguration ( | ||
"kachick@lima" = home-manager-darwin.lib.homeManagerConfiguration ( | ||
x86-Linux | ||
// { | ||
modules = [ | ||
|
@@ -271,7 +273,7 @@ | |
} | ||
); | ||
|
||
"[email protected]" = home-manager.lib.homeManagerConfiguration ( | ||
"[email protected]" = home-manager-linux.lib.homeManagerConfiguration ( | ||
x86-Linux | ||
// { | ||
# Prefer "kachick" over "common" only here. | ||
|
@@ -284,7 +286,7 @@ | |
} | ||
); | ||
|
||
"github-actions@macos-13" = home-manager.lib.homeManagerConfiguration ( | ||
"github-actions@macos-13" = home-manager-darwin.lib.homeManagerConfiguration ( | ||
x86-macOS | ||
// { | ||
# Prefer "kachick" over "common" only here. | ||
|
@@ -296,19 +298,7 @@ | |
} | ||
); | ||
|
||
"github-actions@macos-15" = home-manager.lib.homeManagerConfiguration ( | ||
aarch64-macOS | ||
// { | ||
# Prefer "kachick" over "common" only here. | ||
# Using values as much as possible as actual values to create a robust CI | ||
modules = [ | ||
./home-manager/kachick.nix | ||
{ home.username = "runner"; } | ||
]; | ||
} | ||
); | ||
|
||
"user@linux-cli" = home-manager.lib.homeManagerConfiguration ( | ||
"user@linux-cli" = home-manager-linux.lib.homeManagerConfiguration ( | ||
x86-Linux | ||
// { | ||
modules = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters