-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
95 lines (83 loc) · 2.51 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
{
description = "vibe's conf.d";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
nixpkgs-stable-darwin.url = "github:nixos/nixpkgs/nixpkgs-20.09-darwin";
nixos-stable.url = "github:nixos/nixpkgs/nixos-20.09";
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs @ { self, nixpkgs, darwin, home-manager, ... }:
let
nixpkgsConfig = with inputs; {
config = {
allowUnfree = true;
};
overlays = self.overlays ++ [
(
final: prev:
let
system = prev.stdenv.system;
nixpkgs-stable = if system == "x86_64-darwin" then nixpkgs-stable-darwin else nixos-stable;
in
{
master = nixpkgs-master.legacyPackages.${system};
stable = nixpkgs-stable.legacyPackages.${system};
}
)
];
};
homeManagerConfig = with self.homeManagerModules; {
imports = [
./nix/users/vibe
];
};
darwinModules = { user }: [
./nix/machines/macos
home-manager.darwinModules.home-manager
{
nixpkgs = nixpkgsConfig;
nix.nixPath = {
nixpkgs = "$HOME/.config/nixpkgs/nixpkgs.nix";
};
users.users.${user}.home = "/Users/${user}";
home-manager = {
useGlobalPkgs = true;
users.${user} = homeManagerConfig;
};
}
];
in
{
darwinConfigurations = {
# Minimal configuration to bootstrap systems
bootstrap = darwin.lib.darwinSystem {
modules = [
./nix/machines/macos/bootstrap.nix
];
};
ghActions = darwin.lib.darwinSystem {
modules = darwinModules { user = "runner"; };
};
macbook = darwin.lib.darwinSystem {
modules = darwinModules { user = "vibe"; };
};
};
overlays =
let path = ./nix/machines/macos/overlays; in
with builtins;
map (n: import (path + ("/" + n))) (filter
(n:
match ".*\\.nix" n != null
|| pathExists (path + ("/" + n + "/default.nix")))
(attrNames (readDir path)));
};
}