flake.nix: init
This commit is contained in:
26
flake.lock
generated
Normal file
26
flake.lock
generated
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1754214453,
|
||||||
|
"narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
49
flake.nix
Normal file
49
flake.nix
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
description = "Flutter package for rendering kanji stroke animations";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
}: 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 {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
flutter
|
||||||
|
dart
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user