nix flake for DiceMaiden bot

This commit is contained in:
xenofem 2022-07-24 02:18:05 -04:00
commit 603a1dbd45
4 changed files with 488 additions and 0 deletions

89
Gemfile.lock Normal file
View file

@ -0,0 +1,89 @@
GIT
remote: https://github.com/Humblemonk/Dice-Bag.git
revision: 808d7d4a532812588fe199d5c038e4c4b2bfc3bd
branch: master
specs:
dicebag (3.3.0)
parslet (~> 1.4, >= 1.4.0)
GIT
remote: https://github.com/shardlab/discordrb.git
revision: 7c7865d7462a348e6a4171008322fda24634e437
branch: main
specs:
discordrb (3.4.2)
discordrb-webhooks (~> 3.4.2)
ffi (>= 1.9.24)
opus-ruby
rest-client (>= 2.0.0)
websocket-client-simple (>= 0.3.0)
discordrb-webhooks (3.4.2)
rest-client (>= 2.0.0)
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
event_emitter (0.2.6)
ffi (1.15.5)
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
json (2.6.2)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
netrc (0.11.0)
opus-ruby (1.0.1)
ffi
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
parslet (1.8.2)
rainbow (3.1.1)
regexp_parser (2.5.0)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
rubocop (1.32.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.19.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.19.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
sqlite3 (1.4.4)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.2.0)
websocket (1.2.9)
websocket-client-simple (0.5.1)
event_emitter
websocket
PLATFORMS
x86_64-linux
DEPENDENCIES
dicebag!
discordrb!
dotenv (~> 2.5)
rest-client (~> 2.0, >= 2.0.2)
rubocop
sqlite3 (~> 1.3, >= 1.3.11)
BUNDLED WITH
2.3.9

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1658557357,
"narHash": "sha256-0gqNef6skYQKJSS2vLojxrXOrc72zoX5VTDKUqEo6Gk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "42ca9bef09e780eabe84328dd1b730cef978f098",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

41
flake.nix Normal file
View file

@ -0,0 +1,41 @@
{
description = "Dice roller discord bot";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: let
pkgs = import nixpkgs { system = "x86_64-linux"; };
src = pkgs.fetchFromGitHub {
owner = "Humblemonk";
repo = "DiceMaiden";
rev = "9fb207b44e05953c9a27f287ff7d8eb4dcd4978a";
sha256 = "078i3nfqnin331bhphz4mqi6w5y6xll5v7g7j4qrxzq1xmvrhkaj";
};
gems = pkgs.bundlerEnv {
name = "dicemaiden-env";
gemfile = "${src}/Gemfile";
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
ignoreCollisions = true;
};
in rec {
packages.x86_64-linux = rec {
default = dicemaiden;
dicemaiden = pkgs.stdenv.mkDerivation {
name = "dicemaiden";
src = src;
buildInputs = [ gems pkgs.ruby ];
installPhase = ''
mkdir -p $out/{bin,share/dicemaiden}
cp -r * $out/share/dicemaiden
bin=$out/bin/dicemaiden
cat > $bin <<EOF
#!/bin/sh -e
exec ${gems}/bin/bundle exec ${pkgs.ruby}/bin/ruby $out/share/dicemaiden/dice_maiden.rb "\$@"
EOF
chmod +x $bin
'';
};
};
};
}

331
gemset.nix Normal file
View file

