Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usbip: fix default snippetIpAddress command #522

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modules/usbip.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in

snippetIpAddress = lib.mkOption {
type = lib.types.str;
default = "$(ip route list | sed -nE 's/(default)? via (.*) dev eth0 proto kernel/\2/p')";
default = "$(ip route list | sed -nE 's/(default)? via (.*) dev eth0 .*/\\2/p' | head -n1)";
example = "127.0.0.1";
description = ''
This snippet is used to obtain the address of the Windows host where Usbipd is running.
Expand All @@ -38,9 +38,14 @@ in
services.udev.enable = true;

systemd = {
targets.usbip = {
description = "USBIP";
};

services."usbip-auto-attach@" = {
description = "Auto attach device having busid %i with usbip";
after = [ "network.target" ];
partOf = [ "usbip.target" ];

scriptArgs = "%i";
path = with pkgs; [
Expand Down
Loading