deno2.nix/flake.nix

85 lines
2.2 KiB
Nix
Raw Normal View History

2022-06-19 01:24:56 +00:00
{
# main
2022-06-19 01:24:56 +00:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
2022-06-19 01:24:56 +00:00
# dev
inputs = {
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
flake-utils.url = "github:numtide/flake-utils";
2022-06-19 01:24:56 +00:00
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
2022-06-19 01:24:56 +00:00
outputs = {
self,
nixpkgs,
flake-utils,
...
} @ inputs:
2022-08-03 23:28:28 +00:00
{
overlays.default = import ./nix/overlay.nix;
2022-06-19 01:42:24 +00:00
}
// flake-utils.lib.eachSystem [
2022-06-19 01:24:56 +00:00
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
2022-06-19 01:24:56 +00:00
]
(
system: let
inherit (pkgs) deno2nix;
2022-06-19 01:24:56 +00:00
pkgs = import nixpkgs {
inherit system;
overlays = with inputs; [
2022-08-03 23:28:28 +00:00
self.overlays.default
devshell.overlay
2022-06-19 01:24:56 +00:00
];
};
2022-08-03 23:28:28 +00:00
in {
/*
TODO: It can't but I don't why
packages = flake-utils.lib.flattenTree {
simple = {
deps-link = pkgs.callPackage ./examples/simple/deps-link.nix {};
executable = pkgs.callPackage ./examples/simple/executable.nix {};
};
2022-06-19 01:24:56 +00:00
};
*/
packages = {
"simple/deps-link" = pkgs.callPackage ./examples/simple/deps-link.nix {};
"simple/bundled" = pkgs.callPackage ./examples/simple/bundled.nix {};
"simple/bundled-wrapper" = pkgs.callPackage ./examples/simple/bundled-wrapper.nix {};
"simple/executable" = pkgs.callPackage ./examples/simple/executable.nix {};
2022-06-19 01:24:56 +00:00
};
apps = {
"simple/executable" = flake-utils.lib.mkApp {
drv = self.packages.${system}."simple/executable";
name = "simple";
};
"simple/bundled-wrapper" = flake-utils.lib.mkApp {
drv = self.packages.${system}."simple/bundled-wrapper";
name = "simple";
};
2022-06-19 01:24:56 +00:00
};
2022-08-03 23:28:28 +00:00
checks = self.packages.${system};
devShells.default = pkgs.devshell.mkShell {
packages = with pkgs; [
alejandra
deno
treefmt
taplo-cli
];
2022-06-19 01:24:56 +00:00
};
}
);
}