tachikoma/flake.nix
2024-04-06 14:59:57 -04:00

81 lines
2.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, ...} @ inputs: let
systems = [
"aarch64-linux"
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in rec {
devShells = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
buildInputs = with pkgs; [
just
];
};
});
nixosModules = rec {
default = enableTachikoma;
enableTachikoma = { pkgs, ...}: {
services.akkoma.package = packages.${pkgs.system}.akkoma.tachikoma;
services.akkoma.frontends.primary = {
name = "tachikoma-fe";
ref = "stable";
package = packages.${pkgs.system}.akkoma-frontends.tachikoma-fe;
};
};
};
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
in rec {
default = akkoma.tachikoma;
akkoma.tachikoma = let
rev = builtins.readFile ./akkoma/upstream.txt;
in pkgs.akkoma.overrideAttrs (final: prev: {
version = "${rev}+tachikoma";
src = pkgs.fetchFromGitea {
inherit rev;
domain = "akkoma.dev";
owner = "AkkomaGang";
repo = "akkoma";
hash = "sha256-eKvfuHTLmUU6Dom/GctPSbhrAAik1T/7bYY5j3YUkRo=";
};
patches = [
# none yet
];
patchFlags = "-p1 -F5";
});
akkoma-frontends.tachikoma-fe = let
rev = builtins.readFile ./akkoma-fe/upstream.txt;
in pkgs.akkoma-frontends.akkoma-fe.overrideAttrs (final: prev: {
version = "${rev}+tachikoma";
src = pkgs.fetchFromGitea {
inherit rev;
domain = "akkoma.dev";
owner = "AkkomaGang";
repo = "akkoma-fe";
hash = "sha256-Z7psmIyOo8Rvwcip90JgxLhZ5SkkGB94QInEgm8UOjQ=";
};
patches = [
./akkoma-fe/0001-confirm-favorite.patch
./akkoma-fe/0002-move-notifications.patch
];
patchFlags = "-p1 -F5";
});
});
};
}