-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathflake.nix
69 lines (66 loc) · 1.75 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
rec {
description = "headplane";
inputs = {
devshell = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:numtide/devshell";
};
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = {
devshell,
flake-utils,
nixpkgs,
...
}:
flake-utils.lib.eachSystem [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
]
(system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
in rec {
formatter = pkgs.alejandra;
packages = {
headplane = pkgs.callPackage ./nix/package.nix {};
headplane-agent = pkgs.callPackage ./nix/agent.nix {};
};
checks.default = pkgs.symlinkJoin {
name = "headplane-with-agent";
paths = [packages.headplane packages.headplane-agent];
};
devShells.default = pkgs.devshell.mkShell rec {
name = description;
motd = let
providedPackages = pkgs.lib.concatStringsSep "\n" (
pkgs.lib.map
(pkg: "\t* ${pkgs.lib.getName pkg}")
(pkgs.lib.reverseList packages)
);
in ''
Entered '${description}' development environment.
Provided packages:
${providedPackages}
'';
packages = [
pkgs.go
pkgs.nodejs-slim_22
pkgs.pnpm_10
pkgs.typescript-language-server
];
env = [];
};
})
// {
overlays.default = final: prev: {
headplane = final.callPackage ./nix/package.nix {};
headplane-agent = final.callPackage ./nix/agent.nix {};
};
nixosModules.headplane = import ./nix/module.nix;
};
}