mirror of
https://github.com/gburd/nix-config.git
synced 2024-11-14 16:36:24 +00:00
22 lines
685 B
Nix
22 lines
685 B
Nix
{ pkgs, ... }:
|
|
{
|
|
boot.kernelModules = [ "nbd" ];
|
|
|
|
environment.systemPackages = with pkgs; [ nbd ];
|
|
|
|
systemd.services.t510-dvd-nbd-mount = {
|
|
description = "Automatic network mounting via NBD of T510 DVD drive";
|
|
|
|
# make sure tailscale is running before trying to connect to tailscale
|
|
after = [ "network-pre.target" "tailscale.service" ];
|
|
wants = [ "network-pre.target" "tailscale.service" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = "${pkgs.nbd}/bin/nbd-client -N dvd-drive t510 10809 /dev/nbd0";
|
|
ExecStop = "${pkgs.nbd}/bin/nbd-client -d /dev/sr0";
|
|
RemainAfterExit = "yes";
|
|
};
|
|
};
|
|
}
|