[Nix-dev] How to incorporate my Bash script in configuration.nix

Strahinja Popovic stralep at gmail.com
Fri May 12 18:31:51 CEST 2017


Thank you for reply, but this is a duplicate of "[NixOS] How to incorporate
my Bash script in configuration.nix?" atd it is already solved.

My bad

On Fri, May 12, 2017 at 3:51 PM, Profpatsch <mail at profpatsch.de> wrote:

> On 17-05-12 05:02pm, Profpatsch wrote:
> > systemd.service.myUsbService =
> >   let startupScript = ''
> >     #!${pkgs.bash}
> >     echo "0b05 17e8" | tee /sys/bus/usb/drivers/rt2800usb/new_id
> >   '';
> >   in {
> >     description = "get my US WiFi to work";
> >     wantedBy = [ "default.target" ];
> >     serviceConfig = {
> >       ExecStart = startupScript;
> >     };
> >   };
>
> aszlig just told me that this can be done shorter:
>
> systemd.service.myUsbService = {
>   description = "get my US WiFi to work";
>   bindsTo = [ "sys-subsystem-net-devices-XXX.device" ];
>   script = "echo 0b05 17e8 | tee /sys/bus/usb/drivers/rt2800usb/new_id";
> }
>
> see `man systemd.device`.
>
> --
> Proudly written in Mutt with Vim on NixOS.
> Q: Why is this email five sentences or less?
> A: http://five.sentenc.es
> May take up to five days to read your message. If it’s urgent, call me.
>



-- 
Strahinja Popovic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170512/b337c9ce/attachment.html>


More information about the nix-dev mailing list