summary refs log tree commit diff stats
path: root/flake.nix
blob: 8ff6394db6df484409bfada09fa065839e785a95 (plain)
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
{
  inputs = {
    nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
    nixos-hardware.url = github:NixOS/nixos-hardware;
    darwin.url = github:lnl7/nix-darwin/master;
    darwin.inputs.nixpkgs.follows = "nixpkgs";
    home-manager.url = github:nix-community/home-manager;
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
    emacs-overlay.url = github:nix-community/emacs-overlay;
    secrets = {
      url = git+ssh://git.alanpearce.eu/nixfiles-private;
      flake = false;
    };
  };

  outputs = { self, darwin, home-manager, nixpkgs, secrets, ... }@attrs:
  let
    darwinSystem =
      "x86_64-darwin"; # aarch64 is still failing on some compiler-rt derivation
      darwinPkgs = nixpkgs.legacyPackages.${darwinSystem};
      nixosSystem = "x86_64-linux";
      nixosPkgs = nixpkgs.legacyPackages.${nixosSystem};
  in {
    nixosConfigurations.prefect = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = attrs;
      modules = [ ./system/prefect.nix ];
    };
    darwinConfigurations.mba = darwin.lib.darwinSystem {
      system = darwinSystem;
      specialArgs = attrs;
      modules = [ ./system/mba.nix ];
    };
    homeConfigurations."alan@mba" = home-manager.lib.homeManagerConfiguration {
      pkgs = darwinPkgs;
      modules = [ ./user/mba.nix (secrets + "/default.nix") ];
    };
    homeConfigurations."alan@prefect" = home-manager.lib.homeManagerConfiguration {
      pkgs = nixosPkgs;
      modules = [ ./user/prefect.nix (secrets + "/default.nix") ];
    };
  };
}