satisfy nixpkgs pedantry
All checks were successful
Nix Build / nix build (push) Successful in 40s

This commit is contained in:
atagen 2026-01-29 16:18:32 +11:00
parent 0777696090
commit 0fc93545ce

114
flake.nix
View file

@ -13,65 +13,73 @@
collectPkgs = builtins.attrValues;
forEachSystem =
function:
nixpkgs.lib.genAttrs (import nix-systems) (system: function nixpkgs.legacyPackages.${system});
deps = forEachSystem (pkgs: {
build = collectPkgs {
inherit (pkgs.ocamlPackages)
dune_3
ocaml
;
};
dev = collectPkgs {
inherit (pkgs.ocamlPackages)
utop
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
;
};
});
nixpkgs.lib.genAttrs (import nix-systems) (
system: function nixpkgs.legacyPackages.${system} system
);
deps = forEachSystem (
pkgs: _: {
build = collectPkgs {
inherit (pkgs.ocamlPackages)
dune_3
ocaml
;
};
dev = collectPkgs {
inherit (pkgs.ocamlPackages)
utop
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
;
};
}
);
in
{
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
packages = pkgs.lib.mapAttrsToList (_: v: v) deps.${pkgs.system};
shellHook =
let
justFile = ''
default:
@just --list
devShells = forEachSystem (
pkgs: sys: {
default = pkgs.mkShell {
packages = pkgs.lib.mapAttrsToList (_: v: v) deps.${sys};
shellHook =
let
justFile = ''
default:
@just --list
@build:
nix build .#debug --offline
@build:
nix build .#debug --offline
@release:
nix build --offline
@release:
nix build --offline
@test:
printf "\\n\\n\\t************ running nix+dune tests ************\\n\\n\\n"
nix flake check --offline
@test:
printf "\\n\\n\\t************ running nix+dune tests ************\\n\\n\\n"
nix flake check --offline
'';
in
''
printf '${justFile}' > justfile
'';
in
''
printf '${justFile}' > justfile
'';
};
});
};
}
);
packages = forEachSystem (pkgs: {
default = pkgs.callPackage ./nix/default.nix {
buildInputs = deps.${pkgs.system}.build;
inherit version;
};
docs = pkgs.callPackage unf.lib.pak-chooie {
inherit self;
projectName = "meat";
newPath = "https://git.atagen.co/atagen/meat/src";
modules = [
self.nixosModules.meat
];
};
});
packages = forEachSystem (
pkgs: sys: {
default = pkgs.callPackage ./nix/default.nix {
buildInputs = deps.${sys}.build;
inherit version;
};
docs = pkgs.callPackage unf.lib.pak-chooie {
inherit self;
projectName = "meat";
newPath = "https://git.atagen.co/atagen/meat/src";
modules = [
self.nixosModules.meat
];
};
}
);
nixosModules.meat =
{
@ -81,7 +89,7 @@
}:
{
imports = [ ./nix/module.nix ];
programs.meat.package = self.packages.${pkgs.system}.default;
programs.meat.package = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
};
};