Add flake.nix

This commit is contained in:
2025-07-06 16:45:58 +02:00
parent 4871052a4b
commit ca732c1306
5 changed files with 68 additions and 1 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
node_modules
result*

2
app.js Normal file → Executable file
View File

@@ -1,3 +1,5 @@
#!/usr/bin/env node
import express from 'express';
import {createClient} from 'db-vendo-client/index.js';
import {profile as dbnavProfile} from 'db-vendo-client/p/dbnav/index.js';

27
flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1751637120,
"narHash": "sha256-xVNy/XopSfIG9c46nRmPaKfH1Gn/56vQ8++xWA8itO4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5c724ed1388e53cc231ed98330a60eb2f7be4be3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

34
flake.nix Normal file
View File

@@ -0,0 +1,34 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... }: let
forAllSystems = f: (nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let
pkgs = import nixpkgs { inherit system; };
in f { inherit pkgs system; } ));
in {
packages = forAllSystems ({pkgs, system, ...}: {
traveldrafter = pkgs.buildNpmPackage rec {
pname = "traveldrafter";
version = "0.0.1";
src = ./.;
npmDeps = pkgs.importNpmLock {
npmRoot = src;
};
npmConfigHook = pkgs.importNpmLock.npmConfigHook;
dontNpmBuild = true;
};
default = self.packages.${system}.traveldrafter;
});
hydraJobs = {
inherit (self)
packages;
};
};
}

View File

@@ -3,9 +3,11 @@
"version": "0.0.1",
"main": "index.js",
"scripts": {
"start": "node app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"bin": {
"traveldrafter": "app.js"
},
"author": "clerie",
"license": "AGPL-3.0-or-later",
"description": "",