2024-02-22 10:56:31 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-08-28 14:39:36 +02:00
|
|
|
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;
|
|
|
|
};
|
2024-10-01 10:02:01 +02:00
|
|
|
disko.url = "github:nix-community/disko";
|
2024-02-22 10:56:31 +01:00
|
|
|
};
|
|
|
|
|
2024-10-01 10:02:01 +02:00
|
|
|
outputs = { self, nixpkgs, nixpkgs-latest, pixelfed, disko }:
|
2024-02-22 10:56:31 +01:00
|
|
|
let
|
|
|
|
system = "x86_64-linux";
|
2024-10-01 10:02:01 +02:00
|
|
|
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 {
|
2024-06-25 12:39:04 +02:00
|
|
|
nixosModules = {
|
2024-09-25 06:40:53 +02:00
|
|
|
## Bleeding-edge fediverse packages
|
|
|
|
bleedingFediverse = {
|
|
|
|
nixpkgs.overlays = [ bleedingFediverseOverlay ];
|
|
|
|
};
|
2024-09-17 14:24:23 +02:00
|
|
|
## Fediversity modules
|
2024-09-17 14:30:59 +02:00
|
|
|
fediversity = import ./fediversity;
|
2024-09-17 14:24:23 +02:00
|
|
|
|
|
|
|
## 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;
|
2024-09-17 14:24:23 +02:00
|
|
|
mastodon-vm = import ./vm/mastodon-vm.nix;
|
|
|
|
peertube-vm = import ./vm/peertube-vm.nix;
|
|
|
|
pixelfed-vm = import ./vm/pixelfed-vm.nix;
|
2024-10-01 10:02:01 +02:00
|
|
|
|
|
|
|
disk-layout = import ./disk-layout.nix;
|
2024-06-25 12:39:04 +02:00
|
|
|
};
|
|
|
|
|
2024-02-22 10:56:31 +01:00
|
|
|
nixosConfigurations = {
|
|
|
|
mastodon = nixpkgs.lib.nixosSystem {
|
|
|
|
inherit system;
|
2024-10-01 13:14:56 +02:00
|
|
|
modules = with self.nixosModules; [
|
2024-10-01 10:02:01 +02:00
|
|
|
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; [
|
2024-10-01 10:02:01 +02:00
|
|
|
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; [
|
2024-10-01 10:02:01 +02:00
|
|
|
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;
|
2024-08-28 14:35:48 +02:00
|
|
|
modules = with self.nixosModules; [
|
2024-10-01 10:02:01 +02:00
|
|
|
disko.nixosModules.default
|
|
|
|
disk-layout
|
2024-09-25 06:40:53 +02:00
|
|
|
bleedingFediverse
|
2024-09-17 14:30:59 +02:00
|
|
|
fediversity
|
2024-08-28 14:35:48 +02:00
|
|
|
interactive-vm
|
2024-09-24 14:40:35 +02:00
|
|
|
garage-vm
|
2024-09-17 14:30:59 +02:00
|
|
|
peertube-vm
|
|
|
|
pixelfed-vm
|
|
|
|
mastodon-vm
|
2024-08-28 14:35:48 +02:00
|
|
|
];
|
2024-03-20 01:39:59 +01:00
|
|
|
};
|
2024-02-22 10:56:31 +01:00
|
|
|
};
|
|
|
|
|
2024-10-01 13:14:56 +02:00
|
|
|
## Fully-feature ISO installer
|
|
|
|
mkInstaller = import ./installer.nix;
|
|
|
|
installers = lib.mapAttrs (_: config: self.mkInstaller nixpkgs config) self.nixosConfigurations;
|
2024-10-01 10:02:01 +02:00
|
|
|
|
|
|
|
deploy =
|
|
|
|
let
|
|
|
|
deployCommand = (pkgs.callPackage ./deploy.nix { });
|
|
|
|
in
|
|
|
|
lib.mapAttrs (name: config: deployCommand name config) self.nixosConfigurations;
|
|
|
|
|
2024-06-25 12:39:04 +02:00
|
|
|
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-06-25 12:39:04 +02:00
|
|
|
};
|
|
|
|
|
2024-02-22 10:56:31 +01:00
|
|
|
devShells.${system}.default = pkgs.mkShell {
|
|
|
|
inputs = with pkgs; [
|
|
|
|
nil
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|