2022-03-12 08:16:51 +00:00
|
|
|
# home-impermanence
|
|
|
|
|
2022-03-12 08:27:13 +00:00
|
|
|
OpenBSD compatible implementation of the [impermanence project from
|
|
|
|
the NixOS community](https://nixos.wiki/wiki/Impermanence)
|
|
|
|
|
|
|
|
Such a tool permits to have your $HOME mounted with a memory
|
|
|
|
filesystem and populate it from an explicit list of files and
|
|
|
|
directories hooked from a persistent storage directory, the point
|
|
|
|
is to have a clean and reproducible environment every time you log
|
|
|
|
in with only the content you selected. No more extra files when
|
|
|
|
you start a program only once.
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
|
|
|
|
The configuration is done in two part, system wide to configure the
|
|
|
|
**impermanence** service that will mount the memory filesystem and
|
|
|
|
populate it.
|
|
|
|
|
|
|
|
## System wide
|
|
|
|
|
|
|
|
Using rcctl: `rcctl set impermanence flags -d /home/persist/ -u
|
|
|
|
my-user` and `rcctl enable impermanence`.
|
|
|
|
|
|
|
|
## User configuration
|
|
|
|
|
|
|
|
The user configuration will be done in
|
|
|
|
`/home/persist/my-user/impermanence.yml` if you chose `-d /home/persist`
|
|
|
|
for the service and `-u my-user`.
|
|
|
|
|
|
|
|
The configuration file describes the size of the memory filesystem,
|
|
|
|
the list of files and the list of directories that should be added
|
|
|
|
to the filesystem as symbolic links from the persistent directory.
|
|
|
|
|
2022-03-14 17:44:31 +00:00
|
|
|
There are currently three keys:
|
|
|
|
- **size**: which is a parameter to mount_mfs -s to give the ramdisk size
|
|
|
|
- **files**: which is a list of files relative to $HOME
|
|
|
|
- **directores**: which is a list of directories relative to $HOME
|
|
|
|
|
|
|
|
Minimalistic example of `/home/persist/my-user/impermanence.yml`:
|
|
|
|
|
|
|
|
```
|
|
|
|
size: 200m
|
|
|
|
files:
|
|
|
|
- .bashrc
|
|
|
|
- .gitconfig
|
|
|
|
- .profile
|
|
|
|
- .tmux.conf
|
|
|
|
- .xsession
|
|
|
|
directories:
|
|
|
|
- .config
|
|
|
|
- .local/share
|
|
|
|
- .mozilla
|
|
|
|
- .ssh
|
|
|
|
- Data
|
|
|
|
- Documents
|
|
|
|
- Downloads
|
|
|
|
- dev
|
|
|
|
```
|
|
|
|
|
2022-03-12 08:27:13 +00:00
|
|
|
# home-impermanence rc service
|
|
|
|
|
2022-03-14 17:34:18 +00:00
|
|
|
## restart
|
2022-03-12 08:27:13 +00:00
|
|
|
|
|
|
|
The restart parameter to the service will unmount the device and
|
|
|
|
recreate it, allowing a fresh restart.
|
|
|
|
|
2022-03-14 17:34:18 +00:00
|
|
|
## start
|
2022-03-12 08:27:13 +00:00
|
|
|
|
|
|
|
Creates and populates the home filesystem.
|
|
|
|
|
2022-03-14 17:34:18 +00:00
|
|
|
## stop
|
2022-03-12 08:27:13 +00:00
|
|
|
|
|
|
|
Umount the home filesystem.
|
2022-03-14 17:34:18 +00:00
|
|
|
|
|
|
|
## status
|
|
|
|
|
|
|
|
Tells if the mount is currently done.
|