noogle/website/default.nix

40 lines
905 B
Nix
Raw Normal View History

2023-11-29 23:37:07 +03:00
{ floco, system, pkgs, hooks }:
2023-11-23 14:31:33 +03:00
let
inherit (floco) lib;
2023-11-28 19:28:51 +03:00
pjs =
let
msg = "default.nix: Expected to find `package.json' to lookup "
+ "package name/version, but no such file exists at: "
+ (toString ./package.json);
in
if builtins.pathExists ./package.json then
lib.importJSON ./package.json
else
throw msg;
2023-11-23 14:31:33 +03:00
ident = pjs.name;
inherit (pjs) version;
fmod = lib.evalModules {
modules = [
floco.nixosModules.floco
{
config.floco.settings = {
inherit system;
2023-12-01 11:13:59 +03:00
nodePackage = pkgs.nodejs_20;
2023-11-23 14:31:33 +03:00
basedir = ./.;
};
}
./nix/floco-cfg.nix
];
2023-11-29 23:37:07 +03:00
specialArgs = { inherit pkgs hooks; };
2023-11-23 14:31:33 +03:00
};
# This attrset holds a few derivations related to our package.
# We'll expose these below to the CLI.
pkg = fmod.config.floco.packages.${ident}.${version};
2023-11-28 19:28:51 +03:00
in
{ inherit pkg fmod; }