Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
123 lines (108 loc) · 4.42 KB
/
Copy pathflake.nix
File metadata and controls
123 lines (108 loc) · 4.42 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
{
description = "antono's personal package set";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
# Only for tolaria: a pinned Rust toolchain (fenix) and the Rust builder
# (crane) its Tauri package is written against. Packages that need nothing
# beyond nixpkgs should stay that way.
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
# Composed with, not forked: sneg's MCP servers plug into upstream's module
# system, and `lib.mkConfig` here can enable servers from either side.
mcp-servers-nix = {
url = "github:natsukium/mcp-servers-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
inherit (nixpkgs) lib;
# Matches the platforms my personal flake actually configures.
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = f: lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in
{
# Consumers get every package in ./pkgs as `pkgs.<name>`.
overlays.default = import ./overlay.nix inputs;
# Just the MCP servers, for extending the nixpkgs instance passed to
# mcp-servers-nix' own `lib.mkConfig`. `lib.mkConfig` below applies it.
overlays.mcp-servers = final: prev: import ./pkgs/mcp-servers { inherit final prev; };
# `mkConfig`, `evalModule` and `serverModules` — see ./lib/default.nix.
lib = import ./lib {
inherit (inputs) mcp-servers-nix;
overlay = self.overlays.mcp-servers;
};
# Drop-in superset of mcp-servers-nix' own home-manager module: feeds
# `mcp-servers.programs.<name>` into home-manager's programs.mcp.servers.
homeManagerModules.default = import ./modules/home-manager.nix { snegLib = self.lib; };
# Runs mcphub as a user service, folding in the `programs.mcp` config file
# home-manager already writes. Independent of the module above — that one
# writes `programs.mcp.servers`, this one merges the file it generates
# into the hub's own settings — so import either or both.
homeManagerModules.mcphub = import ./modules/mcphub.nix { overlay = self.overlays.default; };
# The hyperframes CLI, with its skills installed as a Claude Code and/or
# Codex plugin — see ./modules/hyperframes.nix for why not plain skills.
homeManagerModules.hyperframes = import ./modules/hyperframes.nix {
overlay = self.overlays.default;
};
packages = forAllSystems (
pkgs:
let
# Read the packages back out of the overlay's fixed point, so one
# package may depend on another from this set. The second call is
# used only for its attribute *names* — the derivations under them
# are never forced, so there is no circularity here.
extended = pkgs.extend self.overlays.default;
names = lib.attrNames (
import ./pkgs {
final = pkgs;
prev = pkgs;
inherit inputs;
}
);
in
lib.getAttrs names extended // { default = extended.deplexity; }
);
# `nix flake check` builds every package for the current system, plus the
# composed MCP config, which is where module-level mistakes surface.
checks = forAllSystems (
pkgs:
self.packages.${pkgs.stdenv.hostPlatform.system}
// {
mcp-servers = import ./tests/mcp-servers.nix {
inherit pkgs;
snegLib = self.lib;
};
mcp-home-manager = import ./tests/home-manager.nix {
inherit pkgs;
snegLib = self.lib;
};
# Not `mcphub`: `packages.<system>.mcphub` is already in this set, and
# the `//` would silently drop the package in favour of its test.
mcphub-module = import ./tests/mcphub-module.nix { inherit pkgs; };
hyperframes-module = import ./tests/hyperframes-module.nix {
inherit pkgs;
overlay = self.overlays.default;
};
}
);
formatter = forAllSystems (pkgs: pkgs.nixfmt-tree);
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = [
pkgs.nix-update
pkgs.nix-init
pkgs.nixfmt-tree
];
};
});
};
}