Skip to content

viperML/hover-rs

Repository files navigation

hover-rs - Protective home overlay

Tired of programs messing your precious $HOME ? hover-rs is for you!


hover-rs uses Linux's user namespaces to mount a volatile overlayfs over your $HOME. Any write or delete operation is redirected to the upper layer, while your $HOME is left intact. Read more in my blogpost: https://ayats.org/blog/hover.

Usage

$ hover                 # Enter hover by just running the command
You are now hovering~
  A layer is covering your /home/ayats
  You can find your top layer in: /home/ayats/.cache/hover-rs/layer-2024-06-11-0635-evCxznv

$ touch foo             # File "foo" is created under the hover

$ exit                  # Hover is just a subprocess

Leaving hover
  You can find your top layer in: /home/ayats/.cache/hover-rs/layer-2024-06-11-0635-evCxznv

$ file foo              # File "foo" is gone
foo: cannot open `foo' (No such file or directory)

Requirements

Your kernel must have user namespaces and overlayfs enabled:

$ zcat /proc/config.gz | grep -e NAMESPACES= -e USER_NS= -e OVERLAY_FS=
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_OVERLAY_FS=m

Static binaries

CI builds statically-linked binaries (with musl). You can use download and use them directly:

$ curl -OL https://github.com/viperML/hover-rs/releases/download/latest/hover-static-x86_64-linux
$ chmod +x hover-static-x86_64-linux
$ ./hover-static-x86_64-linux

Building

With nix:

nix build github:viperML/hover-rs

With guix:

guix build -L .

If you bring your own cargo+rustc, just cargo build.

Attribution

Inspired by https://github.com/max-privatevoid/hover, which uses fuse-overlayfs.