From 2ce52e5748ec6acc809d5966329499646ed75b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 14 Jun 2026 11:36:04 +0200 Subject: [PATCH] flake.nix: add package --- flake.nix | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index 6701ad8..67f0e94 100644 --- a/flake.nix +++ b/flake.nix @@ -3,29 +3,37 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, flake-utils}: + flake-utils.lib.eachDefaultSystem (system: let - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - - forAllSystems = f: - nixpkgs.lib.genAttrs systems (system: - f (import nixpkgs { inherit system; })); + pkgs = import nixpkgs { inherit system; }; in { - devShells = forAllSystems (pkgs: { + packages.resspublica = pkgs.python314Packages.buildPythonApplication { + pname = "resspublica"; + version = "0.1"; + src = ./src; + pyproject = true; + + build-system = with pkgs.python314Packages; [ setuptools ]; + + dependencies = with pkgs.python314Packages; [ + sparqlwrapper + feedgen + ]; + mainProgram = "resspublica.py"; + }; + packages.default = self.packages.${system}.resspublica; + devShells = { default = pkgs.mkShell { packages = with pkgs; [ python3 - python3Packages.sparqlwrapper - python3Packages.feedgen + python314Packages.sparqlwrapper + python314Packages.feedgen ]; }; - }); - }; + }; + }); }