commit ac8220c0152d29353996141d707ab1c31df2802f Author: noe Date: Tue Apr 29 17:58:38 2025 -0700 init diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..fb4b158 --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +dotenv; +use flake; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61000c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.direnv/ +result +.env \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..63fd3fc --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1745930157, + "narHash": "sha256-y3h3NLnzRSiUkYpnfvnS669zWZLoqqI6NprtLQ+5dck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46e634be05ce9dc6d4db8e664515ba10b78151ae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a78ce00 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "plapkit"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-linux" ]; + perSystem = { config, self', pkgs, lib, system, ... }: rec { + devShells.default = import ./shell.nix { inherit pkgs; }; + + packages.default = pkgs.buildGoModule { + name = "switcheroo"; + src = ./.; + vendorHash = "sha256-YY7Hj7lSq7vEoMEIu/zmweWzd7p7KF+4YCUX2SJ7kwI="; + }; + + packages.container = pkgs.dockerTools.buildImage { + # fromImage = baseImage; + name = "noe/switcheroo"; + tag = "latest"; + + copyToRoot = [ + pkgs.dockerTools.caCertificates + ]; + + config = { + Cmd = [ "${packages.default}/bin/switcheroo" ]; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..9b87954 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.sapphic.engineer/noe/switcheroo + +go 1.24.2 diff --git a/main.go b/main.go new file mode 100644 index 0000000..c048119 --- /dev/null +++ b/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("hello world") +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..7210e41 --- /dev/null +++ b/shell.nix @@ -0,0 +1,7 @@ +{ pkgs ? import {} }: pkgs.mkShell { + buildInputs = with pkgs; [ + go + just + sqlite + ]; +}