mirror of https://github.com/clickscodes/nucleus
Co-authored-by: PineappleFan <pineapplefanyt@gmail.com> Co-authored-by: Skyler <skyler3665@gmail.com>pull/101/head
parent
9d9ce0e362
commit
4a7c25dd92
@ -1,4 +1 @@
|
||||
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
|
||||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
|
||||
fi
|
||||
use flake
|
||||
|
||||
@ -1,17 +1,63 @@
|
||||
{
|
||||
description = "A basic flake with a shell";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
|
||||
inputs.nixpkgs.follows = "clicks-server/nixpkgs";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.clicks-server.url = "github:clicksminuteper/nixfiles";
|
||||
inputs.pnpm2nix.url = "github:clicksminuteper/pnpm2nix";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
inputs.pnpm2nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, clicks-server, pnpm2nix }:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
nodejs = pkgs.nodejs-19_x;
|
||||
nodePackages = pkgs.nodePackages_latest;
|
||||
lib = pkgs.lib;
|
||||
in rec {
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [ pkgs.nodejs-19_x pkgs.nodePackages_latest.yarn ];
|
||||
packages = [ nodejs nodePackages.pnpm ];
|
||||
shellHook = ''
|
||||
unset name
|
||||
'';
|
||||
};
|
||||
|
||||
packages.env = lib.pipe {
|
||||
src = ./.;
|
||||
packageJSON = ./package.json;
|
||||
} [
|
||||
pnpm2nix.mkPnpmPackage
|
||||
pnpm2nix.mkPnpmEnv
|
||||
];
|
||||
|
||||
packages.default = let
|
||||
packageJSON = (builtins.fromJSON (builtins.readFile ./package.json));
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
pname = "nucleus";
|
||||
version = packageJSON.version;
|
||||
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [ packages.env nodejs nodePackages.pnpm ];
|
||||
nativeBuildInputs = [ packages.env nodePackages.pnpm ];
|
||||
|
||||
buildPhase = ''
|
||||
pnpm run build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp dist $out
|
||||
mkdir -p $out/bin
|
||||
echo "#!/usr/bin/env bash\ncd $out\n${packageJSON.scripts.start}" > $out/bin/nucleus
|
||||
'';
|
||||
};
|
||||
|
||||
dockerImage = let
|
||||
nucleus = packages.default;
|
||||
in pkgs.dockerTools.streamLayeredImage {
|
||||
name = "nucleus";
|
||||
tag = "latest";
|
||||
contents = [ nucleus ];
|
||||
config.Cmd = [ "${nucleus}/bin/nucleus" ];
|
||||
};
|
||||
});
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
||||
import { type ButtonInteraction } from "discord.js";
|
||||
|
||||
export async function callback(interaction: ButtonInteraction) {
|
||||
console.log(interaction);
|
||||
}
|
||||
Loading…
Reference in new issue