simple-nixos-fediverse/flake.nix

94 lines
2.3 KiB
Nix

{
description = "Testing mastodon configurations";
inputs = {
nixpkgs.url = "github:radvendii/nixpkgs/nixos_rebuild_tests";
};
outputs = inputs@{ self, nixpkgs }:
let
system = "x86_64-linux";
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 = self.packages.${pkgs.stdenv.hostPlatform.system}.pixelfed;
};
## VM-specific modules
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 = {
mastodon = nixpkgs.lib.nixosSystem {
inherit system;
modules = with self.nixosModules; [ fediversity interactive-vm mastodon-vm ];
};
peertube = nixpkgs.lib.nixosSystem {
inherit system;
modules = with self.nixosModules; [ fediversity interactive-vm peertube-vm ];
};
pixelfed = nixpkgs.lib.nixosSystem {
inherit system;
modules = with self.nixosModules; [ fediversity interactive-vm pixelfed-vm ];
};
all = nixpkgs.lib.nixosSystem {
inherit system;
modules = with self.nixosModules; [
fediversity
interactive-vm
peertube-vm
pixelfed-vm
mastodon-vm
];
};
};
checks.${system} = {
mastodon-garage = import ./tests/mastodon-garage.nix { inherit pkgs self; };
pixelfed-garage = import ./tests/pixelfed-garage.nix { inherit pkgs self; };
};
devShells.${system}.default = pkgs.mkShell {
inputs = with pkgs; [
nil
];
};
};
}