Re: [Nix-dev] How to incorporate my Bash script in configuration.nix
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 <m...@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 ___ nix-dev mailing list nix-dev@lists.science.uu.nl https://mailman.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] How to incorporate my Bash script in configuration.nix
Hi everyone, I have made my USB WiFi to work, but I have to call this script whenever I restart the computer. #!/usr/bin/env bash echo "0b05 17e8"|sudo tee /sys/bus/usb/drivers/rt2800usb/new_id What is correct way to make this part of configuration.nix? Cheers, -- Strahinja Popovic ___ nix-dev mailing list nix-dev@lists.science.uu.nl https://mailman.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [NixOS] How to incorporate my Bash script in configuration.nix?
Thanks Peter, it did the trick :) On Wed, May 10, 2017 at 1:18 AM, Peter Hoeg <pe...@hoeg.com> wrote: > Hi, > > > The proper way to do this is to set up modaliases >> >> Could you please elaborate further? >> > > the alias in the line below depends on the exact PID and VID of your > device so you may need to adjust it: > > boot.kernelModules = [ "rt2800usb" ]; > boot.extraModprobeConfig = '' >alias usb:v0B05p17E8d*dc*dsc*dp*ic*isc*ip*in* rt2800usb >install rt2800usb ${pkgs.kmod}/sbin/modprobe --ignore-install rt2800usb > && echo 0x0B05 0x17E8 >/sys/bus/usb/drivers/rt2800usb/new_id > ''; > > This is from: https://github.com/jethrokuan/nix-config/blob/master/desktop > /configuration.nix > > -- > Regards, > Peter > -- Strahinja Popovic ___ nix-dev mailing list nix-dev@lists.science.uu.nl https://mailman.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [NixOS] How to incorporate my Bash script in configuration.nix?
> The proper way to do this is to set up modaliases Could you please elaborate further? On Tue, May 9, 2017 at 3:14 PM, Peter Hoeg <pe...@hoeg.com> wrote: > Hi, > > I would have gone to systemd.services. Slightly uglier looking (bigger >> attrset), but should run after the kernel has loaded its modules. I'd >> say it would be ideal to have it be "PartOf = networking.target" >> and/or "Before = dhcpd.service" (or whatever networking thingy you >> use). >> > > Actually, that will not do the trick either if the device isn't plugged > in yet. > > The proper way to do this is to set up modaliases > > /Peter > > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > https://mailman.science.uu.nl/mailman/listinfo/nix-dev > -- Strahinja Popovic ___ nix-dev mailing list nix-dev@lists.science.uu.nl https://mailman.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [NixOS] How to incorporate my Bash script in configuration.nix?
Thanks for help Peter, But I have in dmesg now: [2.027361] stage-2-init: /nix/store/zv42ylc0jangv5kv437577qq79v3xq5n-nixos-system-strale-17.03.1033.99dfb6dce3/activate: line 136: /sys/bus/usb/drivers/rt2800usb/new_id: No such file or directory How to make it to wait for kernel module? On Tue, May 9, 2017 at 9:44 AM, Peter Hoeg <pe...@hoeg.com> wrote: > Hi, > > I have made my USB WiFi to work, >> but I have to call this script whenever I restart the computer. >> > > you can do it this way: > > system.activationScripts = { > rt2800usb = { >text = '' > echo "0b05 17e8" > /sys/bus/usb/drivers/rt2800usb/new_id >''; > deps = []; > }; > }; > > -- > Regards, > Peter > -- Strahinja Popovic ___ nix-dev mailing list nix-dev@lists.science.uu.nl https://mailman.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] [NixOS] How to incorporate my Bash script in configuration.nix?
Hi everyone, I have made my USB WiFi to work, but I have to call this script whenever I restart the computer. #!/usr/bin/env bash echo "0b05 17e8"|sudo tee /sys/bus/usb/drivers/rt2800usb/new_id What is correct way to make this part of configuration.nix? Cheers, -- Strahinja Popovic ___ nix-dev mailing list nix-dev@lists.science.uu.nl https://mailman.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Wx and Erlang
Thank you, it works like a charm! On Thu, May 1, 2014 at 10:29 AM, Cillian de Róiste cillian.deroi...@gmail.com wrote: Hi, You can put the following in your configuration.nix: nixpkgs.config.packageOverrides = pkgs: { erlang_wx = erlang.override { wxSupport = true; }; }; I notice that `man configuration.nix` mentions packageOverrides is described in the nixpkgs documentation, but I don't see it there. Here's an example of something similar from the wiki: https://nixos.org/wiki/How_to_enable_subpixel_rendering_in_freetype Cheers, Cillian On Thu, May 1, 2014 at 4:57 AM, Strahinja Popovic stra...@gmail.com wrote: Hi, Graphical debugger for erlang is not working for me, giving following message: ERROR: Could not find 'wxe_driver.so' in: /nix/store/qwrw86k079q2klczqcfb38abgib19hfx-erlang-15B03/lib/erlang/lib/wx-0.99.2/priv In SVN revision 34372, cillian has added wxSupport to erlang, and I believe that this mostly would solve my problem. I have tried to enable this with 'nix-env --set-flag wxSupport true erlang', but this was a long-shot, and it didn't work. How should I set this? Best, Strahinja ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] reboot hangs most of the time
I had the same problem, while I have been using SLiM. I am currently using KDM, and it works OK. You might have some other process that is not working properly with systemd. https://wiki.archlinux.org/index.php/Display_manager#Incompatibility_with_systemd On Mon, Apr 7, 2014 at 1:36 PM, Roelof Wobben r.wob...@home.nl wrote: Hello, When I want to reboot my box I enter 'reboot' in the prompt. And most of the time I see unmounting /nix/store and nothings happens after that. I need to use the reboot button on my machine to make things working again. Roelof ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Compiling Thunar from git
I have tried all that, it is still not working. Like it is not looking at all inside dbus_libs package. I have attached thunar.nix and make output. On Mon, Mar 17, 2014 at 9:28 AM, emil.rang...@chas.se wrote: On 2014-03-16 20:26, Strahinja Popovic wrote: Now my problem is when compiling, it terminates with following: /nix/store/55cajnd5wbli8vapmwx6ywi3yafld28b-dbus-glib-0.100.2/include/dbus-1.0/dbus/dbus-glib.h:28:30: fatal error: dbus/dbus-shared.h: No such file or directory Any ideas? How could I see in which package is dbus-shared.h? find /nix/store -name dbus-shared.h on my machine implied that dbus_libs is the package you are looking for. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev thunar.nix Description: Binary data output Description: Binary data ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Compiling Thunar from git
OMG, this thunar expression... that's a completely wrong approach. You can do it easiest by copying our expression for thunar and doing minor changes. You may need to read the basics of nix, e.g. from nix manual to manage it, I suppose. BTW, is there some significant problem with our Thunar that makes you try git? I actually started with copying Thunar from nixpkgs, and https://nixos.org/wiki/Howto_develop_software_on_nixos#Example_1:_Using_nix-shell_to_Initialize_a_Development_Shell I have made a small change in Thunar source and I wanted to test it, and it seems appropriate to do it with git HEAD. Sergey, I have used your .nix file, and it is still breaking make when in nix-shell. However, when using nix-build, it is working until the point when Thunar.1 should be generated. I have added docbook_xsl to buildInputs, but it seems that it is not in xml catalog. xsltproc -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xslThunar.xml I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl Why is it working for nix-build and not for nix-shell, and how to manage xml catalog inside build envirioment? On Mon, Mar 17, 2014 at 2:01 PM, Sergey Mironov grr...@gmail.com wrote: 2014-03-17 16:25 GMT+04:00 Vladimír Čunát vcu...@gmail.com: Hi. On 03/17/2014 12:55 PM, Strahinja Popovic wrote: I have tried all that, it is still not working. Like it is not looking at all inside dbus_libs package. I have attached thunar.nix and make output. OMG, this thunar expression... that's a completely wrong approach. You can do it easiest by copying our expression for thunar and doing minor changes. You may need to read the basics of nix, e.g. from nix manual to manage it, I suppose. BTW, is there some significant problem with our Thunar that makes you try git? IMHO the approach is nice in general. I am thinking about automatic generation of expressions having src set to ./. when I need to build something from local source. But yes, the initial thunar.nix is broken. I've tried to fix it, see the new expression below. It still can't build the thunar, but probably it is because of an upstream error. Regards, Sergey # thunar.nix let pkgs = import nixpkgs {}; inherit (pkgs) xfce; inherit (xfce) thunar; stdenv = pkgs.stdenv; in rec { thunarEnv = stdenv.mkDerivation rec { name = thunar-env; version = 1.1.1.1; src = ./.; buildInputs = with pkgs; [ pkgconfig intltool gtk dbus_glib libstartup_notification libnotify libexif pcre udev xfce.exo xfce.libxfce4util xfce.xfconf xfce.xfce4panel xfce.xfce4_dev_tools git gtk_doc ]; preConfigure = '' ./autogen.sh ''; }; preFixup = rm $out/share/icons/hicolor/icon-theme.cache; } ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev