dream2nix icon indicating copy to clipboard operation
dream2nix copied to clipboard

nix run .#package.resolve does not work if packagesDir is defined

Open tgunnoe opened this issue 3 years ago • 1 comments

First, If you try to define config.packagesDir without the directory already existing (in this case, a dir name same as default-- but any name produces the same errors), you get:

error: getting status of '/nix/store/7458lklxyckwz2gcifnv29vys0sybvmf-source/dream2nix-packages': No such file or directory

Upon creating the directory and adding it to git, now running the command nix run .#test.resolve gives this error:

error: the string '.*/nix/store/y35q3pg84s5d855kchj1h2nj7wnrvmqa-dream2nix-packages' is not allowed to refer to a store path (such as '/nix/store/y35q3pg84s5d855kchj1h2nj7wnrvmqa-dream2nix-packages')

       at /nix/store/dq2r5b5rl9y2kvf4j37hajrmzacnz82h-source/src/lib/default.nix:199:10:

          198|       (baseNameOf path != "flake.nix")
          199|       && l.match ''.*/${sanitizedPackagesDir}'' path == null
             |          ^
          200|       && (l.any

Flake:

  {
    inputs.dream2nix.url = "github:nix-community/dream2nix";
    outputs = { self, dream2nix }@inputs:
      let
        supportedSystems = [ "x86_64-linux" ];
      in
        let
          dream2nix = inputs.dream2nix.lib.init {
            systems = supportedSystems;
            config.projectRoot = ./.;
            config.packagesDir = ./dream2nix-packages;
          };
        in
          dream2nix.makeFlakeOutputs {
            pname = "test";
            source = ./.;
          };
  }

tgunnoe avatar May 23 '22 14:05 tgunnoe

packagesDir needs to be a string expressing a relative path. We should probably have some type checking here.

DavHau avatar Jun 16 '22 21:06 DavHau