-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
189 lines (166 loc) · 5.83 KB
/
Copy pathflake.nix
File metadata and controls
189 lines (166 loc) · 5.83 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
{
description = "Top-level system flake using flake-parts";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Pinned to a specific commit to preserve a working dotnet-sdk_9 build.
# TODO: Verify whether this pin is still necessary and, if not, replace with
# `follows = "nixpkgs"` so it tracks the main channel.
nixpkgs-dotnet.url = "github:NixOS/nixpkgs/b40629efe5d6ec48dd1efba650c797ddbd39ace0";
flake-parts.url = "github:hercules-ci/flake-parts";
claude-code.url = "github:sadjow/claude-code-nix";
nix-darwin = {
url = "github:nix-darwin/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ self
, nixpkgs
, home-manager
, flake-parts
, nix-darwin
, nix-homebrew
, neovim-nightly-overlay
, sops-nix
, claude-code
, ...
}:
let
inherit (self) outputs;
users = {
iams1mo = {
name = "iams1mo";
fullName = "Simeon Simeonoff";
email = "sim.simeonoff@gmail.com";
sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJS5NBbdV92aYxd135tddFb6Ynbc+PAUWP36qRyVdFw";
};
SSimeonov = {
name = "SSimeonov";
fullName = "Simeon Simeonoff";
email = "sim.simeonoff@gmail.com";
sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJS5NBbdV92aYxd135tddFb6Ynbc+PAUWP36qRyVdFw";
};
};
mkNixosConfiguration = hostname: username:
nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs hostname;
userConfig = users.${username};
nixosModules = "${self}/modules/nixos";
};
modules = [
./hosts/${hostname}
];
};
mkDarwinConfiguration = hostname: username:
nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs outputs hostname;
userConfig = users.${username};
darwinModules = "${self}/modules/darwin";
homebrewModules = "${self}/modules/homebrew";
};
modules = [
./hosts/${hostname}
home-manager.darwinModules.home-manager
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
enable = true;
enableRosetta = true;
# User owning the Homebrew prefix
user = username;
# Automatically migrate existing Homebrew installations
autoMigrate = true;
};
}
];
};
mkHomeConfiguration = system: username: hostname:
home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
claude-code.overlays.default
];
};
extraSpecialArgs = {
inherit inputs outputs;
userConfig = users.${username};
homeModules = "${self}/modules/home-manager";
neovim-nightly = neovim-nightly-overlay.packages.${system}.default;
pkgs-dotnet = import inputs.nixpkgs-dotnet { inherit system; };
};
modules = [
sops-nix.homeManagerModules.sops
./home/${username}/${hostname}
];
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.flake-parts.flakeModules.easyOverlay
];
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
perSystem = { pkgs, system, config, ... }:
let
tmuxPlugins = import ./packages/tmux { inherit pkgs; };
languageServers = import ./packages/language-servers { inherit pkgs; };
opencodePackages = import ./packages/opencode { inherit (pkgs) lib pkgs; };
piMonoPackages = import ./packages/pi-mono { inherit (pkgs) lib pkgs; };
codebaseMemoryMcpPackages = import ./packages/codebase-memory-mcp { inherit (pkgs) lib pkgs; };
neovim-nightly = neovim-nightly-overlay.packages.${system}.default;
# pkgs with our overlay + allowUnfree, for devShells
pkgs' = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ self.overlays.default ];
};
in
{
devShells = import ./devshells {
pkgs = pkgs'; inherit neovim-nightly;
pkgs-dotnet = import inputs.nixpkgs-dotnet { inherit system; };
};
overlayAttrs = {
inherit (languageServers) some-sass-language-server;
inherit (opencodePackages) opencode;
inherit (piMonoPackages) pi-mono;
inherit (codebaseMemoryMcpPackages) codebase-memory-mcp;
tmuxPlugins = pkgs.tmuxPlugins // tmuxPlugins;
local-fonts = pkgs.callPackage ./packages/local-fonts { };
};
};
flake = {
nixosConfigurations = {
kori = mkNixosConfiguration "kori" "iams1mo";
};
darwinConfigurations = {
ringo = mkDarwinConfiguration "ringo" "SSimeonov";
};
homeConfigurations = {
"iams1mo@kori" = mkHomeConfiguration "aarch64-linux" "iams1mo" "kori";
"SSimeonov@ssimeonov-mac" = mkHomeConfiguration "aarch64-darwin" "SSimeonov" "ringo";
};
};
};
}