-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
176 lines (157 loc) · 5.57 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
inputs = {
nixpkgs.url = "nixpkgs";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
ez-configs.url = "github:ehllie/ez-configs";
agenix = {
url = "github:ryantm/agenix";
inputs.darwin.follows = "darwin";
inputs.home-manager.follows = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-apple-silicon = {
url = "github:tpwrules/nixos-apple-silicon";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
extra-container = {
url = "github:erikarvstedt/extra-container";
inputs.nixpkgs.follows = "nixpkgs";
};
};
# https://nixos.wiki/wiki/Flakes
outputs =
inputs @ { self
, agenix
, darwin
, extra-container
, flake-parts
, home-manager
, nixos-apple-silicon
, nixpkgs
, nixpkgs-unstable
, ...
}:
flake-parts.lib.mkFlake { inherit inputs; } ({ withSystem, ... }: {
systems = [ "aarch64-darwin" "aarch64-linux" "x86_64-linux" ];
# TODO: Configure ez-configs to split up configurations.
# imports = [
# inputs.ez-configs.flakeModule
# ];
#
# ezConfigs = {
# root = ./.;
# globalArgs = {inherit inputs;};
# };
perSystem = { pkgs, lib, system, inputs', ... }: {
formatter = pkgs.nixpkgs-fmt;
packages =
{
# Packages to be available (via nix run .#<name>) on all OSes.
} // (lib.optionalAttrs pkgs.stdenv.isLinux {
# Linux will either be nixOS or home-manager only.
home-manager = inputs'.home-manager.packages.default;
}) // (lib.optionalAttrs pkgs.stdenv.isDarwin {
# Darwin is always nix-darwin.
nix-darwin = inputs'.darwin.packages.default;
});
};
flake = {
homeConfigurations =
# let
# # TODO don't hardcode system here either...
# system = "x86_64-linux";
# pkgs = import nixpkgs { inherit system; };
# unstable = import nixpkgs-unstable { inherit system; };
# in
{
# gceworker = home-manager.lib.homeManagerConfiguration {
# inherit pkgs;
# extraSpecialArgs = { inherit unstable; };
#
# modules = [
# ./homes/common.nix
# ./homes/crl.nix
# ./homes/gceworker.nix
# ];
# };
redpanda-lima-vm =
let
system = "aarch64-linux";
pkgs = import nixpkgs { inherit system; };
unstable = import nixpkgs-unstable { inherit system; };
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit unstable; };
modules = [
./homes/common.nix
./home-modules/nvim.nix
./homes/redpanda-lima-vm.nix
];
};
};
darwinConfigurations = {
"redpanda-mbpro" = import ./darwin-configurations/redpanda-mbpro.nix {
inherit darwin nixpkgs home-manager nixpkgs-unstable;
};
"Chriss-Air" = import ./darwin-configurations/personal-air.nix {
inherit darwin nixpkgs home-manager nixpkgs-unstable;
};
};
nixosConfigurations = {
asahi-mini =
let
system = "aarch64-linux";
pkgs = import nixpkgs { inherit system; };
unstable = import nixpkgs-unstable { inherit system; };
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
agenix.nixosModules.default
home-manager.nixosModules.home-manager
nixos-apple-silicon.nixosModules.apple-silicon-support
extra-container.nixosModules.default
./configurations/nas.nix
./configurations/memento.nix
./configurations/asahi-mini.nix
./nixos-modules/silverbullet
./nixos-modules/home-assistant.nix
{
home-manager.useUserPackages = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.chrisseto = {
isNormalUser = true;
home = "/home/chrisseto";
hashedPassword = "$6$PK.EJqps/uhJSWsM$S1HGVnVQCVIlf.xYNeHjuot2YEzjv4Xy/PLlnyBUxrXo6d/lkxsujjgt7sSnnZ5v8F/eeP.CNMOgGsTL2IN8w0";
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIClQd+Mx8j4tLqk/a2s705FlLPfEbXbXpMeUCcuwDqZ8" ];
};
home-manager.extraSpecialArgs = { inherit unstable; };
home-manager.users.chrisseto = {
imports = [
./homes/common.nix
./homes/asahi-mini.nix
./home-modules/nvim.nix
];
};
}
];
specialArgs = {
inherit nixpkgs;
inherit nixos-apple-silicon;
};
};
};
};
});
}