From a4fedcbc449471df6ba4bbcf5d85054adb209e48 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 23 Sep 2024 11:48:17 +0200 Subject: [PATCH 1/4] nixosModules: Preserve file name import drops it --- flake.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 737ad31..55fde29 100644 --- a/flake.nix +++ b/flake.nix @@ -13,13 +13,13 @@ nixosModules = { ## Fediversity modules - fediversity = import ./fediversity; + fediversity = ./fediversity; ## VM-specific modules - interactive-vm = import ./vm/interactive-vm.nix; - mastodon-vm = import ./vm/mastodon-vm.nix; - peertube-vm = import ./vm/peertube-vm.nix; - pixelfed-vm = import ./vm/pixelfed-vm.nix; + interactive-vm = ./vm/interactive-vm.nix; + mastodon-vm = ./vm/mastodon-vm.nix; + peertube-vm = ./vm/peertube-vm.nix; + pixelfed-vm = ./vm/pixelfed-vm.nix; }; nixosConfigurations = { -- 2.47.0 From c9bd295faa26e94485233a211285f5ddaa50fba4 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 23 Sep 2024 12:10:30 +0200 Subject: [PATCH 2/4] nixosModules: move pixelfed package definition into flake lexical scope --- fediversity/pixelfed.nix | 3 --- flake.nix | 36 +++++++++++++++++++++++++++++++----- vm/mastodon-vm.nix | 1 - vm/peertube-vm.nix | 1 - vm/pixelfed-vm.nix | 1 - 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/fediversity/pixelfed.nix b/fediversity/pixelfed.nix index 1edc914..1c1646d 100644 --- a/fediversity/pixelfed.nix +++ b/fediversity/pixelfed.nix @@ -59,7 +59,4 @@ 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 ]; - }); } diff --git a/flake.nix b/flake.nix index 55fde29..a655038 100644 --- a/flake.nix +++ b/flake.nix @@ -13,13 +13,39 @@ nixosModules = { ## Fediversity modules - fediversity = ./fediversity; + fediversity = { + imports = [ ./fediversity ]; + + services.pixelfed.package = pkgs.pixelfed.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ ./fediversity/pixelfed-group-permissions.patch ]; + }); + }; ## VM-specific modules - interactive-vm = ./vm/interactive-vm.nix; - mastodon-vm = ./vm/mastodon-vm.nix; - peertube-vm = ./vm/peertube-vm.nix; - pixelfed-vm = ./vm/pixelfed-vm.nix; + interactive-vm = { + imports = [ + ./vm/interactive-vm.nix + self.nixosModules.fediversity + ]; + }; + mastodon-vm = { + imports = [ + ./vm/mastodon-vm.nix + self.nixosModules.fediversity + ]; + }; + peertube-vm = { + imports = [ + ./vm/peertube-vm.nix + self.nixosModules.fediversity + ]; + }; + pixelfed-vm = { + imports = [ + ./vm/pixelfed-vm.nix + self.nixosModules.fediversity + ]; + }; }; nixosConfigurations = { diff --git a/vm/mastodon-vm.nix b/vm/mastodon-vm.nix index ea17f27..4b28492 100644 --- a/vm/mastodon-vm.nix +++ b/vm/mastodon-vm.nix @@ -1,7 +1,6 @@ { modulesPath, lib, config, ... }: { imports = [ - ../fediversity (modulesPath + "/virtualisation/qemu-vm.nix") ]; diff --git a/vm/peertube-vm.nix b/vm/peertube-vm.nix index 5f40f4f..b701682 100644 --- a/vm/peertube-vm.nix +++ b/vm/peertube-vm.nix @@ -1,7 +1,6 @@ { pkgs, modulesPath, ... }: { imports = [ - ../fediversity (modulesPath + "/virtualisation/qemu-vm.nix") ]; diff --git a/vm/pixelfed-vm.nix b/vm/pixelfed-vm.nix index 8f97180..3510d0b 100644 --- a/vm/pixelfed-vm.nix +++ b/vm/pixelfed-vm.nix @@ -1,7 +1,6 @@ { pkgs, modulesPath, ... }: { imports = [ - ../fediversity (modulesPath + "/virtualisation/qemu-vm.nix") ]; -- 2.47.0 From 1fc83f6980041c6add47b8dd46758329d5c85842 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 25 Sep 2024 09:42:08 +0200 Subject: [PATCH 3/4] pixelfed: Use package from lock --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index a655038..812c667 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ nixpkgs.url = "github:radvendii/nixpkgs/nixos_rebuild_tests"; }; - outputs = { self, nixpkgs }: + outputs = inputs@{ self, nixpkgs }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; @@ -13,10 +13,10 @@ nixosModules = { ## Fediversity modules - fediversity = { + fediversity = { pkgs, ... }: { imports = [ ./fediversity ]; - services.pixelfed.package = pkgs.pixelfed.overrideAttrs (old: { + services.pixelfed.package = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.pixelfed.overrideAttrs (old: { patches = (old.patches or [ ]) ++ [ ./fediversity/pixelfed-group-permissions.patch ]; }); }; -- 2.47.0 From 114b1d596f08b78a3016baadddfa13e6ed99611b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 25 Sep 2024 13:29:39 +0200 Subject: [PATCH 4/4] Add packages.${system}.pixelfed --- flake.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 812c667..ed9ae3f 100644 --- a/flake.nix +++ b/flake.nix @@ -11,14 +11,17 @@ pkgs = nixpkgs.legacyPackages.${system}; in { + packages.${system} = { + pixelfed = pkgs.pixelfed.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ ./fediversity/pixelfed-group-permissions.patch ]; + }); + }; + nixosModules = { ## Fediversity modules fediversity = { pkgs, ... }: { imports = [ ./fediversity ]; - - services.pixelfed.package = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.pixelfed.overrideAttrs (old: { - patches = (old.patches or [ ]) ++ [ ./fediversity/pixelfed-group-permissions.patch ]; - }); + services.pixelfed.package = self.packages.${pkgs.stdenv.hostPlatform.system}.pixelfed; }; ## VM-specific modules -- 2.47.0