Closed ghost closed 4 years ago
It's not documented, yet, but the file
source type supports rsync filter files using rsync's -F
option. With this, it's possible create the file ./foo/.rsync-filter
with following contents to copy only ./foo/bar
(recursively) to the target:
+ /bar
- /*
See FILTER RULES
in rsync's man page for details about the file format.
@petabyteboy I don't have a problem with the pull-request, but I don't see why you actually have that problem, what stops you from doing "asset-wallpapers".file = ...
this way you can reference it in you scripts as <asset-wallpapers/awesome-wallpaper.jpg>
?
@petabyteboy I don't have a problem with the pull-request , but I don't see why you actually have that problem, what stops you from doing
"asset-wallpapers".file = ...
this w ay you can reference it in you scripts as<asset-wallpaper s/awesome-wallpaper.jpg>
?
I could do that, but in that case I would have to create each of those directories I want to copy only to some servers in the root directory of my workspace, so it would have to look a bit like this:
nixfiles/sources-nixpkgs-mozilla/
nixfiles/sources-nixpkgs/
nixfiles/sources-home-manager/
nixfiles/sources-jblock/
nixfiles/sources-nixos-mailserver/
nixfiles/sources-yel-o.de/
nixfiles/sources-website/
nixfiles/configuration-desktop/
nixfiles/configuration-dns/
nixfiles/configuration-common/
nixfiles/configuration-docker/
nixfiles/configuration-mdns/
nixfiles/configuration-bgp/
nixfiles/configuration-hosts-salat/
nixfiles/configuration-hosts-onyx/
nixfiles/configuration-hosts-schinken/
nixfiles/configuration-hosts-amalthea/
nixfiles/configuration-hosts-combahton/
nixfiles/configuration-hosts-vultr/
nixfiles/configuration-hosts-hifipi/
nixfiles/configuration-hosts-unifipi/
nixfiles/configuration-hosts-amber/
nixfiles/configuration-hosts-regolith/
nixfiles/configuration-hosts-mozarella/
nixfiles/configuration-hosts-tomate/
Or at least it would have to look like that in /var/src, but I want to have the same layout in /var/src so I can for example use nixos-rebuild build-vm -I nixfiles/ -I nixos-config=nixfiles/configuration-hosts-tomate/configuration.nix
, which would not be possible when the workspace layout differs from the directory layout in /var/src.
It's not documented, yet, but the
file
source type supports rsync filter files using rsync's-F
option. With this, it's possible create the file./foo/.rsync-filter
with following contents to copy only./foo/bar
(recursively) to the target:+ /bar - /*
See
FILTER RULES
in rsync's man page for details about the file format.
These filter files are the same for every host. Allowing more complex filter (include/exclude) flags of the rsync command from the source definition would be an alternative solution for my problem. Right now I can only set the exclude flag, which does not allow me to copy a list of directories.
Allowing more complex filter (include/exclude) flags of the rsync command
That sounds good to me.
Replaced by https://github.com/krebs/krops/pull/15.
I need this to be able to selectively deploy some subdirectories to the target. This way I can do something like this:
The broader goal is to prevent my wallpaper files from being copied to my servers, while keeping my workspace directory structure in sync with the remote (./foo/bar will always end up in /var/src/foo/bar). I'm open for alternative suggestions, this is what I currently have: