|
3 | 3 |
|
4 | 4 | inputs = { |
5 | 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; |
| 6 | + nixpkgs-mars.url = "github:nixos/nixpkgs/nixpkgs-26.05-darwin"; |
6 | 7 | systems.url = "github:nix-systems/default"; |
7 | 8 | home-manager = { |
8 | 9 | url = "github:nix-community/home-manager"; |
9 | 10 | inputs.nixpkgs.follows = "nixpkgs"; |
10 | 11 | }; |
| 12 | + home-manager-mars = { |
| 13 | + url = "github:nix-community/home-manager/release-26.05"; |
| 14 | + inputs.nixpkgs.follows = "nixpkgs-mars"; |
| 15 | + }; |
11 | 16 | vscode-server = { |
12 | 17 | url = "github:nix-community/nixos-vscode-server"; |
13 | 18 | inputs.nixpkgs.follows = "nixpkgs"; |
|
17 | 22 | inputs.nixpkgs.follows = "nixpkgs"; |
18 | 23 | }; |
19 | 24 | 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"; |
22 | 27 | }; |
23 | 28 | nix-homebrew.url = "github:zhaofengli/nix-homebrew"; |
24 | 29 | git-hooks = { |
|
41 | 46 | let |
42 | 47 | homeManagerUser = "artem"; |
43 | 48 | eachSystem = nixpkgs.lib.genAttrs (import systems); |
| 49 | + nixpkgsFor = system: if system == "x86_64-darwin" then inputs.nixpkgs-mars else nixpkgs; |
44 | 50 | in |
45 | 51 | { |
46 | 52 | 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 | + ); |
57 | 71 | }); |
58 | 72 |
|
59 | 73 | homeModules = { |
|
82 | 96 | ]; |
83 | 97 | }; |
84 | 98 |
|
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 | + }; |
99 | 115 |
|
100 | 116 | darwinConfigurations.mars = darwin.lib.darwinSystem { |
101 | 117 | system = "x86_64-darwin"; |
|
138 | 154 | devShells = eachSystem ( |
139 | 155 | system: |
140 | 156 | let |
141 | | - pkgs = import nixpkgs { inherit system; }; |
| 157 | + pkgs = import (nixpkgsFor system) { |
| 158 | + inherit system; |
| 159 | + config.allowDeprecatedx86_64Darwin = true; |
| 160 | + }; |
142 | 161 | inherit (self.checks.${system}.pre-commit-check) shellHook enabledPackages; |
143 | 162 | in |
144 | 163 | { |
|
0 commit comments