Skip to content

More powerful path filters #64

Description

@hey2022

Adding the example path filter from the readme to cache.nixos.org results in an error with stage0-posix source bootstrap.

[[upstreams.filters]]
action  = "deny"
field   = "name"
pattern = "*-source"
error: Cannot build '/nix/store/2kbbzfsz1hzd21yj0h989s3z40cgrp58-stage0-posix-1.9.1-source.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/4f7nm8dblrdy74gmsl62b25rjrh4jcz3-stage0-posix-1.9.1-source
       Last 20 log lines:
       > error: executing '#
       >        #
       >        # Neither your store nor your substituters seems to have:
       >        #
       >        #  /1rz4g4znpzjwh1xymhjpm42vipw92pr73vdgl6xs1hycac8kf2n9
       >        #
       >        # You can create this path from an already-bootstrapped nixpkgs
       >        # using the following command:
       >        #
       >        #   nix-build '<nixpkgs>' -A make-minimal-bootstrap-sources
       >        #
       >        # Or, if you prefer, you can create this file using only `git`,
       >        # `nix`, and `xz`.  For the commands needed in order to do this,
       >        # see `make-bootstrap-sources.nix`.  Once you have the manual
       >        # result, do:
       >        #
       >        #   nix-store --add-fixed --recursive sha256 ./stage0-posix-1.9.1-source
       >        #
       >        # to add it to your store.
       >        ': No such file or directory

Is there a way I can modify the filter to deny sources with the exception of the stage0-posix source?

I'm not sure if theres a way currently but I was thinking of either making the pattern match with regex or having the filters work in a way kinda like how pam does it with filters applying in an order and filters having stuff like sufficient (skip the rest if a filter matches with allow).

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