added cheap way to run program from nix
This commit is contained in:
1 parent
84abee712d
commit
def2de2d85
2 files changed
+37
-19
No files matched your search
@@ -18,7 +18,7 @@ public class DataService
|
|||||||
"tertiary_link",
|
"tertiary_link",
|
||||||
"residential",
|
"residential",
|
||||||
"unclassified"];
|
"unclassified"];
|
||||||
private readonly string path = "/home/didier/dev/YongeStreet/real.duckdb";
|
private readonly string path = System.Environment.GetEnvironmentVariable("PREPROCESSED_DUCKDB_FILE") ?? "/home/didier/dev/YongeStreet/real.duckdb";
|
||||||
|
|
||||||
public IList<Road> GetRoads(string city, DateOnly extractDate)
|
public IList<Road> GetRoads(string city, DateOnly extractDate)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,23 +102,21 @@
|
|||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static-server-url = "https://static.home.all-dressed-programming.com";
|
||||||
geofabrik-base-url =
|
geofabrik-base-url =
|
||||||
"https://static.home.all-dressed-programming.com/download.geofabrik.de/north-america/canada/";
|
"${static-server-url}/download.geofabrik.de/north-america/canada/";
|
||||||
|
|
||||||
osm-quebec."2020" = pkgs.fetchurl {
|
osm-quebec."2020" = pkgs.fetchurl {
|
||||||
url = "${geofabrik-base-url}quebec-200101.osm.pbf";
|
url = "${geofabrik-base-url}quebec-200101.osm.pbf";
|
||||||
hash =
|
hash = "sha256-RYoz4Qo/xwiEVBoA4xRHHpt8kvNS/mHskJBmR4+3vQk=";
|
||||||
"sha256-RYoz4Qo/xwiEVBoA4xRHHpt8kvNS/mHskJBmR4+3vQk=";
|
|
||||||
};
|
};
|
||||||
osm-quebec."2021" = pkgs.fetchurl {
|
osm-quebec."2021" = pkgs.fetchurl {
|
||||||
url = "${geofabrik-base-url}quebec-210101.osm.pbf";
|
url = "${geofabrik-base-url}quebec-210101.osm.pbf";
|
||||||
hash =
|
hash = "sha256-kKi/5hCVHaVvMVFAJWpJGPybmKwDu0QXePimYnHBKKk=";
|
||||||
"sha256-kKi/5hCVHaVvMVFAJWpJGPybmKwDu0QXePimYnHBKKk=";
|
|
||||||
};
|
};
|
||||||
osm-quebec."2022" = pkgs.fetchurl {
|
osm-quebec."2022" = pkgs.fetchurl {
|
||||||
url = "${geofabrik-base-url}quebec-220101.osm.pbf";
|
url = "${geofabrik-base-url}quebec-220101.osm.pbf";
|
||||||
hash =
|
hash = "sha256-iZUm+vMiDH6eyf4kmee6O8z+lN/voyjAt4RtzmSU6Wo=";
|
||||||
"sha256-iZUm+vMiDH6eyf4kmee6O8z+lN/voyjAt4RtzmSU6Wo=";
|
|
||||||
};
|
};
|
||||||
osm-quebec."2023" = pkgs.fetchurl {
|
osm-quebec."2023" = pkgs.fetchurl {
|
||||||
url = "${geofabrik-base-url}quebec-230101.osm.pbf";
|
url = "${geofabrik-base-url}quebec-230101.osm.pbf";
|
||||||
@@ -166,17 +164,10 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
python-virtual-env = pkgs.python312.withPackages (ps: [
|
processed-duckdb-file = pkgs.fetchurl {
|
||||||
ps.matplotlib
|
url = "${static-server-url}/yongestreet/duckdb/2025-01-06.duckdb";
|
||||||
ps.jupyter
|
hash = "sha256-jZEkKg/D3MOVWprVGmsc/ev2fY6TVcN3tD3NH23B2h4=";
|
||||||
ps.tqdm
|
};
|
||||||
ps.duckdb
|
|
||||||
ps.pandas
|
|
||||||
ps.unidecode
|
|
||||||
ps.geopy
|
|
||||||
ps.click
|
|
||||||
ps.jinja2
|
|
||||||
]);
|
|
||||||
|
|
||||||
web-server = pkgs.buildDotnetModule {
|
web-server = pkgs.buildDotnetModule {
|
||||||
pname = "YongeStreet";
|
pname = "YongeStreet";
|
||||||
@@ -189,8 +180,35 @@
|
|||||||
dotnet-runtime = pkgs.dotnetCorePackages.aspnetcore_8_0;
|
dotnet-runtime = pkgs.dotnetCorePackages.aspnetcore_8_0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
yonge-street = pkgs.writeShellApplication {
|
||||||
|
name = "yong-street";
|
||||||
|
runtimeInputs = [ ];
|
||||||
|
text = ''
|
||||||
|
cd ${web-server}/lib/YongeStreet
|
||||||
|
pwd
|
||||||
|
export PREPROCESSED_DUCKDB_FILE="${processed-duckdb-file}"
|
||||||
|
${web-server}/bin/YongeStreet
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
python-virtual-env = pkgs.python312.withPackages (ps: [
|
||||||
|
ps.matplotlib
|
||||||
|
ps.jupyter
|
||||||
|
ps.tqdm
|
||||||
|
ps.duckdb
|
||||||
|
ps.pandas
|
||||||
|
ps.unidecode
|
||||||
|
ps.geopy
|
||||||
|
ps.click
|
||||||
|
ps.jinja2
|
||||||
|
]);
|
||||||
|
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
|
default = yonge-street;
|
||||||
|
yonge-street = yonge-street;
|
||||||
historical-data-dir = historical-data-dir;
|
historical-data-dir = historical-data-dir;
|
||||||
poly2geojson = poly2geojson;
|
poly2geojson = poly2geojson;
|
||||||
osmosis = osmosis;
|
osmosis = osmosis;
|
||||||
|
|||||||
Reference in new issue
Block a user