nix-base base snap broken, because top-level bind-mount /nix blacklisted

Bug #1912962 reported by Alexander Nikolaev
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Triaged
Medium
Unassigned

Bug Description

When I tried to build a snap package with nixpkgs's makeSnap tool (which almost a self-contained container image, with absolute paths, which starts from /nix, and have a dependency on nix-base snap for setting up empty directories structure). Also it rely on bind-mount $SNAP/nix -> /nix, which was blacklisted by following commit https://github.com/snapcore/snapd/commit/7ae57afc07c5bb5854525921ad112b2413bb2ee5)

I asked on #snappy IRC, and learn, that there was some agreement about whitelisted base snaps, which allow extra top-level bind-mounts, including nix-base.

Citing from IRC:
13:48 < zyga> avn, it's a bug in snapd
13:48 < zyga> mborzecki, ^
13:48 < zyga> mborzecki, in snap/validate.go:446 we should allow nix if the base is nix-base
13:49 < zyga> mborzecki, can you work with avn on getting this fixed
13:49 < zyga> nix-base was something that was brought up in Montreal a few years back
13:49 < zyga> but I guess it's not tested as a working base

1 List of permitted toplevel items -- https://github.com/snapcore/snapd/blob/master/snap/validate.go#L446
2 nix-base snap -- source https://github.com/NixOS/snapd-nix-base and package in repo https://snapcraft.io/nix-base
3 related ticket in nixpkgs -- https://github.com/NixOS/nixpkgs/issues/100618
(I'd put there link on this ticket as well)

Changed in snappy:
assignee: nobody → Maciej Borzecki (maciek-borzecki)
Changed in snappy:
status: New → Triaged
importance: Undecided → Medium
Changed in snappy:
assignee: Maciej Borzecki (maciek-borzecki) → nobody
Michael Vogt (mvo)
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.