about summary refs log tree commit diff
path: root/modules/darwin/common/nix.nix
blob: b291d11d85e091dfc4f0cc2ec76f2e83a15828c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  config,
  inputs,
  lib,
  this,
  ...
}:
with lib; {
  _module.args = let
    importNixpkgsx86 = nixpkgs:
      import nixpkgs {
        inherit (config.nixpkgs) config;
        system = "x86_64-darwin";
      };
  in rec {
    pkgsx86 = importNixpkgsx86 inputs.nixpkgs;
    pkgsLocalx86 = importNixpkgsx86 "${config.my.home}/src/nixpkgs"; # Impure!
    pkgsMasterx86 = importNixpkgsx86 inputs.nixpkgs-master;
    pkgsStablex86 = importNixpkgsx86 inputs.nixpkgs-stable;
    pkgsRevx86 = rev: hash:
      importNixpkgsx86 (pkgs.fetchFromGitHub {
        owner = "NixOS";
        repo = "nixpkgs";
        inherit rev hash;
      });
    pkgsPrx86 = pr: pkgsRevx86 "refs/pull/${toString pr}/head";
  };

  nix = {
    daemonIOLowPriority = false;
    daemonProcessType = "Standard";

    settings.extra-platforms = optionalString (this.system == "aarch64-darwin") ''
      x86_64-darwin aarch64-darwin
    '';

    settings.trusted-users = ["@admin"];
  };

  services.nix-daemon.enable = true;

  system.stateVersion = 4;
}

Consider giving Nix/NixOS a try! <3