Fediversity/flake.nix

124 lines
3.3 KiB
Nix
Raw Normal View History

2024-02-22 10:56:31 +01:00
{
inputs = {
nixpkgs.url = "github:radvendii/nixpkgs/nixos_rebuild_tests";
2024-09-25 06:40:53 +02:00
nixpkgs-latest.url = "github:nixos/nixpkgs";
pixelfed = {
url = "github:pixelfed/pixelfed?ref=v0.12.3";
flake = false;
};
disko.url = "github:nix-community/disko";
2024-02-22 10:56:31 +01:00
};
outputs = { self, nixpkgs, nixpkgs-latest, pixelfed, disko }:
2024-02-22 10:56:31 +01:00
let
system = "x86_64-linux";
lib = nixpkgs.lib;
2024-02-22 10:56:31 +01:00
pkgs = nixpkgs.legacyPackages.${system};
2024-09-25 06:40:53 +02:00
pkgsLatest = nixpkgs-latest.legacyPackages.${system};
bleedingFediverseOverlay = (self: super: {
2024-09-25 17:25:21 +02:00
pixelfed = pkgsLatest.pixelfed.overrideAttrs (old: {
2024-09-25 06:40:53 +02:00
src = pixelfed;
2024-09-25 17:25:21 +02:00
patches = (old.patches or [ ]) ++ [ ./fediversity/pixelfed-group-permissions.patch ];
2024-09-25 06:40:53 +02:00
});
## TODO: give mastodon, peertube the same treatment
});
2024-02-22 10:56:31 +01:00
in {
nixosModules = {
2024-09-25 06:40:53 +02:00
## Bleeding-edge fediverse packages
bleedingFediverse = {
nixpkgs.overlays = [ bleedingFediverseOverlay ];
};
## Fediversity modules
fediversity = import ./fediversity;
## VM-specific modules
interactive-vm = import ./vm/interactive-vm.nix;
2024-09-24 14:40:35 +02:00
garage-vm = import ./vm/garage-vm.nix;
mastodon-vm = import ./vm/mastodon-vm.nix;
peertube-vm = import ./vm/peertube-vm.nix;
pixelfed-vm = import ./vm/pixelfed-vm.nix;
disk-layout = import ./disk-layout.nix;
};
2024-02-22 10:56:31 +01:00
nixosConfigurations = {
mastodon = nixpkgs.lib.nixosSystem {
inherit system;
2024-09-25 06:40:53 +02:00
modules = with self.nixosModules; [
disko.nixosModules.default
disk-layout
2024-09-25 06:40:53 +02:00
bleedingFediverse
fediversity
interactive-vm
garage-vm
mastodon-vm
];
2024-03-20 00:43:20 +01:00
};
peertube = nixpkgs.lib.nixosSystem {
inherit system;
2024-09-25 06:40:53 +02:00
modules = with self.nixosModules; [
disko.nixosModules.default
disk-layout
2024-09-25 06:40:53 +02:00
bleedingFediverse
fediversity
interactive-vm
garage-vm
peertube-vm
];
2024-02-22 10:56:31 +01:00
};
2024-03-20 01:39:59 +01:00
pixelfed = nixpkgs.lib.nixosSystem {
inherit system;
2024-09-25 06:40:53 +02:00
modules = with self.nixosModules; [
disko.nixosModules.default
disk-layout
2024-09-25 06:40:53 +02:00
bleedingFediverse
fediversity
interactive-vm
garage-vm
pixelfed-vm
];
2024-03-20 01:39:59 +01:00
};
all = nixpkgs.lib.nixosSystem {
inherit system;
modules = with self.nixosModules; [
disko.nixosModules.default
disk-layout
2024-09-25 06:40:53 +02:00
bleedingFediverse
fediversity
interactive-vm
2024-09-24 14:40:35 +02:00
garage-vm
peertube-vm
pixelfed-vm
mastodon-vm
];
2024-03-20 01:39:59 +01:00
};
2024-02-22 10:56:31 +01:00
};
installers =
let
installer = (import ./installer.nix) nixpkgs;
in
lib.mapAttrs (_: config: installer config) self.nixosConfigurations;
deploy =
let
deployCommand = (pkgs.callPackage ./deploy.nix { });
in
lib.mapAttrs (name: config: deployCommand name config) self.nixosConfigurations;
checks.${system} = {
mastodon-garage = import ./tests/mastodon-garage.nix { inherit pkgs self; };
2024-08-30 17:23:55 +02:00
pixelfed-garage = import ./tests/pixelfed-garage.nix { inherit pkgs self; };
};
2024-02-22 10:56:31 +01:00
devShells.${system}.default = pkgs.mkShell {
inputs = with pkgs; [
nil
];
};
};
}