-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
131 lines (130 loc) · 3.81 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
{
description = "An example NixOS configuration";
inputs = {
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-filter.url = "github:numtide/nix-filter";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.darwin.follows = "darwin";
inputs.home-manager.follows = "home-manager";
};
darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
home-manager,
nixpkgs,
deploy-rs,
nix-filter,
agenix,
darwin,
}:
let
rev = if self ? rev then self.rev else "dirty";
fix-nixpkgs-path = import ./modules/fix-nixpkgs-path.nix { inherit nixpkgs; };
all-overlays = [
nix-filter.overlays.default
deploy-rs.overlay
] ++ import ./overlays;
aarch64-linuxPkgs = import nixpkgs {
system = "aarch64-linux";
overlays = all-overlays;
};
x86_64Pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = all-overlays;
};
MALAK2 = (import ./machines/MALAK2) {
inherit all-overlays fix-nixpkgs-path rev;
nixosModules = self.nixosModules;
home = home-manager;
};
EZRA = (import ./machines/EZRA) {
inherit
all-overlays
fix-nixpkgs-path
rev
agenix
;
nixosModules = self.nixosModules;
};
ORB = (import ./machines/ORB) {
inherit
all-overlays
fix-nixpkgs-path
rev
agenix
;
nixosModules = self.nixosModules;
home = home-manager;
};
in
{
nixosConfigurations = {
# My desktop-on-a-thumb-drive
MALAK2 = nixpkgs.lib.nixosSystem MALAK2;
# Server
EZRA = nixpkgs.lib.nixosSystem EZRA;
# Orbstack VM
ORB = nixpkgs.lib.nixosSystem ORB;
};
darwinConfigurations =
let
makeDarwin =
darwin-config: username:
darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
(
{ ... }:
{
nixpkgs = {
overlays = all-overlays;
config.allowUnfree = true;
};
}
)
darwin-config
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${username}" = import ./modules/darwin/home.nix {
beth-home = self.nixosModules.home;
};
}
];
};
in
{
malak = makeDarwin ./machines/MALAK "dhines";
yachal = makeDarwin ./machines/YACHAL "d4hines";
};
nixosModules = import ./modules;
deploy.nodes.EZRA = {
hostname = "ezra.hines.house";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.EZRA;
remoteBuild = true;
};
};
overlays = {
default = nixpkgs.lib.composeManyExtensions (import ./overlays);
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-rfc-style;
};
}