forked from theDakshJaitly/mex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (66 loc) · 2.22 KB
/
flake.nix
File metadata and controls
77 lines (66 loc) · 2.22 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
{
description = "mex - CLI engine for scaffold drift detection, pre-analysis, and targeted sync";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.buildNpmPackage {
pname = "mex";
version = "0.3.2";
src = ./.;
# Update this hash when package-lock.json changes:
# nix build 2>&1 | grep 'got:' | awk '{print $2}'
npmDepsHash = "sha256-5gqoL5TeF7giN/qM7VfqY33rutlkmnIbq6FYPBTF3QE=";
npmBuildScript = "build";
# Ensure templates directory is included
postInstall = ''
mkdir -p $out/lib/node_modules/mex-agent/templates
cp -r templates/* $out/lib/node_modules/mex-agent/templates/
'';
meta = with pkgs.lib; {
description = "CLI engine for mex scaffold — drift detection, pre-analysis, and targeted sync";
homepage = "https://github.com/theDakshJaitly/mex";
license = licenses.mit;
mainProgram = "mex";
platforms = supportedSystems;
};
};
});
overlays.default = final: prev: {
mex = self.packages.${final.system}.default;
};
nixosModules.default = { config, lib, pkgs, ... }:
let
cfg = config.programs.mex;
in
{
options.programs.mex = {
enable = lib.mkEnableOption "mex - scaffold drift detection CLI";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ self.packages.${pkgs.system}.default ];
};
};
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs_22
];
};
});
};
}