Our Personal Data Server from scratch!
tranquil.farm
oauth
atproto
pds
rust
postgresql
objectstorage
fun
1{
2 inputs = {
3 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
4
5 # tranquil frontend uses deno as its package manager and build time runtime.
6 # nixpkgs does not have deno support yet but its being worked on in https://github.com/NixOS/nixpkgs/pull/419255
7 # for now we important that PR as well purely for its fetchDenoDeps
8 nixpkgs-fetch-deno.url = "github:aMOPel/nixpkgs/feat/fetchDenoDeps";
9 };
10
11 outputs = {
12 self,
13 nixpkgs,
14 ...
15 } @ inputs: let
16 forAllSystems = function:
17 nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
18 system: (function system nixpkgs.legacyPackages.${system})
19 );
20 in {
21 packages = forAllSystems (system: pkgs: {
22 tranquil-pds = pkgs.callPackage ./default.nix {};
23 tranquil-frontend = pkgs.callPackage ./frontend.nix {
24 inherit (inputs.nixpkgs-fetch-deno.legacyPackages.${system}) fetchDenoDeps;
25 };
26 default = self.packages.${pkgs.stdenv.hostPlatform.system}.tranquil-pds;
27 });
28
29 devShells = forAllSystems (system: pkgs: {
30 default = pkgs.callPackage ./shell.nix {};
31 });
32
33 nixosModules = {
34 default = self.nixosModules.tranquil-pds;
35 tranquil-pds = {
36 _file = "${self.outPath}/flake.nix#nixosModules.tranquil-pds";
37 imports = [(import ./module.nix self)];
38 };
39 };
40
41 checks.x86_64-linux.integration = import ./test.nix {
42 pkgs = nixpkgs.legacyPackages.x86_64-linux;
43 inherit self;
44 };
45
46 checks.aarch64-linux.integration = import ./test.nix {
47 pkgs = nixpkgs.legacyPackages.aarch64-linux;
48 inherit self;
49 };
50 };
51}