remove reliance on nh for most things

This commit is contained in:
atagen 2025-06-20 12:54:21 +10:00
parent 56d0dc028f
commit 1a2ca2dcbd
7 changed files with 242 additions and 318 deletions

View file

@ -1,6 +1,6 @@
{
ocamlPackages,
ocaml-deps,
buildInputs,
git,
version,
...
@ -12,6 +12,6 @@ ocamlPackages.buildDunePackage {
minimalOCamlVersion = "5.2";
src = ./..;
nativeBuildInputs = [git];
buildInputs = ocaml-deps;
nativeBuildInputs = [ git ];
inherit buildInputs;
}

View file

@ -1,30 +0,0 @@
{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkOption types;
cfg = config.programs.meat;
in {
options.programs.meat = {
enable = mkEnableOption "meat";
flake = mkOption {
type = with types; nullOr (either path str);
default = null;
description = "path to your system flake";
};
};
config = let
inherit (pkgs) meat nh lix;
in
lib.mkIf
cfg.enable
{
environment.systemPackages = [meat nh lix];
environment.sessionVariables.NH_FLAKE =
if (cfg.flake == null)
then abort "Please set the programs.meat.flake option to your system flake."
else config.programs.meat.flake;
};
}

View file

@ -1,7 +1,30 @@
{
meatOverlays,
lixModule,
}: {
imports = [./meat-module.nix lixModule];
nixpkgs.overlays = meatOverlays;
pkgs,
lib,
config,
...
}:
let
inherit (lib) mkEnableOption mkOption types;
cfg = config.programs.meat;
in
{
options.programs.meat = {
enable = mkEnableOption "meat";
flake = mkOption {
type = with types; either path str;
description = "path to your system flake";
};
package = mkOption {
type = types.package;
description = "your ideal meat";
};
};
config = lib.mkIf cfg.enable {
environment.sessionVariables.MEATS = cfg.flake;
environment.systemPackages = [
cfg.package
pkgs.nh # for now..
];
};
}