@ -0,0 +1,331 @@
{
ast = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "04nc8x27hlzlrr5c2gn7mar4vdr0apw5xg22wp6m8dx3wqr04a0y";
type = "gem";
};
version = "2.4.2";
};
dicebag = {
dependencies = ["parslet"];
groups = ["default"];
platforms = [];
source = {
fetchSubmodules = false;
rev = "808d7d4a532812588fe199d5c038e4c4b2bfc3bd";
sha256 = "1xlhpgkh4gddhml4xfkzpya4i4q9pgbq7crpakvz033w1jikmksr";
type = "git";
url = "https://github.com/Humblemonk/Dice-Bag.git";
};
version = "3.3.0";
};
discordrb = {
dependencies = ["discordrb-webhooks" "ffi" "opus-ruby" "rest-client" "websocket-client-simple"];
groups = ["default"];
platforms = [];
source = {
fetchSubmodules = false;
rev = "7c7865d7462a348e6a4171008322fda24634e437";
sha256 = "0ay6jzz6vd3wvi2dda63xn6d0kkwil4rpy34nzvm2zax1kiy62g4";
type = "git";
url = "https://github.com/shardlab/discordrb.git";
};
version = "3.4.2";
};
discordrb-webhooks = {
dependencies = ["rest-client"];
groups = ["default"];
platforms = [];
source = {
fetchSubmodules = false;
rev = "7c7865d7462a348e6a4171008322fda24634e437";
sha256 = "0ay6jzz6vd3wvi2dda63xn6d0kkwil4rpy34nzvm2zax1kiy62g4";
type = "git";
url = "https://github.com/shardlab/discordrb.git";
};
version = "3.4.2";
};
domain_name = {
dependencies = ["unf"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0lcqjsmixjp52bnlgzh4lg9ppsk52x9hpwdjd53k8jnbah2602h0";
type = "gem";
};
version = "0.5.20190701";
};
dotenv = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0iym172c5337sm1x2ykc2i3f961vj3wdclbyg1x6sxs3irgfsl94";
type = "gem";
};
version = "2.7.6";
};
event_emitter = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "148k9qv8102l3m6klc24dwip79f9y4bjr5z19dckd7ffbjyrf9n7";
type = "gem";
};
version = "0.2.6";
};
ffi = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1862ydmclzy1a0cjbvm8dz7847d9rch495ib0zb64y84d3xd4bkg";
type = "gem";
};
version = "1.15.5";
};
http-accept = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "09m1facypsdjynfwrcv19xcb1mqg8z6kk31g8r33pfxzh838c9n6";
type = "gem";
};
version = "1.7.0";
};
http-cookie = {
dependencies = ["domain_name"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "13rilvlv8kwbzqfb644qp6hrbsj82cbqmnzcvqip1p6vqx36sxbk";
type = "gem";
};
version = "1.0.5";
};
json = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0yk5d10yvspkc5jyvx9gc1a9pn1z8v4k2hvjk1l88zixwf3wf3cl";
type = "gem";
};
version = "2.6.2";
};
mime-types = {
dependencies = ["mime-types-data"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0ipw892jbksbxxcrlx9g5ljq60qx47pm24ywgfbyjskbcl78pkvb";
type = "gem";
};
version = "3.4.1";
};
mime-types-data = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "003gd7mcay800k2q4pb2zn8lwwgci4bhi42v2jvlidm8ksx03i6q";
type = "gem";
};
version = "3.2022.0105";
};
netrc = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y";
type = "gem";
};
version = "0.11.0";
};
opus-ruby = {
dependencies = ["ffi"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0lyf2a8f1w1jk0qrl8h0gsydfalbh19g5k2c6xlq8j1sfzb0ij4d";
type = "gem";
};
version = "1.0.1";
};
parallel = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "07vnk6bb54k4yc06xnwck7php50l09vvlw1ga8wdz0pia461zpzb";
type = "gem";
};
version = "1.22.1";
};
parser = {
dependencies = ["ast"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0xhfghgidj8cbdnqp01f7kvnrv1f60izpkd9dhxsvpdzkfsdg97d";
type = "gem";
};
version = "3.1.2.0";
};
parslet = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "12nrzfwjphjlakb9pmpj70hgjwgzvnr8i1zfzddifgyd44vspl88";
type = "gem";
};
version = "1.8.2";
};
rainbow = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0smwg4mii0fm38pyb5fddbmrdpifwv22zv3d3px2xx497am93503";
type = "gem";
};
version = "3.1.1";
};
regexp_parser = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1rfd3q17p7q7pa67844q8b16ipy6ksh8mkzynpm1zldqbb9x4xm0";
type = "gem";
};
version = "2.5.0";
};
rest-client = {
dependencies = ["http-accept" "http-cookie" "mime-types" "netrc"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1qs74yzl58agzx9dgjhcpgmzfn61fqkk33k1js2y5yhlvc5l19im";
type = "gem";
};
version = "2.1.0";
};
rexml = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "08ximcyfjy94pm1rhcx04ny1vx2sk0x4y185gzn86yfsbzwkng53";
type = "gem";
};
version = "3.2.5";
};
rubocop = {
dependencies = ["json" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "09k371m1l177ca8w70hfbjb1w0hasfb46pxp4w6yw92kk71akll2";
type = "gem";
};
version = "1.32.0";
};
rubocop-ast = {
dependencies = ["parser"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0h8q3gwqs8afshjd2l52ywf48md9rskr3q2y4fydgm536vvahjgm";
type = "gem";
};
version = "1.19.1";
};
ruby-progressbar = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "02nmaw7yx9kl7rbaan5pl8x5nn0y4j5954mzrkzi9i3dhsrps4nc";
type = "gem";
};
version = "1.11.0";
};
sqlite3 = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1z1wa639c278bsipczn6kv8b13fj85pi8gk7x462chqx6k0wm0ax";
type = "gem";
};
version = "1.4.4";
};
unf = {
dependencies = ["unf_ext"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0bh2cf73i2ffh4fcpdn9ir4mhq8zi50ik0zqa1braahzadx536a9";
type = "gem";
};
version = "0.1.4";
};
unf_ext = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1yj2nz2l101vr1x9w2k83a0fag1xgnmjwp8w8rw4ik2rwcz65fch";
type = "gem";
};
version = "0.0.8.2";
};
unicode-display_width = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1nlfck6z986fngp0r74maswmyb1rcksc8xc3mfpw9cj23c3s8zwn";
type = "gem";
};
version = "2.2.0";
};
websocket = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0dib6p55sl606qb4vpwrvj5wh881kk4aqn2zpfapf8ckx7g14jw8";
type = "gem";
};
version = "1.2.9";
};
websocket-client-simple = {
dependencies = ["event_emitter" "websocket"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0kd5azwyr1f65vqn833vmw3j524lxn6jy4g657a4rdh8a69d0i8n";
type = "gem";
};
version = "0.5.1";
};
}