smooooth/flake.nix
2025-05-25 20:11:20 +10:00

82 lines
2.0 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nix-systems.url = "github:nix-systems/default-linux";
unf.url = "path:/home/bolt/code/unf";
};
outputs =
inputs:
with inputs;
let
collectPkgs = builtins.attrValues;
forAllSystems =
function:
nixpkgs.lib.genAttrs (import nix-systems) (system: function nixpkgs.legacyPackages.${system});
deps = forAllSystems (pkgs: {
dev = collectPkgs {
inherit (pkgs) just;
inherit (pkgs.ocamlPackages)
utop
dune_3
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
;
};
build =
collectPkgs {
inherit (pkgs.ocamlPackages)
ocaml
lwt
lwt_ppx
inotify
angstrom
systemd
yojson
ppx_deriving_yojson
;
}
++ [ self.packages.${pkgs.system}.obus ];
});
in
{
devShells = forAllSystems (pkgs: {
default = import ./shell.nix {
inherit pkgs;
deps = deps.${pkgs.system};
};
});
packages = forAllSystems (pkgs: {
default = pkgs.callPackage ./default.nix {
buildInputs = deps.${pkgs.system}.build;
};
obus = pkgs.callPackage ./nix/obus.nix { };
docs = pkgs.callPackage unf.lib.pak-chooie {
inherit self;
projectName = "smooooth";
newPath = "https://git.atagen.co/atagen/smooooth/src";
modules = [
./nix/interface.nix
./nix/impl.nix
];
};
});
nixosModules.smooooth =
{
pkgs,
lib,
...
}:
{
imports = [
./nix/interface.nix
./nix/impl.nix
];
services.smooooth.package = self.packages.${pkgs.system}.default;
};
};
}