Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
52 lines (49 loc) · 1.55 KB
/
Copy pathflake.nix
File metadata and controls
52 lines (49 loc) · 1.55 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
{
description = "Factory program hub — dev shell for tooling (YAML/JSON validation, GitHub CLI, Python linting)";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs =
{ self, nixpkgs }:
let
# The Factory hub is the spec/contract + docs home; this shell carries the
# lightweight tooling the helper scripts and maintenance tasks need, so
# nothing has to be installed system-wide. Add packages here as needed.
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
in
{
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
# Python with the libraries the scripts use (stdlib covers json/urllib;
# pyyaml is needed to validate workflow/compose YAML, requests for HTTP).
pythonEnv = pkgs.python3.withPackages (
ps: with ps; [
pyyaml
requests
]
);
in
{
default = pkgs.mkShell {
packages = [
pythonEnv
pkgs.jq # JSON wrangling
pkgs.yq-go # YAML on the CLI
pkgs.ruff # Python lint/format (matches the repos' gate)
pkgs.gh # GitHub CLI
pkgs.git
pkgs.curl
];
shellHook = ''
echo "Factory dev shell — python3(+pyyaml,requests), jq, yq, ruff, gh"
'';
};
}
);
};
}