mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
refactor: flake
This commit is contained in:
parent
4e6e3425ce
commit
f678d51542
45
flake.lock
45
flake.lock
|
|
@ -1,26 +1,30 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-compat": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1710146030,
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
"owner": "numtide",
|
||||||
"revCount": 57,
|
"repo": "flake-utils",
|
||||||
"type": "tarball",
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"owner": "numtide",
|
||||||
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723320709,
|
"lastModified": 1723703277,
|
||||||
"narHash": "sha256-DeKCsLQsS58D8TB/cTjXs2x8XMvsyv2JVxcF0Hu6pu8=",
|
"narHash": "sha256-nk0RaUB5f68BwtXAYy3WAjqFhVKqIl9Z89RGycTa2vk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e1d92cda6fd1bcec60e4938ce92fcee619eea793",
|
"rev": "8b908192e64224420e2d59dfd9b2e4309e154c5d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -32,9 +36,24 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
57
flake.nix
57
flake.nix
|
|
@ -1,37 +1,36 @@
|
||||||
{
|
{
|
||||||
description = "JavaScript example flake for Zero to Nix";
|
description = "Lysand Server";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
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";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-compat }:
|
outputs = { self, nixpkgs, flake-utils }: {
|
||||||
let
|
hydraJobs = {
|
||||||
# Systems supported
|
inherit (self) packages;
|
||||||
allSystems = [
|
|
||||||
"x86_64-linux" # 64-bit Intel/AMD Linux
|
|
||||||
"aarch64-linux" # 64-bit ARM Linux
|
|
||||||
"x86_64-darwin" # 64-bit Intel macOS
|
|
||||||
"aarch64-darwin" # 64-bit ARM macOS
|
|
||||||
];
|
|
||||||
|
|
||||||
# Helper to provide system-specific attributes
|
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
|
|
||||||
pkgs = import nixpkgs { inherit system; };
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
devShells = forAllSystems ({ pkgs }: {
|
|
||||||
default = pkgs.mkShell {
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
bun
|
|
||||||
nodejs
|
|
||||||
nodePackages.typescript
|
|
||||||
nodePackages.typescript-language-server
|
|
||||||
nix-ld
|
|
||||||
];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
} // flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
packages = {
|
||||||
|
versiajs = pkgs.callPackage ./nix/package.nix {};
|
||||||
|
default = self.packages.${system}.versiajs;
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells = {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
bun
|
||||||
|
nodejs
|
||||||
|
nodePackages.typescript
|
||||||
|
nodePackages.typescript-language-server
|
||||||
|
nix-ld
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue