Compare commits

..

No commits in common. "a62b7d1b5ac0e9d7bebb9aa63f1e0d626eea168c" and "ac8220c0152d29353996141d707ab1c31df2802f" have entirely different histories.

12 changed files with 52 additions and 176 deletions

View file

@ -1,23 +0,0 @@
name: test
on:
push:
branches:
- master
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: "27.1.2"
gleam-version: "1.10.0"
rebar3-version: "3"
# elixir-version: "1"
- run: gleam deps download
- run: gleam test
- run: gleam format --check src test

6
.gitignore vendored
View file

@ -1,7 +1,3 @@
*.beam .direnv/
*.ez
/build
erl_crash.dump
result result
.env .env
.direnv

View file

@ -1,24 +0,0 @@
# switcheroo
[![Package Version](https://img.shields.io/hexpm/v/switcheroo)](https://hex.pm/packages/switcheroo)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/switcheroo/)
```sh
gleam add switcheroo@1
```
```gleam
import switcheroo
pub fn main() -> Nil {
// TODO: An example of the project in use
}
```
Further documentation can be found at <https://hexdocs.pm/switcheroo>.
## Development
```sh
gleam run # Run the project
gleam test # Run the tests
```

62
flake.lock generated
View file

@ -1,35 +1,20 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-parts": {
"inputs": { "inputs": {
"systems": "systems" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1743550720,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "flake-parts",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "flake-parts",
"type": "github"
}
},
"nix-gleam": {
"locked": {
"lastModified": 1717670865,
"narHash": "sha256-+dAPiKAwCzlKWtx3aIHXfR6jydh1JyangewqZKJx500=",
"owner": "arnarg",
"repo": "nix-gleam",
"rev": "c69abe0e57a01991654d3de63dcd93a8b91b98ff",
"type": "github"
},
"original": {
"owner": "arnarg",
"repo": "nix-gleam",
"type": "github" "type": "github"
} }
}, },
@ -49,27 +34,26 @@
"type": "github" "type": "github"
} }
}, },
"root": { "nixpkgs-lib": {
"inputs": {
"flake-utils": "flake-utils",
"nix-gleam": "nix-gleam",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1743296961,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
"owner": "nix-systems", "owner": "nix-community",
"repo": "default", "repo": "nixpkgs.lib",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-community",
"repo": "default", "repo": "nixpkgs.lib",
"type": "github" "type": "github"
} }
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -1,42 +1,20 @@
{ {
description = "My gleam application"; description = "plapkit";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs = {
inputs.flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nix-gleam.url = "github:arnarg/nix-gleam"; flake-parts.url = "github:hercules-ci/flake-parts";
outputs = {
self,
nixpkgs,
flake-utils,
nix-gleam,
}: (
flake-utils.lib.eachDefaultSystem
(system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
nix-gleam.overlays.default
];
}; };
in rec {
packages.default = pkgs.buildGleamApplication {
# The pname and version will be read from the `gleam.toml`
# file generated by gleam.
# But this can be overwritten here too:
# pname = "my-app";
# version = "1.2.3";
# The target is read from the `gleam.toml` file too. outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
# Default is "erlang" if nothing is specified but systems = [ "x86_64-linux" "aarch64-linux" ];
# this can also be overwritten here too: perSystem = { config, self', pkgs, lib, system, ... }: rec {
# target = "javascript"; devShells.default = import ./shell.nix { inherit pkgs; };
# Erlang package can be overridden but defaults to
# `pkgs.erlang`.
# erlangPackage = pkgs.erlang_nox;
packages.default = pkgs.buildGoModule {
name = "switcheroo";
src = ./.; src = ./.;
vendorHash = "sha256-YY7Hj7lSq7vEoMEIu/zmweWzd7p7KF+4YCUX2SJ7kwI=";
}; };
packages.container = pkgs.dockerTools.buildImage { packages.container = pkgs.dockerTools.buildImage {
@ -52,6 +30,6 @@
Cmd = [ "${packages.default}/bin/switcheroo" ]; Cmd = [ "${packages.default}/bin/switcheroo" ];
}; };
}; };
}) };
); };
} }

View file

@ -1,19 +0,0 @@
name = "switcheroo"
version = "1.0.0"
# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "", repo = "" }
# links = [{ title = "Website", href = "" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.
[dependencies]
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module git.sapphic.engineer/noe/switcheroo
go 1.24.2

7
main.go Normal file
View file

@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("hello world")
}

View file

@ -1,11 +0,0 @@
# This file was generated by Gleam
# You typically do not need to edit this file
packages = [
{ name = "gleam_stdlib", version = "0.59.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "F8FEE9B35797301994B81AF75508CF87C328FE1585558B0FFD188DC2B32EAA95" },
{ name = "gleeunit", version = "1.3.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A7DD6C07B7DA49A6E28796058AA89E651D233B357D5607006D70619CD89DAAAB" },
]
[requirements]
gleam_stdlib = { version = ">= 0.44.0 and < 2.0.0" }
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }

View file

@ -1,5 +1,7 @@
{ pkgs ? import <nixpkgs> {} }: pkgs.mkShell { { pkgs ? import <nixpkgs> {} }: pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
gleam go
just
sqlite
]; ];
} }

View file

@ -1,5 +0,0 @@
import gleam/io
pub fn main() -> Nil {
io.println("Hello from switcheroo!")
}

View file

@ -1,12 +0,0 @@
import gleeunit
import gleeunit/should
pub fn main() -> Nil {
gleeunit.main()
}
// gleeunit test functions end in `_test`
pub fn hello_world_test() {
1
|> should.equal(1)
}