-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
78 lines (64 loc) · 2.04 KB
/
flake.nix
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
{
description = "NixOS/MacOS system config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# https://nix-community.github.io/home-manager/index.xhtml#ch-nix-flakes
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
foundryvtt = {
url = "github:reckenrode/nix-foundryvtt";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
nix-darwin,
foundryvtt,
...
} @ inputs: let
# These attribute sets are passed to all modules here, both NixOS and
# Darwin.
globals = import ./globals.nix;
private = import ./private.nix;
in {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.alejandra;
nixosConfigurations.${private.nixOsHost} = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs globals private;};
modules = [
./nixos/configuration.nix
foundryvtt.nixosModules.foundryvtt
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {inherit globals private;};
home-manager.users.${private.nixOsUsername} = import ./nixos/home.nix;
}
];
};
darwinConfigurations.${private.darwinHost} = nix-darwin.lib.darwinSystem {
specialArgs = {inherit inputs globals private;};
modules = [
./darwin/configuration.nix
];
};
homeConfigurations.${private.darwinUsername} = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
localSystem = "aarch64-darwin";
config.allowUnfree = true;
};
extraSpecialArgs = {inherit globals private;};
modules = [./darwin/home.nix];
};
};
}