ITADN

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

#10Opengabyx 创建于 2025-02-03
G
gabyxcommented
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: ```nix 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.txt` which does not work. How do I access some file which is inside the `src` config above, namely `src = ../..` == `/repo-dir`? P.S: Maybe snowfall should internaly use `lib.filesets` which provides a better way to access
1 条评论