Skip to content

Commit 745547b

Browse files
committed
Fix mars build
unstable/26.11 broken for x86_64-darwin
1 parent c41912d commit 745547b

2 files changed

Lines changed: 100 additions & 41 deletions

File tree

flake.lock

Lines changed: 54 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33

44
inputs = {
55
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
nixpkgs-mars.url = "github:nixos/nixpkgs/nixpkgs-26.05-darwin";
67
systems.url = "github:nix-systems/default";
78
home-manager = {
89
url = "github:nix-community/home-manager";
910
inputs.nixpkgs.follows = "nixpkgs";
1011
};
12+
home-manager-mars = {
13+
url = "github:nix-community/home-manager/release-26.05";
14+
inputs.nixpkgs.follows = "nixpkgs-mars";
15+
};
1116
vscode-server = {
1217
url = "github:nix-community/nixos-vscode-server";
1318
inputs.nixpkgs.follows = "nixpkgs";
@@ -17,8 +22,8 @@
1722
inputs.nixpkgs.follows = "nixpkgs";
1823
};
1924
darwin = {
20-
url = "github:nix-darwin/nix-darwin";
21-
inputs.nixpkgs.follows = "nixpkgs";
25+
url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
26+
inputs.nixpkgs.follows = "nixpkgs-mars";
2227
};
2328
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
2429
git-hooks = {
@@ -41,19 +46,28 @@
4146
let
4247
homeManagerUser = "artem";
4348
eachSystem = nixpkgs.lib.genAttrs (import systems);
49+
nixpkgsFor = system: if system == "x86_64-darwin" then inputs.nixpkgs-mars else nixpkgs;
4450
in
4551
{
4652
checks = eachSystem (system: {
47-
pre-commit-check = inputs.git-hooks.lib.${system}.run (
48-
{
49-
src = ./.;
50-
excludes = [
51-
"^migrated/"
52-
"^legacy/"
53-
];
54-
}
55-
// inputs.fw_nix.lib.pre-commit
56-
);
53+
pre-commit-check =
54+
let
55+
gitHooksLib = import "${inputs.git-hooks}/nix" {
56+
nixpkgs = nixpkgsFor system;
57+
inherit system;
58+
isFlakes = true;
59+
};
60+
in
61+
gitHooksLib.run (
62+
{
63+
src = ./.;
64+
excludes = [
65+
"^migrated/"
66+
"^legacy/"
67+
];
68+
}
69+
// inputs.fw_nix.lib.pre-commit
70+
);
5771
});
5872

5973
homeModules = {
@@ -82,20 +96,22 @@
8296
];
8397
};
8498

85-
homeConfigurations."${homeManagerUser}@mars" = home-manager.lib.homeManagerConfiguration {
86-
pkgs = import nixpkgs {
87-
system = "x86_64-darwin";
88-
config.allowDeprecatedx86_64Darwin = true;
89-
};
90-
extraSpecialArgs = {
91-
primaryUser = homeManagerUser;
92-
};
93-
modules = [
94-
inputs.fw_nix.nixosModules.identities
95-
self.homeModules.mac-portable
96-
./hosts/mars/home.nix
97-
];
98-
};
99+
homeConfigurations."${homeManagerUser}@mars" =
100+
inputs.home-manager-mars.lib.homeManagerConfiguration
101+
{
102+
pkgs = import inputs.nixpkgs-mars {
103+
system = "x86_64-darwin";
104+
config.allowDeprecatedx86_64Darwin = true;
105+
};
106+
extraSpecialArgs = {
107+
primaryUser = homeManagerUser;
108+
};
109+
modules = [
110+
inputs.fw_nix.nixosModules.identities
111+
self.homeModules.mac-portable
112+
./hosts/mars/home.nix
113+
];
114+
};
99115

100116
darwinConfigurations.mars = darwin.lib.darwinSystem {
101117
system = "x86_64-darwin";
@@ -138,7 +154,10 @@
138154
devShells = eachSystem (
139155
system:
140156
let
141-
pkgs = import nixpkgs { inherit system; };
157+
pkgs = import (nixpkgsFor system) {
158+
inherit system;
159+
config.allowDeprecatedx86_64Darwin = true;
160+
};
142161
inherit (self.checks.${system}.pre-commit-check) shellHook enabledPackages;
143162
in
144163
{

0 commit comments

Comments
 (0)