This commit is contained in:
Robin Appelman 2023-11-24 18:37:23 +01:00
commit 25e828d9fb
6 changed files with 119 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
result*
.direnv

60
flake.lock generated Normal file
View file

@ -0,0 +1,60 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1700790289,
"narHash": "sha256-9i4C64NALHmLzSXQ01a5sESslCp0H/Eyxg8HtO8KkNc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3b8ca944ce5c089daf2bd739d0ae8e0849e88197",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "release-23.05",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

56
flake.nix Normal file
View file

@ -0,0 +1,56 @@
{
inputs = {
nixpkgs.url = "nixpkgs/release-23.05";
utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (system: let
overlays = [];
pkgs = import nixpkgs {
inherit system overlays;
};
inherit (pkgs.stdenv) mkDerivation;
in rec {
packages = rec {
images = mkDerivation {
name = "tf-map-images";
version = "0.1.0";
src = ./images;
nativeBuildInputs = with pkgs; [xcftools imagemagick];
buildPhase = ''
make
'';
installPhase = ''
cp -r dist $out
'';
};
maps = mkDerivation rec {
name = "tf-maps";
version = "0.1.0";
src = ./data;
buildPhase = "";
installPhase = ''
mkdir $out
cp boundaries.json $out/boundaries.json
cp -r ${images} $out/images
'';
};
default = maps;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
vips
xcftools
];
};
});
}

0
images/dist/.gitkeep vendored Normal file
View file