-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f11ab4
commit 9d8c504
Showing
6 changed files
with
161 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
{ pkgs, buildGoModule, lib }: buildGoModule rec { | ||
src = ./.; | ||
{ | ||
buildGoModule, | ||
lib, | ||
}: | ||
buildGoModule { | ||
src = ./.; | ||
|
||
name = "roblox-account-value-api"; | ||
vendorSha256 = "sha256-pTw0KdOWjKDLb4rx87WGt9D6qok73J5uNRG+ecyAaaA="; | ||
name = "roblox-account-value-api"; | ||
vendorHash = "sha256-++ocAIm+8xt7xYU5ZCVOaKt0zvROR0/jSb4623M6/d0="; | ||
|
||
ldflags = [ | ||
"-s" | ||
"-w" | ||
]; | ||
} | ||
ldflags = [ | ||
"-s" | ||
"-w" | ||
]; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/ayes-web/roblox-account-value-api"; | ||
description = "Webapp that calculates account value in robux and euro"; | ||
mainProgram = pname; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
{ pkgs, default, nix2container}: let | ||
config = pkgs.writeText "config.toml" '' | ||
port = "80" | ||
robux_per_euro = 60 | ||
''; | ||
in nix2container.packages.${pkgs.system}.nix2container.buildImage { | ||
{ | ||
pkgs, | ||
default, | ||
nix2container, | ||
lib, | ||
}: let | ||
config = pkgs.writeText "config.toml" '' | ||
port = "80" | ||
robux_per_euro = 60 | ||
''; | ||
in | ||
nix2container.packages.${pkgs.system}.nix2container.buildImage { | ||
name = "ghcr.io/ayes-web/roblox-account-value-api"; | ||
tag = "latest"; | ||
|
||
copyToRoot = pkgs.cacert; | ||
|
||
config = { | ||
entrypoint = ["${default}/bin/roblox-account-value-api" "-c" "${config}"]; | ||
exposed_ports = [80]; | ||
entrypoint = ["${lib.getExe default}" "-c" "${config}"]; | ||
exposed_ports = [80]; | ||
}; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nix2container.url = "github:nlewo/nix2container"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, nix2container, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
outputs = { | ||
nixpkgs, | ||
flake-utils, | ||
nix2container, | ||
... | ||
}: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
inherit system; | ||
}; | ||
|
||
# Needed on non linux systems since docker runs a linux vm | ||
dockerCallPackage = if pkgs.stdenv.isLinux then | ||
pkgs.callPackage | ||
else | ||
pkgs.pkgsCross."${pkgs.stdenv.hostPlatform.uname.processor}-multiplatform".callPackage; | ||
dockerCallPackage = | ||
if pkgs.stdenv.isLinux | ||
then pkgs.callPackage | ||
else pkgs.pkgsCross."${pkgs.stdenv.hostPlatform.uname.processor}-multiplatform".callPackage; | ||
in | ||
with pkgs; | ||
rec { | ||
devShells.default = mkShell { | ||
buildInputs = [ | ||
gnumake | ||
wire | ||
go | ||
]; | ||
}; | ||
with pkgs; { | ||
devShells.default = mkShell { | ||
buildInputs = [ | ||
gnumake | ||
wire | ||
go | ||
]; | ||
}; | ||
|
||
packages.default = callPackage ./build.nix { }; | ||
packages.docker = callPackage ./docker.nix { default = dockerCallPackage ./build.nix { }; inherit nix2container; }; | ||
} | ||
packages = { | ||
default = callPackage ./build.nix {}; | ||
docker = callPackage ./docker.nix { | ||
default = dockerCallPackage ./build.nix {}; | ||
inherit nix2container; | ||
}; | ||
}; | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,38 @@ | ||
module github.com/ayes-web/roblox-account-value-api | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/BurntSushi/toml v1.2.1 | ||
github.com/BurntSushi/toml v1.3.2 | ||
github.com/didip/tollbooth/v7 v7.0.1 | ||
github.com/gin-gonic/gin v1.9.0 | ||
github.com/gin-gonic/gin v1.9.1 | ||
github.com/google/wire v0.5.0 | ||
) | ||
|
||
require ( | ||
github.com/bytedance/sonic v1.8.0 // indirect | ||
github.com/bytedance/sonic v1.9.1 // indirect | ||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect | ||
github.com/gabriel-vasile/mimetype v1.4.2 // indirect | ||
github.com/gin-contrib/sse v0.1.0 // indirect | ||
github.com/go-pkgz/expirable-cache v0.1.0 // indirect | ||
github.com/go-playground/locales v0.14.1 // indirect | ||
github.com/go-playground/universal-translator v0.18.1 // indirect | ||
github.com/go-playground/validator/v10 v10.11.2 // indirect | ||
github.com/goccy/go-json v0.10.0 // indirect | ||
github.com/go-playground/validator/v10 v10.14.0 // indirect | ||
github.com/goccy/go-json v0.10.2 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/klauspost/cpuid/v2 v2.0.9 // indirect | ||
github.com/leodido/go-urn v1.2.1 // indirect | ||
github.com/mattn/go-isatty v0.0.17 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect | ||
github.com/klauspost/cpuid/v2 v2.2.4 // indirect | ||
github.com/leodido/go-urn v1.2.4 // indirect | ||
github.com/mattn/go-isatty v0.0.19 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/pelletier/go-toml/v2 v2.0.6 // indirect | ||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect | ||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect | ||
github.com/ugorji/go/codec v1.2.9 // indirect | ||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect | ||
golang.org/x/crypto v0.5.0 // indirect | ||
golang.org/x/net v0.7.0 // indirect | ||
golang.org/x/sys v0.5.0 // indirect | ||
golang.org/x/text v0.7.0 // indirect | ||
google.golang.org/protobuf v1.28.1 // indirect | ||
github.com/ugorji/go/codec v1.2.11 // indirect | ||
golang.org/x/arch v0.3.0 // indirect | ||
golang.org/x/crypto v0.9.0 // indirect | ||
golang.org/x/net v0.10.0 // indirect | ||
golang.org/x/sys v0.8.0 // indirect | ||
golang.org/x/text v0.9.0 // indirect | ||
google.golang.org/protobuf v1.30.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.