init gleam

This commit is contained in:
41666 2025-04-29 18:19:33 -07:00
parent ac8220c015
commit f941e6902e
10 changed files with 176 additions and 42 deletions

View file

@ -1,20 +1,42 @@
{
description = "plapkit";
description = "My gleam application";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nix-gleam.url = "github:arnarg/nix-gleam";
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; };
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.
# Default is "erlang" if nothing is specified but
# this can also be overwritten here too:
# target = "javascript";
# Erlang package can be overridden but defaults to
# `pkgs.erlang`.
# erlangPackage = pkgs.erlang_nox;
packages.default = pkgs.buildGoModule {
name = "switcheroo";
src = ./.;
vendorHash = "sha256-YY7Hj7lSq7vEoMEIu/zmweWzd7p7KF+4YCUX2SJ7kwI=";
};
packages.container = pkgs.dockerTools.buildImage {
@ -30,6 +52,6 @@
Cmd = [ "${packages.default}/bin/switcheroo" ];
};
};
};
};
})
);
}