| 19 Jun 2023 |
Jhu | Do you have experience with dream2nix and nodejs projects? I get flat out segfault from nix run when trying to run detect-projects. Does not seem to matter if running it through a local flake output, or independently directly from github. | 10:48:56 |
j-k | best to discuss in #dream2nix:nixos.org | 11:58:13 |
pajarove | how exactly should I specify runtime dependencies in mkDerivation?
{
description = "";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [ curl fzf jq moreutils screenfetch ];
shellHook = "echo 'entering dev shell'";
};
defaultPackage = pkgs.stdenv.mkDerivation {
name = "cgpt";
src = self;
buildDeps = with pkgs; [ curl fzf jq moreutils screenfetch ];
buildPhase = "true";
installPhase = "mkdir -p $out/bin; install -t $out/bin cgpt";
};
});
}
| 14:01:31 |
pajarove | screenfetch shows up in nix-store --query --requisites --include-outputs '/nix/store/ld114b4f08vvl8d0n4ckqfjpssmi827g-cgpt.drv, but is not available to the cgpt script (a random chatgpt repl I had in my scripts folder) | 14:02:43 |
pajarove | it does work in the devshell | 14:04:18 |
j-k | it depends on how the thing you're packaging resolves runtime dependencies.
you probably want makeWrapper to provide it a PATH if you search nixpkgs you should find some examples. maybe look at mons
fyi this question isn't specific to flakes
| 15:10:16 |
pajarove | yeah, that's what I found, probably should make a wrapper | 15:20:32 |
| @0xmrtt:projectsegfau.lt joined the room. | 22:24:39 |
| 20 Jun 2023 |
| @tioan:dunwyn.xyz joined the room. | 07:59:31 |
| 21 Jun 2023 |
@antifuchs:asf.computer | Is there a way using git+ssh URLs to reference a pull request branch on github? I'm trying nix flake metadata 'git+ssh://git@github.com/antifuchs/home?ref=pulls/298/head' (private repo, sorry) and that says it can't find remote ref refs/heads/pulls/298/head | 17:48:11 |
@adam:valkor.net | is that PR from a fork or the same repo? | 17:50:37 |
@antifuchs:asf.computer | it's in the original repo | 17:51:18 |
@adam:valkor.net | what if you use the actual branch name? | 17:52:03 |
@antifuchs:asf.computer | but good call - maybe there's a way to find the branch of the PR? I'm trying to determine that in a hydra jobset derivation, and my understanding of how to go from one bit of information to the other is ... lacking | 17:52:18 |
@antifuchs:asf.computer | (as are the docs, tbqh) | 17:52:22 |
@antifuchs:asf.computer | ahhh, I think I see how to get at the branch name. this might work! | 17:54:57 |
@antifuchs:asf.computer | perfect, hydra gets the entire pull request API response, so I can easily use info.head.ref as the branch ref. thanks for the help (: | 17:58:20 |
@adam:valkor.net | you're welcome. :) | 18:26:27 |
| @alx_sim:matrix.org joined the room. | 19:43:08 |
| 23 Jun 2023 |
| peacememories (Old) left the room. | 07:30:47 |
| peacememories (Old) joined the room. | 07:31:03 |
emily | is there any way to get information on the input declaration of a flake input from the input values passed to outputs? | 11:27:36 |
emily | e.g. the type (github etc.) and repo | 11:27:44 |
emily | it seems like there might not be? | 11:27:53 |
kenji | Doesn't nix flake metadata show that? | 11:29:51 |
emily | I want to access it from inside Nix code | 11:30:14 |
kenji | Ah! | 11:30:57 |
CRTified | In reply to @emilazy:matrix.org it seems like there might not be? Only thing I can find ad hoc is the sourceInfo and _type attributes | 11:34:14 |
CRTified | but they're different for e.g. non-flake inputs | 11:34:39 |
CRTified | (non-flake has neither of them, but rev and shortRev instead) | 11:35:14 |