{"id":20808854,"url":"https://github.com/mazurel/nix-cleaned-path-issue","last_synced_at":"2026-04-19T21:03:34.691Z","repository":{"id":175901337,"uuid":"400505455","full_name":"Mazurel/nix-cleaned-path-issue","owner":"Mazurel","description":"This repository demonstrates issue with restricted mode and cleaned paths in Nix/Nixpkgs with flakes","archived":false,"fork":false,"pushed_at":"2021-08-28T11:25:58.000Z","size":7,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T09:58:14.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mazurel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-08-27T12:42:28.000Z","updated_at":"2021-08-28T11:26:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"9038a3a1-b200-443c-be4c-82f395fd6fc0","html_url":"https://github.com/Mazurel/nix-cleaned-path-issue","commit_stats":null,"previous_names":["mazurel/nix-cleaned-path-issue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mazurel/nix-cleaned-path-issue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazurel%2Fnix-cleaned-path-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazurel%2Fnix-cleaned-path-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazurel%2Fnix-cleaned-path-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazurel%2Fnix-cleaned-path-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mazurel","download_url":"https://codeload.github.com/Mazurel/nix-cleaned-path-issue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazurel%2Fnix-cleaned-path-issue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32022561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T19:56:25.485Z","updated_at":"2026-04-19T21:03:34.685Z","avatar_url":"https://github.com/Mazurel.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test of cleaned paths and restricted mode in Nix \n\nThis is a small experiment that demonstrates an issue with flake's restricted mode.\n\n## Related issues\n\n- https://github.com/NixOS/nix/issues/3732\n- https://github.com/NixOS/nix/issues/3234\n\n## Structure and usage\n\nThis project contains legacy and flake implementation of building simple hello project.\nTo run flake build, use `nix build .#\u003cType\u003e` and to run legacy build, use `nix build -f ./default.nix --argstr type \"\u003cType\u003e\"`.\n\nThere is also `test.sh` script which runs all builds automatically.\n\n## Available `Type`s of builds\n\nThere are 4 types, of builds:\n\n- `hello-passed-src` - Simply passes `./.` folder into `hello.nix` which uses it to build derivation. Works for flake and legacy.\n- `hello-passed-cleaned-src` - Passes `./.` folder cleaned with `cleanSource` and uses it to build derivation. Works for legacy, fails for flake due to restricted mode.\n- `hello-not-passed-src` - Loads `./.` folder by itself and uses it to build derivation. Works for flake and legacy.\n- `hello-not-passed-cleaned-src` - Loads `./.` folder by itself, cleans it with `cleanSource` and uses it to build derivation. Works for legacy, fails for flake due to restricted mode.\n\n## Dump of `test.sh` which shows above statements\n\n```\nCurrent type: hello-passed-src\nLegacy:\nHello World !\n\nFlake:\nHello World !\n\nCurrent type: hello-passed-cleaned-src\nLegacy:\nHello World !\n\nFlake:\nerror: access to path '/nix/store/4p7vhys75r7bv8dl9lhfcvgxk01jh704-source/test.txt' is forbidden in restricted mode\n(use '--show-trace' to show detailed location information)\n\nCurrent type: hello-not-passed-src\nLegacy:\nHello World !\n\nFlake:\nHello World !\n\nCurrent type: hello-not-passed-cleaned-src\nLegacy:\nHello World !\n\nFlake:\nerror: access to path '/nix/store/4p7vhys75r7bv8dl9lhfcvgxk01jh704-source/test.txt' is forbidden in restricted mode\n(use '--show-trace' to show detailed location information)\n```\n\n## Fixing PR\n\nIt seems like [Tomberek's PR](https://github.com/NixOS/nix/pull/5163) fixes this issue.\n\n```\n$ nix shell \"github:tomberek/nix/flakes_filterSource\"\n$ sh test.sh \n```\n\nDoes not produce any errors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazurel%2Fnix-cleaned-path-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazurel%2Fnix-cleaned-path-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazurel%2Fnix-cleaned-path-issue/lists"}