From c34009f099f0c159f4705c9616ec72a59b8d9acf Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 11 Jan 2023 02:23:06 +0100 Subject: [PATCH] packages: build with dream2nix flake-parts module --- packages/projects.nix | 54 ++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/packages/projects.nix b/packages/projects.nix index e0c27fe..9c76885 100644 --- a/packages/projects.nix +++ b/packages/projects.nix @@ -1,4 +1,4 @@ -{ inputs, self, ... }: +{ lib, inputs, self, ... }: { imports = [ @@ -12,39 +12,43 @@ ./websites/landing/project.nix ./websites/stop-using-nix-env/project.nix ]; - perSystem = { filters, pkgs, self', ... }: + dream2nix.config = { + projectRoot = ./.; + overridesDirs = [ ./dream2nix-overrides ]; + }; + perSystem = { config, filters, pkgs, self', ... }: let inherit (self'.packages) nix-super; pins = import ./sources; - - dream2nix = inputs.dream2nix.lib2.init { - inherit pkgs; - config = { - projectRoot = ./.; - overridesDirs = [ ./dream2nix-overrides ]; - }; - }; in { + dream2nix = { + inputs = filters.doFilter filters.packages { + uptime-kuma = { + source = pins.uptime-kuma; + projects.uptime-kuma = { + subsystem = "nodejs"; + translator = "package-lock"; + }; + }; + excalidraw = { + source = pins.excalidraw; + projects.excalidraw = { + subsystem = "nodejs"; + translator = "yarn-lock"; + }; + }; + }; + }; + packages = filters.doFilter filters.packages rec { + cinny = pkgs.callPackage ./web-apps/cinny { inherit pins; }; excalidraw = let - dream = dream2nix.dream2nix-interface.makeOutputs { - source = pins.excalidraw; - }; - inherit (dream.packages) excalidraw; - in - excalidraw // { webroot = "${excalidraw}/${excalidraw.webPath}"; }; - - uptime-kuma = let - dream = dream2nix.dream2nix-interface.makeOutputs { - source = pins.uptime-kuma; - }; - inherit (dream.packages) uptime-kuma; - in - uptime-kuma; + inherit (config.dream2nix.outputs.excalidraw.packages) excalidraw; + in excalidraw // { webroot = "${excalidraw}/${excalidraw.webPath}"; }; grafana = pkgs.callPackage ./monitoring/grafana { }; @@ -69,6 +73,8 @@ searxng = pkgs.callPackage ./web-apps/searxng { inherit pins; }; stevenblack-hosts = pkgs.callPackage ./data/stevenblack { inherit pins; }; + + inherit (config.dream2nix.outputs.uptime-kuma.packages) uptime-kuma; }; projectShells = {