Add flake.nix to enable building with Nix
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1766736597,
|
||||||
|
"narHash": "sha256-BASnpCLodmgiVn0M1MU2Pqyoz0aHwar/0qLkp7CjvSQ=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "f560ccec6b1116b22e6ed15f4c510997d99d5852",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-25.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"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",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
27
flake.nix
Normal file
27
flake.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
joann-pupper-bot = pkgs.crystal.buildCrystalPackage {
|
||||||
|
pname = "joann-pupper-bot";
|
||||||
|
version = "0.1.0";
|
||||||
|
src = ./.;
|
||||||
|
lockFile = ./shard.lock;
|
||||||
|
shardsFile = ./shards.nix;
|
||||||
|
format = "shards";
|
||||||
|
buildInputs = [pkgs.sqlite];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = { inherit joann-pupper-bot; };
|
||||||
|
defaultPackage = joann-pupper-bot;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
27
shards.nix
Normal file
27
shards.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"cron_parser" = {
|
||||||
|
url = "https://github.com/kostya/cron_parser.git";
|
||||||
|
rev = "v0.4.0";
|
||||||
|
sha256 = "17fgg2nvyx99v05l10h6cnxfr7swz8yaxhmnk4l47kg2spi8w90a";
|
||||||
|
};
|
||||||
|
"cron_scheduler" = {
|
||||||
|
url = "https://github.com/kostya/cron_scheduler.git";
|
||||||
|
rev = "v0.4.0";
|
||||||
|
sha256 = "0jd0maw1h87hjgjpqhbwxb4yz83g8shlrwfivyf0sd6x3l5lspns";
|
||||||
|
};
|
||||||
|
"db" = {
|
||||||
|
url = "https://github.com/crystal-lang/crystal-db.git";
|
||||||
|
rev = "v0.14.0";
|
||||||
|
sha256 = "1s67fs5abzgg2yyjsm2la967mk881i91h8jdnal072fb9qh9wr58";
|
||||||
|
};
|
||||||
|
"sqlite3" = {
|
||||||
|
url = "https://github.com/crystal-lang/crystal-sqlite3.git";
|
||||||
|
rev = "v0.22.0";
|
||||||
|
sha256 = "1lc8ixnzjx8nsp96qj9yxmfk7g334id8v87g3h5bwgkhkbx5ghqn";
|
||||||
|
};
|
||||||
|
"telepathy" = {
|
||||||
|
url = "https://dev.danilafe.com/Crystal-Bots/telepathy";
|
||||||
|
rev = "v0.2.0";
|
||||||
|
sha256 = "1zhjlpa31vldgd9f6l1hdfj7a97hlqkxkvxzisfs2zfnvc86aiyc";
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user