mirror of
https://github.com/RGBCube/minearchy-bot
synced 2025-07-27 17:07:45 +00:00
feat: package with nix and docker
This commit is contained in:
parent
fb63e83312
commit
b0b82aa689
8 changed files with 118 additions and 99 deletions
55
flake.nix
Normal file
55
flake.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
description = "A simple bot made for the Minearchy Discord server";
|
||||
|
||||
inputs = {
|
||||
systems.url = "github:nix-systems/default";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
|
||||
outputs = { systems, nixpkgs, ... }: let
|
||||
eachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||
in {
|
||||
packages = eachSystem (system: let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
pypkgs = pkgs.python313Packages;
|
||||
in rec {
|
||||
default = minearchy-bot;
|
||||
|
||||
minearchy-bot = pypkgs.buildPythonApplication {
|
||||
pname = "minearchy-bot";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
format = "pyproject";
|
||||
|
||||
build-system = [ pypkgs.setuptools ];
|
||||
|
||||
dependencies = [
|
||||
pypkgs.discordpy
|
||||
# TODO: pypkgs.jishaku
|
||||
pypkgs.mcstatus
|
||||
];
|
||||
};
|
||||
|
||||
minearchy-bot-container = pkgs.dockerTools.buildImage {
|
||||
name = "minearchy-bot";
|
||||
tag = "latest";
|
||||
|
||||
copyToRoot = pkgs.buildEnv {
|
||||
name = "image-root";
|
||||
|
||||
pathsToLink = [ "/bin" ];
|
||||
paths = [
|
||||
pkgs.uutils-coreutils-noprefix
|
||||
minearchy-bot
|
||||
];
|
||||
};
|
||||
|
||||
config.Env = [ "PATH=/bin" ];
|
||||
config.WorkingDir = "/minearcy-bot";
|
||||
config.Cmd = "${minearchy-bot}/bin/minearchy-bot";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue