-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
132 lines (129 loc) · 3.79 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
description = "Raz multi-system flake";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew = {
url = "github:zhaofengli-wip/nix-homebrew";
};
mac-app-util = {
url = "github:hraban/mac-app-util";
};
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
};
zen-browser ={
url = "github:0xc000022070/zen-browser-flake";
};
};
outputs =
inputs@{
self,
nixpkgs,
nix-darwin,
home-manager,
nix-homebrew,
mac-app-util,
nixos-wsl,
zen-browser,
}:
{
# Build darwin flake using:
# $ darwin-rebuild build --flake ~/.config/nix#macbook
darwinConfigurations = {
"macbook" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
./darwin/configuration.nix
mac-app-util.darwinModules.default
home-manager.darwinModules.home-manager
{
home-manager = {
backupFileExtension = "bkup";
useGlobalPkgs = true;
users.rmagori = import ./home-manager/home.nix;
sharedModules = [
mac-app-util.homeManagerModules.default
];
extraSpecialArgs = {
inherit inputs;
flakeName = "macbook";
attributes = [
"work"
"gui"
"mac"
];
};
};
users.users.rmagori.home = "/Users/rmagori";
}
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = true;
# User owning the Homebrew prefix
user = "rmagori";
# Automatically migrate existing Homebrew installations
autoMigrate = true;
};
}
];
};
};
nixosConfigurations = {
"wsl" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nixos-wsl.nixosModules.default
./nixos-wsl/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.raz = import ./home-manager/home.nix;
extraSpecialArgs = {
inherit inputs;
flakeName = "wsl";
attributes = [];
};
};
}
];
};
"pedro" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./nixos/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.raz = import ./home-manager/home.nix;
extraSpecialArgs = {
inherit inputs;
flakeName = "pedro";
attributes = ["gui"];
};
};
}
];
};
};
# Expose the package set, including overlays, for convenience.
# darwinPackages = self.darwinConfigurations."macbook".pkgs;
};
}