summary refs log tree commit diff stats
path: root/flake.nix
blob: 313144090be6ab8e196c13ef4c608f01329d4461 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nixos-hardware.url = "github:NixOS/nixos-hardware";
    nix-index-database.url = "github:Mic92/nix-index-database";
    nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
    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";
    emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
    secrets = {
      flake = false;
    };
  };

  outputs =
    { self
    , darwin
    , emacs-overlay
    , home-manager
    , nixpkgs
    , nix-index-database
    , secrets
    , ...
    } @ attrs:
    let
      darwinSystem = "aarch64-darwin";
      darwinPkgs = nixpkgs.legacyPackages.${darwinSystem};
      nixosSystem = "x86_64-linux";
      nixosPkgs = nixpkgs.legacyPackages.${nixosSystem};
      aarch64LinuxSystem = "aarch64-linux";
      aarch64LinuxPackages = nixpkgs.legacyPackages.${aarch64LinuxSystem};
    in
    {
      nixosConfigurations.prefect = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = attrs;
        modules = [ ./system/prefect.nix ];
      };
      nixosConfigurations.nanopi = nixpkgs.lib.nixosSystem {
        system = aarch64LinuxSystem;
        specialArgs = attrs;
        modules = [ ./nanopi.nix ];
      };
      darwinConfigurations.mba = darwin.lib.darwinSystem {
        system = darwinSystem;
        specialArgs = attrs;
        modules = [ ./system/mba.nix ];
      };
      homeConfigurations."alan@mba" = home-manager.lib.homeManagerConfiguration {
        pkgs = darwinPkgs;
        extraSpecialArgs = { inherit attrs; };
        modules = [
          ./user/mba.nix
          nix-index-database.hmModules.nix-index
          (secrets + "/default.nix")
          (secrets + "/ssh.nix")
          ({ nixpkgs.overlays = [ emacs-overlay.overlay ]; })
        ];
      };
      homeConfigurations."alan@prefect" = home-manager.lib.homeManagerConfiguration {
        pkgs = nixosPkgs;
        extraSpecialArgs = { inherit attrs; };
        modules = [
          ./user/prefect.nix
          nix-index-database.hmModules.nix-index
          (secrets + "/default.nix")
          (secrets + "/ssh.nix")
          ({ nixpkgs.overlays = [ emacs-overlay.overlay ]; })
        ];
      };
      homeConfigurations."alan@nanopi" = home-manager.lib.homeManagerConfiguration {
        pkgs = aarch64LinuxPackages;
        extraSpecialArgs = { inherit attrs; };
        modules = [
          ./user/nanopi.nix
          nix-index-database.hmModules.nix-index
          (secrets + "/default.nix")
        ];
      };
      homeConfigurations."alan@nixos" = home-manager.lib.homeManagerConfiguration {
        pkgs = aarch64LinuxPackages;
        extraSpecialArgs = { inherit attrs; };
        modules = [
          ./user/lima.nix
          nix-index-database.hmModules.nix-index
          (secrets + "/default.nix")
        ];
      };
      homeConfigurations."alan@pappel" = home-manager.lib.homeManagerConfiguration {
        pkgs = nixosPkgs;
        extraSpecialArgs = { inherit attrs; };
        modules = [
          ./user/server.nix
          nix-index-database.hmModules.nix-index
          (secrets + "/default.nix")
        ];
      };
    };
}