aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2026-06-18 22:41:33 +0200
committeruser@node5.net <user@node5.net>2026-06-18 23:10:33 +0200
commit84f6db9d7b5070c2101cd0fb3971471df70e13f9 (patch)
tree7ed03e161b0f1115f3315b5b54ae1b8f149cc8fc /flake.nix
parent52c5f75f80136bd5017abc88cb4b176b6aae9cda (diff)
nixify running
needs databse, this is handled separately
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..d197227
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,52 @@
+{
+ description = "A basic flake using pyproject.toml project metadata";
+
+ inputs = {
+ pyproject-nix = {
+ url = "github:nix-community/pyproject.nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = { nixpkgs, pyproject-nix, ... }:
+ let
+ inherit (nixpkgs) lib;
+
+ project = pyproject-nix.lib.project.loadPyproject {
+ # Read & unmarshal pyproject.toml relative to this project root.
+ # projectRoot is also used to set `src` for renderers such as buildPythonPackage.
+ projectRoot = ./.;
+ };
+
+ # This example is only using x86_64-linux
+ pkgs = nixpkgs.legacyPackages.x86_64-linux;
+
+ python = pkgs.python3;
+
+ # Returns an attribute set that can be passed to `buildPythonPackage`.
+ attrs = project.renderers.buildPythonPackage { inherit python; };
+
+ pkg = python.pkgs.buildPythonPackage (attrs // {
+ meta = {
+ description = "Webinterface for map.node5.net";
+ homepage = "https://map.node5.net/";
+ changelog = "https://git.node5.net/map.node5.net/log/";
+ mainProgram = "node5-map";
+ };
+ propagatedBuildInputs = (attrs.propagatedBuildInputs or []) ++ [ pkgs.git ]; # Make git binary available
+ postInstall = ''
+ echo $src
+ echo $out
+ cp -r $src/src/static/ $out/${python.sitePackages}
+ cp -r $src/src/templates/ $out/${python.sitePackages}
+ '';
+ });
+
+ # Add missing templates and static content, that wasn't auto discovered by the python build process
+ in
+ {
+ packages.x86_64-linux.default = pkg;
+ pythonPath = "${python.pkgs.makePythonPath attrs.dependencies}:${pkg}/${python.sitePackages}";
+ };
+}
+