Files
kanimaji-dart/flake.nix

58 lines
1.4 KiB
Nix

{
description = "Flutter package for rendering kanji stroke animations";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
kanjivg = {
url = "github:KanjiVG/kanjivg";
flake = false;
};
};
outputs = {
self,
nixpkgs,
kanjivg
}: let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: lib.genAttrs systems (system: f system nixpkgs.legacyPackages.${system});
in {
devShells = forAllSystems (system: pkgs: {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
flutter
dart
];
env.KANJIVG_PATH = "${kanjivg}/kanji";
};
});
packages = let
src = builtins.filterSource (path: type: let
baseName = baseNameOf (toString path);
in !(lib.any (b: b) [
(!(lib.cleanSourceFilter path type))
(baseName == "nix" && type == "directory")
(baseName == ".envrc" && type == "regular")
(baseName == "flake.lock" && type == "regular")
(baseName == "flake.nix" && type == "regular")
])) ./.;
in forAllSystems (system: pkgs: {
# default = self.packages.${system}.kanjimaji;
filteredSource = pkgs.runCommandLocal "filtered-source" { } ''
ln -s ${src} $out
'';
});
};
}