From f5ff82d7293b50ec412231e65b4480d6bf206fcc Mon Sep 17 00:00:00 2001 From: "user@node5.net" Date: Tue, 23 Jun 2026 00:39:08 +0200 Subject: nixify repo, 2026 headline design, debug environment variables --- flake.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b9933b9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + 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 = "Bornhack schedule web displayer with a teletext theme"; + homepage = "https://text-tv.bornhack.node5.net/"; + changelog = "https://git.node5.net/misc/text-tv.bornhack.node5.net/log/"; + mainProgram = "node5_text-tv_bornhack"; + }; + 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} + ''; + }); + in + { + packages.x86_64-linux.default = pkg; + pythonPath = "${python.pkgs.makePythonPath attrs.dependencies}:${pkg}/${python.sitePackages}"; + }; +} -- cgit v1.3.1