Skip to content

bug/question: How to access src when flake.nix inside subfolder in Git repo. #10

@gabyx

Description

@gabyx

The library is great, but I ran into some trouble
when I have the following structure:

repo-dir/
    tools/nix/
      - shells/default/default.nix
      - flake.nix
     config/file.txt

I configure snowfall in repo-dir/tools/nix/flake.nix like this but I have no way to access the root of the repository:

outputs =
    inputs:
    let
      rootPath = ../..;
      lib = inputs.snowfall-lib.mkLib {
        inherit inputs;
        src = rootPath;

        snowfall = {
          root = rootPath + "/tools/nix";
        };
      };
    in
    lib.mkFlake { };

Question: How do I load a file in tools/nix/shells/default/default.nix which is located in repo-dir/config/file.txt?
I tried lib.snowfall.fs.get-file ../../config/file.txtwhich does not work. How do I access some file which is inside thesrcconfig above, namelysrc = ../..==/repo-dir`?

P.S: Maybe snowfall should internaly use lib.filesets which provides a better way to access

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions