!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

887 Members
179 Servers

Load older messages


SenderMessageTime
18 Jun 2023
@winston:milli.ng@winston:milli.ng
In reply to @kranzes:matrix.org
https://ayats.org/blog/channels-to-flakes

Thank you.

I am still in a rough in-between state, but its working right now. https://github.com/wrmilling/nixos-configuration

22:36:30
19 Jun 2023
@jhu:pikaviestin.fiJhu 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:matrix.orgj-k best to discuss in #dream2nix:nixos.org 11:58:13
@pajarove:matrix.orgpajarove

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:matrix.orgpajarove 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:matrix.orgpajaroveit does work in the devshell14:04:18
@j-k:matrix.orgj-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:matrix.orgpajaroveyeah, that's what I found, probably should make a wrapper15:20:32
@0xmrtt:projectsegfau.lt@0xmrtt:projectsegfau.lt joined the room.22:24:39
20 Jun 2023
@tioan:dunwyn.xyz@tioan:dunwyn.xyz joined the room.07:59:31
21 Jun 2023
@antifuchs:asf.computer@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@adam:valkor.netis that PR from a fork or the same repo?17:50:37
@antifuchs:asf.computer@antifuchs:asf.computerit's in the original repo17:51:18
@adam:valkor.net@adam:valkor.netwhat if you use the actual branch name?17:52:03
@antifuchs:asf.computer@antifuchs:asf.computerbut 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 ... lacking17:52:18
@antifuchs:asf.computer@antifuchs:asf.computer(as are the docs, tbqh)17:52:22
@antifuchs:asf.computer@antifuchs:asf.computerahhh, I think I see how to get at the branch name. this might work!17:54:57
@antifuchs:asf.computer@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@adam:valkor.netyou're welcome. :) 18:26:27
@alx_sim:matrix.org@alx_sim:matrix.org joined the room.19:43:08
23 Jun 2023
@peacememories:matrix.orgpeacememories (Old) left the room.07:30:47
@peacememories:matrix.orgpeacememories (Old) joined the room.07:31:03
@emilazy:matrix.orgemily 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
@emilazy:matrix.orgemily e.g. the type (github etc.) and repo 11:27:44
@emilazy:matrix.orgemilyit seems like there might not be?11:27:53
@a-kenji:matrix.orgkenjiDoesn't nix flake metadata show that?11:29:51
@emilazy:matrix.orgemilyI want to access it from inside Nix code11:30:14
@a-kenji:matrix.orgkenjiAh!11:30:57
@crtified:crtified.meCRTified
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:crtified.meCRTifiedbut they're different for e.g. non-flake inputs11:34:39

Show newer messages


Back to Room ListRoom Version: 6