57 lines
No EOL
1.4 KiB
Nix
57 lines
No EOL
1.4 KiB
Nix
{
|
|
description = "My gleam application";
|
|
|
|
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 = {
|
|
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;
|
|
|
|
src = ./.;
|
|
};
|
|
|
|
packages.container = pkgs.dockerTools.buildImage {
|
|
# fromImage = baseImage;
|
|
name = "noe/switcheroo";
|
|
tag = "latest";
|
|
|
|
copyToRoot = [
|
|
pkgs.dockerTools.caCertificates
|
|
];
|
|
|
|
config = {
|
|
Cmd = [ "${packages.default}/bin/switcheroo" ];
|
|
};
|
|
};
|
|
})
|
|
);
|
|
} |