-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make most packages refer darwin special channel if run on macOS #924
Merged
+84
−58
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7860f1a
Make most packages refers darwin special channel if run on macOS
kachick 0dfefba
flake.lock: Update
github-actions[bot] 63acb1d
Fix to branch nix channel in homemade packages
kachick f14cdff
Enable magic-nix-cache-action in home-manager CI only on darwin
kachick 295344a
Revert "Enable magic-nix-cache-action in home-manager CI only on darwin"
kachick 30fa1a3
Sync same channel in home-manager
kachick faaff20
Remove garbage code in GH-796
kachick 78be54c
Enable decadent magic nix cache only in macos-13
kachick e933fdc
fix? to specify intel mac
kachick 1f84b42
Enable decadent magic nix cache only in macos-13 also in ci-nix
kachick 87b9ab1
Don't maintain this repository on darwin, use lima
kachick 58a1ca5
Drop macos-15 runner in CI matrix
kachick f63eca7
Merge branch 'main' into stable-darwin
kachick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If you reach this repository with searching
08gjpy7gfpylh2m2dyhasd0l5i3y7mz2-ghostscript-10.04.0.drv
, this line is the answer by me 🤷♂️ 🍎