diff --git a/flake.lock b/flake.lock index 7c28c5a..43c5537 100644 --- a/flake.lock +++ b/flake.lock @@ -104,6 +104,45 @@ "type": "github" } }, + "flake-utils_4": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1698974481, + "narHash": "sha256-yPncV9Ohdz1zPZxYHQf47S8S0VrnhV7nNhCawY46hDA=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "4bb5e752616262457bc7ca5882192a564c0472d2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1694499547, @@ -122,26 +161,51 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1700678569, - "narHash": "sha256-2Ki+2UvOidxEb3xB4ADqlbPQ2BZOF4uZMR094O8or2I=", + "lastModified": 1702780907, + "narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f1180704ac35baded1a74164365ac7cdfba6f38", + "rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils_4", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1702591455, + "narHash": "sha256-vK54IZysaxuUOe+abJO0wD40bxqwfZ2aBOhUWS/O/oA=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "9d9d434528404a22fb0c8283fea1ea3a7410ff80", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { "epnix": "epnix", "flake-compat": "flake-compat", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "poetry2nix": "poetry2nix" } }, "systems": { @@ -158,6 +222,56 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1699786194, + "narHash": "sha256-3h3EH1FXQkIeAuzaWB+nK0XK54uSD46pp+dMD3gAcB4=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "e82f32aa7f06bbbd56d7b12186d555223dc399d1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 5b099c3..1982ad9 100644 --- a/flake.nix +++ b/flake.nix @@ -2,15 +2,22 @@ description = "A very basic flake"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + poetry2nix = { + url = "github:nix-community/poetry2nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; flake-utils.url = "github:numtide/flake-utils"; epnix.url = "github:epics-extensions/EPNix"; flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; }; + nixConfig.commit-lockfile-summary = "chore(deps): update flake.lock"; + outputs = { self, nixpkgs, + poetry2nix, flake-utils, epnix, flake-compat, @@ -25,6 +32,8 @@ }) ]; }; + inherit (epnix.packages.${system}) epics-base; + inherit (poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) mkPoetryApplication; in { packages.default = let # Numpy 1.19.5 doesn't compile with Python3.10+ @@ -33,7 +42,7 @@ # support Python 3.6, which we need to support older systems. python = pkgs.python39; in - pkgs.poetry2nix.mkPoetryApplication { + mkPoetryApplication { projectDir = ./.; inherit python; @@ -41,15 +50,7 @@ nativeBuildInputs = with pkgs; [makeWrapper]; propagatedBuildInputs = with python.pkgs; [tkinter]; - overrides = pkgs.poetry2nix.overrides.withDefaults (_final: prev: { - reportlab = prev.reportlab.overridePythonAttrs (_old: { - buildInputs = with pkgs; [(freetype.overrideAttrs (_: {dontDisableStatic = true;}))]; - }); - }); - - postInstall = let - inherit (epnix.packages.x86_64-linux) epics-base; - in '' + postInstall = '' wrapProgram $out/bin/wetest \ --set PYEPICS_LIBCA "${epics-base}/lib/linux-x86_64/libca.so" ''; @@ -70,7 +71,9 @@ }; devShells.default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [poetry python39Full]; + inputsFrom = [self.packages.${system}.default]; + nativeBuildInputs = with pkgs; [poetry]; + env.PYEPICS_LIBCA = "${epics-base}/lib/linux-x86_64/libca.so"; }; checks = import ./nix/checks {inherit pkgs;};