deno2.nix/flake.nix

77 lines
1.9 KiB
Nix
Raw Normal View History

2022-06-19 01:24:56 +00:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = {
self,
nixpkgs,
flake-utils,
devshell,
...
} @ inputs:
2022-08-03 23:28:28 +00:00
{
2022-06-19 01:42:24 +00:00
overlays.default = import ./overlay.nix;
2022-08-03 23:28:28 +00:00
overlay = self.overlays.default;
2022-06-19 01:42:24 +00:00
}
// flake-utils.lib.eachSystem [
2022-06-19 01:24:56 +00:00
"x86_64-linux"
]
(
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
devshell.overlay
2022-08-03 23:28:28 +00:00
self.overlays.default
2022-06-19 01:24:56 +00:00
];
};
2022-08-03 23:28:28 +00:00
in {
packages.bundled = pkgs.deno2nix.mkBundled {
2022-06-19 01:24:56 +00:00
name = "example";
version = "0.1.0";
src = self;
lockfile = ./lock.json;
2022-06-19 01:42:24 +00:00
importMap = ./import_map.json;
2022-06-19 01:24:56 +00:00
entrypoint = ./mod.ts;
};
packages.wrapper = pkgs.deno2nix.mkBundledWrapper {
2022-06-19 01:24:56 +00:00
name = "example";
version = "0.1.0";
src = self;
lockfile = ./lock.json;
2022-06-19 01:42:24 +00:00
importMap = ./import_map.json;
2022-06-19 01:24:56 +00:00
entrypoint = ./mod.ts;
};
packages.executable = pkgs.deno2nix.mkExecutable {
2022-06-19 01:24:56 +00:00
name = "example";
version = "0.1.0";
src = self;
lockfile = ./lock.json;
2022-06-19 01:42:24 +00:00
importMap = ./import_map.json;
2022-06-19 01:24:56 +00:00
entrypoint = ./mod.ts;
};
2022-08-03 23:28:28 +00:00
packages.default = self.packages.${system}.executable;
defaultPackage = self.packages.${system}.default;
2022-06-19 01:24:56 +00:00
2022-08-03 23:40:38 +00:00
apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.executable;
2022-06-19 01:24:56 +00:00
};
2022-08-03 23:28:28 +00:00
checks = self.packages.${system};
2022-06-19 01:24:56 +00:00
devShell = pkgs.devshell.mkShell {
imports = [
(pkgs.devshell.importTOML ./devshell.toml)
];
};
}
);
}