| 6 Nov 2023 |
K900 | And then you need to get the contents of it to continue evaluation | 21:11:35 |
K900 | Which is basically IFD | 21:11:46 |
K900 | (except it's not technically FD) | 21:11:52 |
matthewcroughan | yeah, so anything that requires the internet to fill the key/values in a drv | 21:12:01 |
K900 | And I see the problem with overrides now | 21:12:44 |
K900 | I think | 21:12:54 |
adisbladis | In reply to @zeratax:dmnd.sh
this works:
#pyproject.toml
[tool.poetry.scripts]
deploy_cluster_aws = "deploy_cluster_aws:main"
while this doesn't
#pyproject.toml
[tool.poetry.scripts]
deploy_cluster_aws = { reference = "deploy_cluster_aws", extras = ["aws"], type="console" }
but should be valid, no? https://python-poetry.org/docs/pyproject/#scripts
$ nix develop
warning: Git tree '/home/jonaa/git/deployment' is dirty
error: value is a set while a string was expected
at /nix/store/knlmp0ljafmp1k4fkf61jdhia6l9kw1q-source/shell-scripts.nix:8:31:
7| let
8| elem = builtins.elemAt (builtins.split ":" entrypoint);
| ^
9| module = elem 0;
(use '--show-trace' to show detailed location information)
I think this would make it work:
diff --git a/shell-scripts.nix b/shell-scripts.nix
index 23362a2..d45117d 100644
--- a/shell-scripts.nix
+++ b/shell-scripts.nix
@@ -4,8 +4,10 @@
}:
let
mkScript = bin: entrypoint:
- let
- elem = builtins.elemAt (builtins.split ":" entrypoint);
+ let
+ elem = builtins.elemAt (builtins.split ":" (
+ if builtins.typeOf entrypoint == "set" then entrypoint.reference else entrypoint
+ ));
module = elem 0;
fn = elem 2;
in
| 21:34:22 |
adisbladis | In reply to @zeratax:dmnd.sh
this works:
#pyproject.toml
[tool.poetry.scripts]
deploy_cluster_aws = "deploy_cluster_aws:main"
while this doesn't
#pyproject.toml
[tool.poetry.scripts]
deploy_cluster_aws = { reference = "deploy_cluster_aws", extras = ["aws"], type="console" }
but should be valid, no? https://python-poetry.org/docs/pyproject/#scripts
$ nix develop
warning: Git tree '/home/jonaa/git/deployment' is dirty
error: value is a set while a string was expected
at /nix/store/knlmp0ljafmp1k4fkf61jdhia6l9kw1q-source/shell-scripts.nix:8:31:
7| let
8| elem = builtins.elemAt (builtins.split ":" entrypoint);
| ^
9| module = elem 0;
(use '--show-trace' to show detailed location information)
* I think this would make it work:
diff --git a/shell-scripts.nix b/shell-scripts.nix
index 23362a2..d45117d 100644
--- a/shell-scripts.nix
+++ b/shell-scripts.nix
@@ -4,8 +4,10 @@
}:
let
mkScript = bin: entrypoint:
- let
- elem = builtins.elemAt (builtins.split ":" entrypoint);
+ let
+ elem = builtins.elemAt (builtins.split ":" (
+ if builtins.typeOf entrypoint == "set" then entrypoint.reference else entrypoint
+ ));
module = elem 0;
fn = elem 2;
in
| 21:34:33 |
| 7 Nov 2023 |
| Alexandro de Oliveira joined the room. | 02:07:25 |
adisbladis | Far from complete but taking a bit of a shape:
https://github.com/adisbladis/pdm2nix
https://adisbladis.github.io/pdm2nix/ | 03:42:45 |
| @softinio:matrix.org changed their profile picture. | 17:56:37 |
| @fractivore:cyberia.club joined the room. | 19:14:30 |
@fractivore:cyberia.club | Hello, so I'm trying to build this project: https://github.com/blacklanternsecurity/bbot using poetry2nix | 19:16:18 |
@fractivore:cyberia.club | I tried using the flake with nix flake init --template github:nix-community/poetry2nix | 19:17:11 |
@fractivore:cyberia.club | Then, nix build | 19:17:19 |
@fractivore:cyberia.club | My memory usage spiked and I had to SIGINT the process. I closed all my open applications and tried running nix build again, and now I'm getting:
error: builder for '/nix/store/pnl61k9cn2g7n3cfwysxcb36bqvq5d8i-python3.11-wordninja-2.0.0.drv' failed with exit code 2;
last 10 log lines:
> File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
> File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
> File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
> File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
> ModuleNotFoundError: No module named 'setuptools'
| 19:19:07 |
K900 | That's normal | 19:19:51 |
K900 | Well, not really normal but | 19:19:54 |
K900 | https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md | 19:20:02 |
@fractivore:cyberia.club | ohhh alright, excellent | 19:21:49 |
@fractivore:cyberia.club | okay, so I tried modifying the flake.nix that was previously generated, to include:
packages = {
myapp = mkPoetryApplication { projectDir = self;
overrides = poetry2nix.defaultPoetryOverrides.extend
(self: super: {
wordninja = super.wordninja.overridePythonAttrs
(
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
}
);
});
};
default = self.packages.${system}.myapp;
};
| 19:30:20 |
@fractivore:cyberia.club | I got:
error: attribute 'defaultPoetryOverrides' missing | 19:31:16 |
K900 | The flake template is slightly wrong | 19:32:10 |
K900 | I think | 19:32:11 |
K900 | Actually no it's not | 19:32:35 |
K900 | You should update the line | 19:32:38 |
K900 | inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication; to inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication defaultPoetryOverrides; | 19:32:47 |
K900 | And then use defaultPoetryOverrides instead of poetry2nix.defaultPoetryOverrides | 19:32:57 |
@fractivore:cyberia.club | hmm, okay, I tried that, and now I'm getting:
> ModuleNotFoundError: No module named 'poetry' I know that's the same form as before and it said to work through them one after the other, but is that really right? This is poetry2nix after all | 19:37:20 |
K900 | Yes | 19:37:29 |