Commit graph

29 commits

Author SHA1 Message Date
talyz
d144e365cf
all: Line up lib inherits vertically 2023-04-23 08:15:49 +02:00
talyz
cd56321db5
home-manager: Add wrappers path for fusermount
Since
886675991b
the path no longer includes the wrappers, since it's reset. To fix
this, add the wrappers to the path.
2022-11-15 18:32:06 +01:00
Gabriel Fontes
fc9ca99ef8
home-manager: adds configurable symlink/bindfs option 2022-08-22 11:31:31 -03:00
talyz
635bcd2d88
Add missing descriptions and improve existing ones
Closes #81
2022-02-13 23:27:11 +01:00
Bernardo Meurer
3fe959d3dc refactor: utillinux -> util-linux 2022-01-31 11:12:51 -08:00
Olmo Kramer
46aa52de9f
home-manager: Fix unquoted path when creating directories 2022-01-03 19:57:15 +01:00
talyz
085284c398
home-manager: Start the bind units as early as possible 2021-12-28 20:43:39 +01:00
Louis Bettens
77a0cebfdd home-manager: allow dependencies on bind mounts 2021-12-27 17:37:29 +01:00
Kim Lindberger
0616c64b0e
Merge pull request #55 from nix-community/hm-create-target-directories-for-files
home-manager: Create missing target directories for files
2021-11-19 00:30:00 +01:00
adisbladis
4b4bf5026a
home-manager: Use bash exec when calling bindexec
Right now the shell script wrapper doesn't exit which results in a lot of unnecessary bash processes.
2021-11-15 23:10:59 +00:00
talyz
6b474b097a
home-manager: Create missing target directories for files
Create missing parent directories for nonexistent files in persistent
storage.

Reported in #53.
2021-11-14 19:19:17 +01:00
talyz
58558845bc
home-manager: Create the mount point in the systemd service
This is purely for convenience when fiddling with the services
manually, since the directory is created by the activation script
already.
2021-01-27 12:39:08 +01:00
talyz
48b5d5291c
home-manager: Simplify the directory creation
The checks should be unnecessary, since `mkdir -p` is idempotent.
2021-01-27 12:37:08 +01:00
talyz
4d655d7842
home-manager: Add allowOther option to let other users read bind mounts
NixOS defaults to not letting fuse mounts be allowed to let other
users read their contents. `bindfs` wants to give other users access
and is therefore normally run with `--no-allow-other` to not throw an
error.

Giving other users, mainly `root`, access to the bind mounts is,
however, useful and works fine when

programs.fuse.userAllowOther = true;

is declared in `configuration.nix`. This adds an option to choose
whether to give other users access or not. It also prompts the user to
set the `allowOther` attribute with a link to the documentation.
2021-01-27 12:35:27 +01:00
talyz
48f3a3018e
home-manager: Fix the fix
`let` variables have priority over `with` imports, argh
2021-01-27 12:34:21 +01:00
talyz
a1dfdfa1aa
home-manager: Fix bindfs options
No flag should be passed when the option list is empty.
2021-01-26 22:31:17 +01:00
talyz
77302d9381
home-manager: Document options, update readme 2021-01-25 00:15:36 +01:00
talyz
43095936d4
home-manager: Use the fsname option of the latest bindfs release
This makes changing bindfs target directories more reliable when their
paths contain spaces or commas. See
https://github.com/mpartel/bindfs/issues/94 for details.
2021-01-24 23:26:22 +01:00
talyz
e6d15a7cbb
home-manager: Don't remount when bindfs is found instead of target
Due to what is likely a bug in bindfs or fuse, the target path is
sometimes missing from the mount entry. This causes false positives
for the target directory having changed, leading to unnecessary
remounts. Luckily, it seems that when this happens, the line instead
contains the string `bindfs`, which it doesn't normally, so we can at
least circumvent this issue to some degree.
2021-01-24 11:57:21 +01:00
talyz
47147e71ff
home-manager: Fix unmounts in the activation script for recent HM
Find the correct name of the activation script entry responsible for
reloading systemd user services. The name was initially
`reloadSystemD` but has been changed to `reloadSystemd`, causing
failures due to the unmounts being done after the systemd services are
reloaded.
2021-01-24 11:56:48 +01:00
talyz
4b3000b9be
home-manager: Remove unnecessary PartOf in systemd unit
Fixes #20
2020-10-17 23:45:30 +02:00
talyz
ecb89af129
home-manager: Abbreviate commands using nix- and env variables 2020-10-03 09:40:36 +02:00
talyz
b6181bd997
home-manager: Make quoting and grepping more robust
Try to more properly escape paths using `escapeShellArg` and use
`grep -F` to avoid accidental regexes.
2020-10-03 09:39:34 +02:00
talyz
4d2cfadbc1
home-manager: Make unmounts more robust
Try to unmount normally a few times, and if that fails, unmount lazily
to at least clean up the mount point before the fuse process is killed.
2020-07-24 13:41:21 +02:00
talyz
5b3345400c
home-manager: Bind mount directories instead of symlinking them
Use bindfs to create bind mounts for directories instead of symlinking
them. This should be less problematic for many applications, since
bind mounts are much more transparent.

This sets up the bind mounts in the activation script, before any
writes are done by home-manager, then tears them down again
afterwards. The bind mounts are then handled by individual systemd
services, since they're long-running fuse processes and need to be
managed as such. This also means we leverage home-manager's mechanism
for deciding which user services should be active after a switch to a
new generation, and don't have to bother with cleaning up old leftover
fuse processes.

NOTE: All unmounts done in the activation script are put into a
function which is run either on error, or right before home-manager
starts / reloads systemd units. This will conflict with other attempts
to add traps on ERR, but this isn't currently done upstream.
2020-07-24 13:00:13 +02:00
talyz
def13ddc2e
home-manager: Fix types - string -> str, since string is deprecated 2020-06-07 10:14:06 +02:00
talyz
2472286e92
nixos, home-manager: Handle whitespace in persistentStoragePaths 2020-06-07 10:14:00 +02:00
talyz
27a984a236
Format with nixpkgs-fmt 2020-06-05 19:37:07 +02:00
talyz
b8868e1d83
Add initial home-manager module 2020-06-05 19:36:37 +02:00