Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
54 lines (48 loc) · 1.37 KB
/
Copy pathflake.nix
File metadata and controls
54 lines (48 loc) · 1.37 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
{
description = "Pi coding agent";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# nixpkgs unstable no longer supports Intel macOS. Keep using the final
# Darwin branch that does so for pi's x86_64-darwin package.
nixpkgs-darwin-x64.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin";
};
outputs =
{
self,
nixpkgs,
nixpkgs-darwin-x64,
}:
let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
nixpkgsFor = system: if system == "x86_64-darwin" then nixpkgs-darwin-x64 else nixpkgs;
packageFor =
system:
let
pkgs = import (nixpkgsFor system) { inherit system; };
in
pkgs.callPackage ./nix/package.nix { source = self; };
in
{
packages = forAllSystems (system: {
default = packageFor system;
pi = packageFor system;
});
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/pi";
meta.description = "Pi coding agent";
};
pi = self.apps.${system}.default;
});
overlays.default = final: _previous: {
pi = final.callPackage ./nix/package.nix { source = self; };
};
};
}