first release

This commit is contained in:
atagen 2024-11-23 16:49:05 +11:00
commit 3393f1ecfe
16 changed files with 615 additions and 0 deletions

18
nix/default.nix Normal file
View file

@ -0,0 +1,18 @@
{
pkgs,
lib,
ocamlPackages,
ocaml-deps,
nh,
nix,
...
}:
ocamlPackages.buildDunePackage {
pname = "meat";
version = "delicious-0.1";
minimalOCamlVersion = "5.2";
src = ./..;
buildInputs = ocaml-deps;
}

30
nix/meat-module.nix Normal file
View file

@ -0,0 +1,30 @@
{
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;
};
}

7
nix/module.nix Normal file
View file

@ -0,0 +1,7 @@
{
meatOverlays,
lixModule,
}: {
imports = [./meat-module.nix lixModule];
nixpkgs.overlays = meatOverlays;
}