X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=flakes%2Fpeertube%2Fflake.nix;h=9a5c55746353b1c32d3ef5eadfa806c8f62d8370;hp=2a594c0ea8be099325532059b96d5de56aba91c8;hb=5e2ec9fb8628136e7f9f618c68c0e42ab086b80e;hpb=dfe02d8fd52e33c7d4e1a209cf486696100b88f3 diff --git a/flakes/peertube/flake.nix b/flakes/peertube/flake.nix index 2a594c0..9a5c557 100644 --- a/flakes/peertube/flake.nix +++ b/flakes/peertube/flake.nix @@ -14,7 +14,6 @@ outputs = { self, myuids, nixpkgs, peertube, flake-utils }: flake-utils.lib.eachSystem ["x86_64-linux"] (system: let - version = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.peertube.locked.rev; pkgs = import nixpkgs { inherit system; overlays = [ (self: super: { nodejs = self.nodejs-12_x; }) ]; }; @@ -22,7 +21,7 @@ patchedSource = stdenv.mkDerivation { pname = "peertube"; - inherit version; + version = peertube.rev; src = peertube; phases = [ "unpackPhase" "patchPhase" "installPhase" ]; patches = [ ./fix_yarn_lock.patch ]; @@ -71,55 +70,16 @@ }); server = callPackage ./server.nix { - inherit version yarnModulesConfig mkYarnModules'; + inherit yarnModulesConfig mkYarnModules'; sources = patchedSource; }; client = callPackage ./client.nix { - inherit server version yarnModulesConfig mkYarnModules'; + inherit server yarnModulesConfig mkYarnModules'; sources = patchedSource; }; in rec { - packages.peertube = stdenv.mkDerivation rec { - inherit version; - pname = "peertube"; - src = patchedSource; - buildPhase = '' - ln -s ${server.modules}/node_modules . - rm -rf dist && cp -a ${server.dist}/dist dist - rm -rf client/dist && cp -a ${client.dist}/dist client/ - ''; - installPhase = '' - mkdir $out - cp -a * $out - ln -s /tmp $out/.cache - ''; - - meta = { - description = "A free software to take back control of your videos"; - - longDescription = '' - PeerTube aspires to be a decentralized and free/libre alternative to video - broadcasting services. - PeerTube is not meant to become a huge platform that would centralize - videos from all around the world. Rather, it is a network of - inter-connected small videos hosters. - Anyone with a modicum of technical skills can host a PeerTube server, aka - an instance. Each instance hosts its users and their videos. In this way, - every instance is created, moderated and maintained independently by - various administrators. - You can still watch from your account videos hosted by other instances - though if the administrator of your instance had previously connected it - with other instances. - ''; - - license = stdenv.lib.licenses.agpl3Plus; - - homepage = "https://joinpeertube.org/"; - - platforms = stdenv.lib.platforms.unix; - }; - }; + packages.peertube = callPackage ./. { inherit server client; src = patchedSource; }; defaultPackage = packages.peertube; legacyPackages.peertube = packages.peertube; checks = { @@ -196,7 +156,13 @@ }; }; } - ) // { + ) // rec { + overlays = { + peertube = final: prev: { + peertube = self.defaultPackage."${final.system}"; + }; + }; + overlay = overlays.peertube; nixosModule = { lib, pkgs, config, ... }: let name = "peertube";