rust (again)
This commit is contained in:
parent
f8d1a25efd
commit
eab491600c
9 changed files with 34 additions and 148 deletions
39
.gitignore
vendored
39
.gitignore
vendored
|
@ -1,29 +1,24 @@
|
||||||
# ---> Go
|
# Generated by Cargo
|
||||||
# If you prefer the allow list template instead of the deny list, see community template:
|
# will have compiled files and executables
|
||||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
debug/
|
||||||
#
|
target/
|
||||||
# Binaries for programs and plugins
|
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
*.test
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
|
Cargo.lock
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# These are backup files generated by rustfmt
|
||||||
*.out
|
**/*.rs.bk
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||||
# vendor/
|
*.pdb
|
||||||
|
|
||||||
# Go workspace file
|
# RustRover
|
||||||
go.work
|
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
||||||
go.work.sum
|
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||||
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# env file
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
.env
|
#.idea/
|
||||||
|
|
||||||
# direnv
|
# direnv
|
||||||
.direnv
|
.direnv
|
||||||
|
|
6
Cargo.toml
Normal file
6
Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "voidway"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
57
flake.lock
57
flake.lock
|
@ -1,44 +1,5 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1694529238,
|
|
||||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gomod2nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1729448365,
|
|
||||||
"narHash": "sha256-oquZeWTYWTr5IxfwEzgsxjtD8SSFZYLdO9DaQb70vNU=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "gomod2nix",
|
|
||||||
"rev": "5d387097aa716f35dd99d848dc26d8d5b62a104c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "gomod2nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732014248,
|
"lastModified": 1732014248,
|
||||||
|
@ -57,27 +18,11 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"gomod2nix": "gomod2nix",
|
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"systems": "systems_2"
|
"systems": "systems"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems_2": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689347949,
|
"lastModified": 1689347949,
|
||||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||||
|
|
31
flake.nix
31
flake.nix
|
@ -4,44 +4,27 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
systems.url = "github:nix-systems/default-linux";
|
systems.url = "github:nix-systems/default-linux";
|
||||||
gomod2nix = {
|
|
||||||
url = "github:nix-community/gomod2nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, systems, gomod2nix }:
|
outputs = { self, nixpkgs, systems}:
|
||||||
let
|
let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
inherit (lib) attrValues;
|
||||||
eachSystem = lib.genAttrs (import systems);
|
eachSystem = lib.genAttrs (import systems);
|
||||||
pkgs = eachSystem (system:
|
pkgs = eachSystem (system:
|
||||||
import nixpkgs {
|
import nixpkgs {
|
||||||
localSystem = system;
|
localSystem = system;
|
||||||
overlays = [ gomod2nix.overlays.default ];
|
|
||||||
});
|
});
|
||||||
in {
|
in {
|
||||||
|
|
||||||
packages = eachSystem (system: {
|
# packages = eachSystem (system: {
|
||||||
default = pkgs.${system}.buildGoApplication {
|
# default = pkgs.hello;
|
||||||
pname = "voidway";
|
# });
|
||||||
version = "latest";
|
|
||||||
goPackagePath = "git.sako.lol/sako/voidway/v4";
|
|
||||||
src = ./.;
|
|
||||||
modules = ./gomod2nix.toml;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
devShells = eachSystem (system: {
|
devShells = eachSystem (system: {
|
||||||
default = pkgs.${system}.mkShell {
|
default = pkgs.${system}.mkShell {
|
||||||
name = "v-shell";
|
name = "voidway-shell";
|
||||||
buildInputs = with pkgs.${system}; [
|
packages = attrValues { inherit (pkgs.${system}) cargo rustc rust-analyzer rustfmt pkg-config sqlite-interactive;};
|
||||||
go
|
|
||||||
gopls
|
|
||||||
gotools
|
|
||||||
go-tools
|
|
||||||
gomod2nix.packages.${system}.default
|
|
||||||
sqlite-interactive
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
11
go.mod
11
go.mod
|
@ -1,11 +0,0 @@
|
||||||
module git.sako.lol/sako/voidway/v4
|
|
||||||
|
|
||||||
go 1.23.3
|
|
||||||
|
|
||||||
require github.com/valyala/fasthttp v1.57.0
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
|
||||||
github.com/klauspost/compress v1.17.11 // indirect
|
|
||||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
|
||||||
)
|
|
10
go.sum
10
go.sum
|
@ -1,10 +0,0 @@
|
||||||
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
|
|
||||||
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
|
|
||||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
|
||||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
|
||||||
github.com/valyala/fasthttp v1.57.0 h1:Xw8SjWGEP/+wAAgyy5XTvgrWlOD1+TxbbvNADYCm1Tg=
|
|
||||||
github.com/valyala/fasthttp v1.57.0/go.mod h1:h6ZBaPRlzpZ6O3H5t2gEk1Qi33+TmLvfwgLLp0t9CpE=
|
|
||||||
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
|
|
||||||
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
|
|
@ -1,15 +0,0 @@
|
||||||
schema = 3
|
|
||||||
|
|
||||||
[mod]
|
|
||||||
[mod."github.com/andybalholm/brotli"]
|
|
||||||
version = "v1.1.1"
|
|
||||||
hash = "sha256-kCt+irK1gvz2lGQUeEolYa5+FbLsfWlJMCd5hm+RPgQ="
|
|
||||||
[mod."github.com/klauspost/compress"]
|
|
||||||
version = "v1.17.11"
|
|
||||||
hash = "sha256-LFSIWy0C4VbiuPve0eKHr7Q7s4XtaGzsZ3qpO+6bEgc="
|
|
||||||
[mod."github.com/valyala/bytebufferpool"]
|
|
||||||
version = "v1.0.0"
|
|
||||||
hash = "sha256-I9FPZ3kCNRB+o0dpMwBnwZ35Fj9+ThvITn8a3Jr8mAY="
|
|
||||||
[mod."github.com/valyala/fasthttp"]
|
|
||||||
version = "v1.57.0"
|
|
||||||
hash = "sha256-AIDhVUZwRxVBauXq1Pu4hEljzaw2LiY0ULeAQ3+XyGk="
|
|
10
main.go
10
main.go
|
@ -1,10 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"github.com/valyala/fasthttp"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
fmt.Println("Hi")
|
|
||||||
}
|
|
3
src/main.rs
Normal file
3
src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
Loading…
Reference in a new issue