From 6b0374867b7842f565c46cf2ae50f8c3c143c3da Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 10 Aug 2024 17:39:11 +0200 Subject: [PATCH] Update flood derivation --- environments/river/home.nix | 1 + hosts/kadan/hardware-configuration.nix | 2 +- overlays/default.nix | 32 ++++++++++++++++++++++---- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/environments/river/home.nix b/environments/river/home.nix index 4d7d18e..e8e750a 100644 --- a/environments/river/home.nix +++ b/environments/river/home.nix @@ -196,6 +196,7 @@ in { profile.outputs = [ { criteria = "eDP-1"; + status = "enable"; } ]; } diff --git a/hosts/kadan/hardware-configuration.nix b/hosts/kadan/hardware-configuration.nix index c10d87b..8fbd5f3 100644 --- a/hosts/kadan/hardware-configuration.nix +++ b/hosts/kadan/hardware-configuration.nix @@ -110,7 +110,7 @@ # Load nvidia driver for Xorg and Wayland services.xserver.videoDrivers = ["nvidia"]; - virtualisation.docker.enableNvidia = true; + hardware.nvidia-container-toolkit.enable = true; hardware.nvidia = { # Modesetting is required. diff --git a/overlays/default.nix b/overlays/default.nix index 66bb1d7..a486618 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -19,13 +19,37 @@ --add-flags "--ozone-platform=wayland"''; in { # Use my fork of flood to enable smart scripts. - flood = self.pkgs.buildNpmPackage { + flood = self.stdenv.mkDerivation (finalAttrs: { pname = "flood"; - version = "4.8.2"; + version = "4.8.3-dirty"; src = flood; - npmDepsHash = "sha256-md76I7W5QQvfbOmk5ODssMtJAVOj8nvaJ2PakEZ8WUA="; + nativeBuildInputs = with self.pkgs; [ + nodejs + pnpm.configHook + ]; + + pnpmDeps = self.pkgs.pnpm.fetchDeps { + inherit (finalAttrs) pname version src; + hash = "sha256-ez+n4oieARNKCeyCF6L9TJom90QFVZc0oEpkQx/GpWc="; + }; + + buildPhase = '' + runHook preBuild + pnpm build + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/{lib,bin} + cp -r {dist,node_modules} $out/lib + makeWrapper ${self.pkgs.nodejs} $out/bin/flood --add-flags $out/lib/dist/index.js + runHook postInstall + ''; + + dontStrip = true; meta = with self.lib; { description = "A modern web UI for various torrent clients with a Node.js backend and React frontend"; @@ -33,7 +57,7 @@ in { license = licenses.gpl3Only; maintainers = with maintainers; [winter]; }; - }; + }); river = super.river.overrideAttrs { src = river-src;