-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathflake.nix
More file actions
102 lines (92 loc) · 2.68 KB
/
Copy pathflake.nix
File metadata and controls
102 lines (92 loc) · 2.68 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
{
description = "Octos - Agentic OS";
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
nix-darwin = {
url = "https://flakehub.com/f/nix-darwin/nix-darwin/*";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, ... }@inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import inputs.nixpkgs { inherit system; };
}
);
treefmtEval = forEachSupportedSystem (
{ pkgs, ... }: inputs.treefmt-nix.lib.evalModule pkgs ./nix/treefmt.nix
);
mkModuleWithPackages =
modulePath:
{ pkgs, lib, ... }:
let
inherit (pkgs.stdenv.hostPlatform) system;
in
{
imports = [
(lib.modules.importApply ./nix/modules/options.nix {
inherit (self.packages.${system}) octos;
})
modulePath
];
};
in
{
formatter = forEachSupportedSystem ({ system, ... }: treefmtEval.${system}.config.build.wrapper);
nixosModules.default = mkModuleWithPackages ./nix/modules/nixos.nix;
darwinModules.default = mkModuleWithPackages ./nix/modules/darwin.nix;
devShells = forEachSupportedSystem (
{ pkgs, ... }:
{
default = pkgs.callPackage ./nix/shell.nix { };
}
);
packages = forEachSupportedSystem (
{ pkgs, ... }:
let
octos = pkgs.callPackage ./nix/packages/default.nix { };
in
{
inherit octos;
default = octos;
octos-minimal = octos;
octos-full = octos.override {
enableAllFeatures = true;
enableAppSkills = true;
};
}
);
checks = forEachSupportedSystem (
{ pkgs, ... }:
{
formatting = treefmtEval.${pkgs.system}.config.build.check self;
# Darwin Module Evaluation (Cross-platform)
darwin-module = pkgs.callPackage ./nix/tests/darwin.nix {
inherit (inputs) nix-darwin;
octosModule = self.darwinModules.default;
};
}
// pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
# NixOS VM Test (Linux only, full E2E)
nixos-module-vm = pkgs.callPackage ./nix/tests/nixos.nix {
octosModule = self.nixosModules.default;
};
}
);
};
}