-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
144 lines (125 loc) · 4.63 KB
/
flake.nix
File metadata and controls
144 lines (125 loc) · 4.63 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
{
description = "NixOS and macOS system configuration";
inputs = {
# home-manager module for user environment management
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# microvm.nix for lightweight NixOS VMs on macOS
microvm.url = "github:astro/microvm.nix";
microvm.inputs.nixpkgs.follows = "nixpkgs";
# nix-darwin module for macOS system configuration
nix-darwin.url = "github:LnL7/nix-darwin/nix-darwin-25.11";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
# Pin our primary nixpkgs repository. This is the main nixpkgs repository
# we'll use for our configurations. Be very careful changing this because
# it'll impact your entire system.
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
# An unstable nixpkgs input for a few bleeding-edge packages.
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# NixVim — configure Neovim entirely in Nix
nixvim.url = "github:nix-community/nixvim/nixos-25.11";
# sops-nix module to handle encrypted secrets
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
# Conventional commits skill for Pi (dgalarza/claude-code-workflows)
dgalarza-claude-code-workflows = {
url = "github:dgalarza/claude-code-workflows/0bc28b28f949dc448753913e6f69479444f2241f";
flake = false;
};
# Pi extensions from mitsuhiko/agent-stuff
mitsuhiko-agent-stuff = {
url = "github:mitsuhiko/agent-stuff/80e1e96fa563ffc0c9d60422eac6dc9e67440385";
flake = false;
};
# Nushell extension for Pi (spnngl/pi-ext)
spnngl-pi-ext = {
url = "github:spnngl/pi-ext/505c0f9a9c0ebc528d11466a7f779c2b99f02de7";
flake = false;
};
# React/Next.js agent skills for Pi (vercel-labs/agent-skills)
vercel-labs-agent-skills = {
url = "github:vercel-labs/agent-skills/64484e9a6022c81e3af59f5dcee6fb6d631bf53e";
flake = false;
};
};
outputs =
{
self,
dgalarza-claude-code-workflows,
home-manager,
microvm,
mitsuhiko-agent-stuff,
nix-darwin,
nixpkgs,
nixpkgs-unstable,
nixvim,
sops-nix,
spnngl-pi-ext,
vercel-labs-agent-skills,
...
}:
let
system = "aarch64-darwin";
pkgs = nixpkgs.legacyPackages.${system};
mkMicroVM = import ./lib/mk-microvm.nix {
inherit
dgalarza-claude-code-workflows
home-manager
microvm
mitsuhiko-agent-stuff
nixpkgs
nixpkgs-unstable
nixvim
sops-nix
spnngl-pi-ext
vercel-labs-agent-skills
;
};
in
{
devShells.${system}.default = pkgs.mkShellNoCC {
name = "dotfiles";
packages = [
nix-darwin.packages.${system}.darwin-rebuild
(pkgs.writeShellApplication {
name = "switch";
text = "sudo darwin-rebuild switch --flake '.#macos-aarch64'";
})
];
};
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-tree;
formatter.aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt-tree;
#--------------------------------------------------------------------
# System configurations (macOS)
#--------------------------------------------------------------------
darwinConfigurations.macos-aarch64 = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit
home-manager
nixpkgs-unstable
nixvim
sops-nix
;
};
modules = [
./machines/macos-aarch64.nix
];
};
#--------------------------------------------------------------------
# MicroVMs (aarch64-linux guests, launched via vfkit)
#--------------------------------------------------------------------
nixosConfigurations.cliniko-vm = mkMicroVM "cliniko";
nixosConfigurations.dotfiles-vm = mkMicroVM "dotfiles";
nixosConfigurations.homelab-vm = mkMicroVM "homelab";
nixosConfigurations.predbat-vm = mkMicroVM "predbat";
packages.aarch64-darwin.cliniko-vm =
self.nixosConfigurations.cliniko-vm.config.microvm.declaredRunner;
packages.aarch64-darwin.dotfiles-vm =
self.nixosConfigurations.dotfiles-vm.config.microvm.declaredRunner;
packages.aarch64-darwin.homelab-vm =
self.nixosConfigurations.homelab-vm.config.microvm.declaredRunner;
packages.aarch64-darwin.predbat-vm =
self.nixosConfigurations.predbat-vm.config.microvm.declaredRunner;
};
}