build: 🏗️ Make Nix build great again

This commit is contained in:
Jesse Wierzbinski 2025-04-14 16:51:00 +02:00
parent 1679585c4c
commit 5a4ce29206
No known key found for this signature in database
13 changed files with 6773 additions and 194 deletions

View file

@ -3,55 +3,30 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
flake-utils.url = "github:numtide/flake-utils";
};
nixConfig = {
extra-substituters = [
"https://cache.kyouma.net"
];
extra-trusted-public-keys = [
"cache.kyouma.net:Frjwu4q1rnwE/MnSTmX9yx86GNA/z3p/oElGvucLiZg="
];
};
outputs = { self, nixpkgs, flake-utils, ... }: {
hydraJobs = {
inherit (self) packages;
};
overlays.default = final: prev: {
versiajs = final.callPackage ./nix/package.nix {};
};
} //
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in {
packages = {
inherit (pkgs) versiajs;
default = self.packages.${system}.versiajs;
};
apps.update-modules = {
type = "app";
program = ./nix/update.sh;
};
}) //
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [
bun
nodejs
nodePackages.typescript
nodePackages.typescript-language-server
nix-ld
];
outputs = {
self,
nixpkgs,
flake-utils,
...
}:
{
overlays.default = final: prev: {
versia-server = final.callPackage ./nix/package.nix {};
};
};
});
}
// flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-linux"] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [self.overlays.default];
};
in {
packages = {
inherit (pkgs) versia-server;
default = self.packages.${system}.versia-server;
};
});
}