From 473cc7dea062cb5bdb2151a73803e11098ae23f7 Mon Sep 17 00:00:00 2001 From: Taeer Bar-Yam Date: Wed, 25 Sep 2024 00:40:53 -0400 Subject: [PATCH] take bleeding edge pixelfed --- fediversity/pixelfed.nix | 4 ---- flake.lock | 36 +++++++++++++++++++++++++++++++- flake.nix | 44 +++++++++++++++++++++++++++++++++++---- tests/mastodon-garage.nix | 2 +- 4 files changed, 76 insertions(+), 10 deletions(-) diff --git a/fediversity/pixelfed.nix b/fediversity/pixelfed.nix index 894b99d..cef5d6d 100644 --- a/fediversity/pixelfed.nix +++ b/fediversity/pixelfed.nix @@ -80,9 +80,5 @@ lib.mkIf (config.fediversity.enable && config.fediversity.pixelfed.enable) { after = [ "ensure-garage.service" ]; }; - services.pixelfed.package = pkgs.pixelfed.overrideAttrs (old: { - patches = (old.patches or [ ]) ++ [ ./pixelfed-group-permissions.patch ]; - }); - networking.firewall.allowedTCPPorts = [ 80 443 ]; } diff --git a/flake.lock b/flake.lock index 60b501f..d25c01c 100644 --- a/flake.lock +++ b/flake.lock @@ -16,9 +16,43 @@ "type": "github" } }, + "nixpkgs-latest": { + "locked": { + "lastModified": 1727220152, + "narHash": "sha256-6ezRTVBZT25lQkvaPrfJSxYLwqcbNWm6feD/vG1FO0o=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "24959f933187217890b206788a85bfa73ba75949", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "pixelfed": { + "flake": false, + "locked": { + "lastModified": 1719823820, + "narHash": "sha256-CKjqnxp7p2z/13zfp4HQ1OAmaoUtqBKS6HFm6TV8Jwg=", + "owner": "pixelfed", + "repo": "pixelfed", + "rev": "4c245cf429330d01fcb8ebeb9aa8c84a9574a645", + "type": "github" + }, + "original": { + "owner": "pixelfed", + "ref": "v0.12.3", + "repo": "pixelfed", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-latest": "nixpkgs-latest", + "pixelfed": "pixelfed" } } }, diff --git a/flake.nix b/flake.nix index 5950b6b..2a8a17b 100644 --- a/flake.nix +++ b/flake.nix @@ -3,15 +3,32 @@ inputs = { nixpkgs.url = "github:radvendii/nixpkgs/nixos_rebuild_tests"; + nixpkgs-latest.url = "github:nixos/nixpkgs"; + pixelfed = { + url = "github:pixelfed/pixelfed?ref=v0.12.3"; + flake = false; + }; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, nixpkgs-latest, pixelfed }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; + pkgsLatest = nixpkgs-latest.legacyPackages.${system}; + bleedingFediverseOverlay = (self: super: { + services.pixelfed.package = pkgsLatest.pixelfed.overrideAttrs (old: { + src = pixelfed; + patches = (old.patches or [ ]) ++ [ ./pixelfed-group-permissions.patch ]; + }); + ## TODO: give mastodon, peertube the same treatment + }); in { nixosModules = { + ## Bleeding-edge fediverse packages + bleedingFediverse = { + nixpkgs.overlays = [ bleedingFediverseOverlay ]; + }; ## Fediversity modules fediversity = import ./fediversity; @@ -26,22 +43,41 @@ nixosConfigurations = { mastodon = nixpkgs.lib.nixosSystem { inherit system; - modules = with self.nixosModules; [ fediversity interactive-vm garage-vm mastodon-vm ]; + modules = with self.nixosModules; [ + bleedingFediverse + fediversity + interactive-vm + garage-vm + mastodon-vm + ]; }; peertube = nixpkgs.lib.nixosSystem { inherit system; - modules = with self.nixosModules; [ fediversity interactive-vm garage-vm peertube-vm ]; + modules = with self.nixosModules; [ + bleedingFediverse + fediversity + interactive-vm + garage-vm + peertube-vm + ]; }; pixelfed = nixpkgs.lib.nixosSystem { inherit system; - modules = with self.nixosModules; [ fediversity interactive-vm garage-vm pixelfed-vm ]; + modules = with self.nixosModules; [ + bleedingFediverse + fediversity + interactive-vm + garage-vm + pixelfed-vm + ]; }; all = nixpkgs.lib.nixosSystem { inherit system; modules = with self.nixosModules; [ + bleedingFediverse fediversity interactive-vm garage-vm diff --git a/tests/mastodon-garage.nix b/tests/mastodon-garage.nix index ef53c6a..c02fe7d 100644 --- a/tests/mastodon-garage.nix +++ b/tests/mastodon-garage.nix @@ -37,7 +37,7 @@ pkgs.nixosTest { nodes = { server = { config, ... }: { virtualisation.memorySize = lib.mkVMOverride 4096; - imports = with self.nixosModules; [ garage-vm mastodon-vm ]; + imports = with self.nixosModules; [ bleedingFediverse garage-vm mastodon-vm ]; # TODO: pair down environment.systemPackages = with pkgs; [ python3