-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
132 lines (122 loc) · 3.53 KB
/
Copy pathflake.nix
File metadata and controls
132 lines (122 loc) · 3.53 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
{
description = "devman - DevEnv project templating system for NixOS";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
devenv = {
url = "github:cachix/devenv";
inputs.nixpkgs.follows = "nixpkgs";
};
codex-cli = {
url = "github:sadjow/codex-cli-nix?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
claude-code = {
url = "github:sadjow/claude-code-nix?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, devenv, codex-cli, claude-code, ... }:
let
lib = nixpkgs.lib;
mkDevmanCore = system:
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python313;
in
python.pkgs.buildPythonApplication {
pname = "devman";
version = "0.2.0";
format = "pyproject";
src = ./.;
nativeBuildInputs = with python.pkgs; [
hatchling
];
propagatedBuildInputs = with python.pkgs; [
typer
rich
pathlib-abc
pydantic
pyyaml
tomli-w
];
doCheck = false;
meta = with pkgs.lib; {
description = "DevEnv project templating system for NixOS development environments";
homepage = "https://github.com/Bullish-Design/devman";
license = licenses.mit;
maintainers = [ ];
mainProgram = "devman";
};
};
mkDevmanEnv = {
system,
withCodexCli ? true,
withClaudeCode ? true,
}:
let
pkgs = nixpkgs.legacyPackages.${system};
devman-core = mkDevmanCore system;
toolPaths = [
devman-core
]
++ lib.optional withCodexCli codex-cli.packages.${system}.default
++ lib.optional withClaudeCode claude-code.packages.${system}.default;
description = "devman with codex-cli and claude-code";
in
pkgs.buildEnv {
name = "devman-env";
paths = toolPaths;
meta = {
inherit description;
mainProgram = "devman";
};
};
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
packages = forAllSystems (system:
let
devman-core = mkDevmanCore system;
in
({
devman = devman-core;
devman-tools = mkDevmanEnv { inherit system; };
default = mkDevmanEnv { inherit system; };
codex-cli = codex-cli.packages.${system}.default;
claude-code = claude-code.packages.${system}.default;
})
);
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
inputs = {
inherit nixpkgs devenv codex-cli claude-code;
};
in
{
default = devenv.lib.mkShell {
inherit pkgs;
modules = [
{ _module.args = { inherit inputs; }; }
./devenv.nix
];
};
}
);
homeManagerModules.default = { config, lib, pkgs, ... }: {
options.programs.devman = {
enable = lib.mkEnableOption "devman";
};
config = lib.mkIf config.programs.devman.enable {
home.packages = [ self.packages.${pkgs.system}.default ];
};
};
lib.mkDevmanEnv = mkDevmanEnv;
};
}