add doctrine
This commit is contained in:
parent
1c7810a49e
commit
26619394f4
12
doctrine/default.nix
Normal file
12
doctrine/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
pkgs,
|
||||
namespace,
|
||||
}: let
|
||||
doctrine = {
|
||||
lib = import ./lib {inherit lib pkgs doctrine;};
|
||||
prefix = "trivium";
|
||||
inherit namespace;
|
||||
};
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
doctrine
|
10
doctrine/lib/default.nix
Normal file
10
doctrine/lib/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
lib,
|
||||
doctrine,
|
||||
pkgs,
|
||||
}: let
|
||||
close = f: args: f (args // {inherit lib pkgs doctrine;});
|
||||
in {
|
||||
importAll = pkgs.callPackage ./importAll.nix {};
|
||||
mkModule = close (import ./mk-module.nix);
|
||||
}
|
38
doctrine/lib/mk-module.nix
Normal file
38
doctrine/lib/mk-module.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
name,
|
||||
hm ? null,
|
||||
sys ? null,
|
||||
options ? null,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
doctrine,
|
||||
}: let
|
||||
optionsSet = import options {
|
||||
inherit config lib pkgs cfg name doctrine;
|
||||
};
|
||||
|
||||
configSet = import configFiles.${doctrine.namespace} {
|
||||
inherit config lib pkgs doctrine cfg;
|
||||
};
|
||||
|
||||
configFiles = lib.filterAttrs (k: v: v != null) {
|
||||
inherit sys hm;
|
||||
};
|
||||
|
||||
cfg = config.${doctrine.prefix}.${name};
|
||||
in {
|
||||
config =
|
||||
lib.optionalAttrs (configFiles ? ${doctrine.namespace})
|
||||
(lib.mkIf cfg.enable configSet);
|
||||
|
||||
options = lib.optionalAttrs (options
|
||||
!= null
|
||||
&& optionsSet ? ${doctrine.namespace}) {
|
||||
${doctrine.prefix}.${name} =
|
||||
optionsSet.${doctrine.namespace}
|
||||
// {
|
||||
enable = lib.mkEnableOption name;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -45,8 +45,8 @@
|
|||
trivium = overlay;
|
||||
};
|
||||
|
||||
homeManagerModules.default = ./hm;
|
||||
nixosModules.default = ./nixos;
|
||||
homeManagerModules.default = ./modules;
|
||||
nixosModules.default = ./modules;
|
||||
|
||||
lib = {
|
||||
mkSystemFlake = {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{}
|
3
modules/default.nix
Normal file
3
modules/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
imports = [];
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [];
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{callPackage}: {
|
||||
importAll = callPackage ./importAll.nix {};
|
||||
}
|
|
@ -4,9 +4,8 @@
|
|||
nodePackages,
|
||||
lib,
|
||||
writeShellScriptBin,
|
||||
pkgs
|
||||
}:
|
||||
let
|
||||
pkgs,
|
||||
}: let
|
||||
schemaEngine = "${pkgs.prisma-engines}/bin/schema-engine";
|
||||
queryEngineBin = "${pkgs.prisma-engines}/bin/query-engine";
|
||||
queryEngineLib = "${pkgs.prisma-engines}/lib/libquery_engine.node";
|
||||
|
|
Loading…
Reference in a new issue