2018-06-15

<clever> which you can just chmod normally
<clever> Myrl-saki: after you mount, it will use the permissions of the root directory of whatever you mounted
<clever> without $NIX_PATH, nix cant find <nixpkgs>
<clever> kreetx: sudo is configured to sanitize things
<clever> kreetx: thats $NIX_PATH being cleared
<clever> kreetx: yes
<clever> kreetx: or in the trusted users of the local nix.conf
<clever> kreetx: i think you need to be root for --builders to work

2018-06-13

<clever> roni: check the shell.nix in that repo then, i'm able to `npm install` with that shell
<clever> roni: that whole file is the example
<clever> roni: this builds the entire nodejs project (including sass) in nix-build
<clever> it tries to import the path
<clever> mbrock: when you give it a deriation, it does the same thing as when you give it a path
<clever> mbrock: yeah
<clever> mbrock: you are creating a $out/foo but callPackage wants a $out/default.nix

2018-06-12

<clever> wrap it with a new function that will fetch, then // { inherit url; } ?
<clever> oh, builtins, not pkgs
<clever> LnL: .url ?
<clever> grp: i tend to use tab-completion inside `nix repl '<nixpkgs>'`
<clever> wchresta: and if you add --show-trace ?
<clever> we got matrixed again
<clever> grp: its possible you had to fix /etc/resolv.conf
<clever> lo_mlatu_: pythonPackages = pkgs.pythonPackages.packageOverrides { packageOverrides = self: super: { humanize = super.humanize.overrideAttrs { ... };
<clever> lo_mlatu_: *looks*
<clever> then just cp files to $out/bin and '';
<clever> mkdir -p $out/bin
<clever> kiloreux: foo = runCommand "name" {} ''
<clever> asymmetric: yeah
<clever> asymmetric: thats where nix run is better
<clever> asymmetric: depends on if you want to just run something or if you want to build something
<clever> kiloreux: use something like runCommand to create a custom derivation with just the files you want
<clever> kiloreux: now try the nix-env -i again
<clever> asymmetric: nix run just puts things in PATH and nothing else
<clever> asymmetric: nix-shell will download gcc and source setup scripts and do a lot of build-time prep stuff
<clever> kiloreux: if you run nix-env -q, does it list ffmpeg?
<clever> lo_mlatu_: and the // wont override python packages properly
<clever> lo_mlatu_: .override doesnt work for meta, you want .overrideAttrs
<clever> kiloreux: you need to uninstall the old ffmpeg's in nix-env
<clever> kiloreux: nix-env -f stuff.nix -iA ffmpeg
<clever> lo_mlatu_: then youll need to create the proper override against python packages
<clever> kiloreux: for example?
<clever> lo_mlatu_: there is a config.nix flag that just ignores platforms entirely, the error should say what it is
<clever> kiloreux: unpackPhase = ":"; or use runCommand
<clever> kiloreux: what flags are you trying to remove?
<clever> kiloreux: NIX_CFLAGS_COMPILE i believe
<clever> lvm on luks is easy, so the gpg part is the only tricky area
<clever> now try that on your own nix file, and try changing things to see if you can slip something in without it appearing in the .drv
<clever> basically, the value of the out field, is based on a hash of everything else in that file
<clever> and also run `nix show-derivation FOO` on that path
<clever> then run cat on the .drv it produced
<clever> Myrl-saki: as an example, do nix-instantiate '<nixpkgs>' -A hello
<clever> but the output will rely on the hash of the path as a string, so it changing the compiler out causes a rebuild
<clever> if you do that in a nix expression, and the path exists when its ran, then it will just use it
<clever> so its not impure
<clever> changes to that path will still trigger a rebuild
<clever> it may work, but now your gcc is 4 times more costly to build
<clever> Myrl-saki: those dont have a #!
<clever> Myrl-saki: you could maybe cheat with a setup hook
<clever> the entry point had to be known to the outside
<clever> Myrl-saki: but you would need a bash that is capable of running on any arch, to run the script that picks a compiler
<clever> nlytend: if you are doing EFI, you must set boot.loader.grub.device = "nodev";
<clever> Myrl-saki: pong

2018-06-11

<clever> so if a dependency depends on a flag you defined in the cabal file, nix will do the right thing
<clever> bgamari: angerman's Cabal2nix can translate the conditional statements in a cabal file into nix if statements
<clever> bgamari: there is also Cabal2nix (not to be confused with cabal2nix) https://github.com/angerman/cabal2nix/
<clever> bgamari: investigate why and if it could be patched or a version tweaked
<clever> bgamari: i generally just jailbreak anything that fails due to versions and see what happens
<clever> bgamari: ive found that the datadog package from hackage needs tests disabled, and i never got around to filing a PR to fix it
<clever> illegalprime[m]: you want { packageOverrides = pkgs: { ... }; }
<clever> illegalprime[m]: thats in the nixos module format, not the config.nix format
<clever> imalison: also try just `sudo -i` then `echo $NIX_PATH`
<clever> imalison: so your not seeing roots version of the variable
<clever> imalison: bash evals that before it runs sudo
<clever> imalison: it helps a lot to `sudo -i` and then do everything in that root shell
<clever> imalison: sudo can sometimes be configured to sanitize the env, and that can unset $NIX_PATH
<clever> imalison: what does this command print out? and try to just paste it, rather then re-type it: nix-instantiate --find-file nixpkgs
<clever> ah
<clever> imalison: what exactly are you trying to do?
<clever> imalison: you need to use --set when trying to manage the system profile
<clever> imalison: does that nixpkgs dir its pointing to exist?
<clever> imalison: the - in ~/.nix-defexpr/ is missing
<clever> imalison: what does `echo $NIX_PATH` say?
<clever> catern: its an internal part of how systemPackages is handled, and doesnt really work with nix-env
<clever> same limits there
<clever> yeah, nix-env puts it in ~/.nix-profile/
<clever> inquisitiv3: its not capable of doing systemd like things and enabling services
<clever> inquisitiv3: all nixos does with the systemPackages is put them in /run/current-system/sw/
<clever> and it also saves you from having to list everything twice, once in systemPackages and again in services
<clever> inquisitiv3: some packages can be ran on bootup without installing them, and some need to install specialized versions
<clever> inquisitiv3: yes
<clever> i'm guessing you just installed it, and never ran it
<clever> inquisitiv3: setting that enable thing does 2 things, first it adds spice-vdagent to systemPackages for you (so you can remove your own line for that), and second, it runs it on bootup
<clever> inquisitiv3: things added to systemPackages cant configure nixos level options
<clever> infinisil: maybe a buildenv between the wrapper and original, with the wrapper as a higher prio
<clever> tnks: read the bash script in the wrapped variant
<clever> tnks: its a commom problem with wrappers in nixpkgs, chrome has the same issue
<clever> tnks: thats why i asked about overrides
<clever> tnks: and what does just `which rofi` return?
<clever> tnks: how did you find /nix/store/q4fsdj22yaiacadd4qfm5indkfkgw5gh-rofi-unwrapped-1.5.1/share/man/man1/rofi.1.gz ?
<clever> tnks: then nix-env is not to blame
<clever> tnks: if you run `nix-build '<nixpkgs>' -A rofi` and then `ls -l result/` does it contain a share/man dir?
<clever> tnks: did you apply any overrides with config.nix?
<clever> johanot: any time i'm dealing with something that wants yaml, i just use builtins.toJSON in nix
<clever> johanot: of note, yaml is a superset of json, so all yaml parsers can accept json
<clever> ixxie: i dont think one exists yet
<clever> YegorTimoshenko[: yeah, it was just a bit weird to be given an exe file when i askd for a linux binary
<clever> ixxie: ive also found .net stuff to be weird, ive seen a project linking a .exe file as the linux build!, and it just works when you run mono on it under nixpkgs!
<clever> ixxie: this will cross-compile a 64bit windows binary for the hello package
<clever> ixxie: (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.mingwW64; }).hello
<clever> morenoh149: `sudo -i`, then `nix-channel --update` and `nix-env -iA nixpkgs.nix`
<clever> morenoh149: single-user or multi-user install? (is nix-daemon running)
<clever> sgraf: setting version wont have the effect your thinking, you need to set everything that originally refered to version
<clever> sgraf: this is why it doesnt work to update version
<clever> > (rec { a = "foo"; b = "b-${a}"; } // { a = "bar"; }).b
<clever> > rec { a = "foo"; b = "b-${a}"; } // { a = "bar"; }
<clever> sgraf: rec is to blame, you have to override name and src, not version
<clever> sgraf: you used the wrong override function i believe
<clever> eisbaer: mkOrder, one min
<clever> !tofu
<clever> logiq: but if you use a different name, it can run into issues
<clever> logiq: id usually stick to `nix-env -iA nixpkgs.foo`
<clever> logiq: and the channel is called nixos when on nixos, so you instead need `nix-env -iA nixos.foo`
<clever> logiq: <nixpkgs> and `nix-env -iA nixpkgs.` can wind up pointing to different things
<clever> logiq: nix-env follows different rules, and will search for nixpkgs in ~/.nix-defexpr/, which will point to a channel called nixpkgs when added with nix-channel
<clever> logiq: `-f <nixpkgs>` will search for nixpkgs in $NIX_PATH, while `-f .` just opens the default.nix in the current dir
<clever> Mic92: let me just upstream the fix and then file a PR with that diff
<clever> mafo: i would just re-launch the shell after it fails, and then try make in the dir it made
<clever> e*
<clever> mafo: i think genericBuild may change the s state again
<clever> mafo: what commands have you ran?
<clever> mafo: backtraces, in a shell script??
<clever> Mic92: (facepalm), i think my pr that was just merged only fixes it on 32bit...
<clever> Mic92: what do you think about backporting my openat PR to 18.03 and/or 17.09?, they may have the same issue because the previous PR was also backported
<clever> mupf: i think its `set +e`
<clever> the nixos hydra doesnt pre-build much with cross-compiling, but it does do some native aarch64 builds
<clever> it will use the build slaves that have the same arch as the hydra machine
<clever> manveru: just put the above expression into a release.nix file
<clever> thats what the --arg is doing
<clever> (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.aarch64-multiplatform; }).hello
<clever> manveru: this builds the hello-world app for aarch64
<clever> manveru: nix-build '<nixpkgs>' --arg crossSystem '(import <nixpkgs/lib>).systems.examples.aarch64-multiplatform' -A hello
<clever> manveru: yes
<clever> mupf: and how did you write the image to the usb stick?

2018-06-10

<clever> nschoe: check the man page for ntfs3g and see what options it supports when mounting
<clever> nschoe: thats normal when using fuse
<clever> phry: nix does not allow cycles in the dep graph
<clever> nschoe: most kernel related stuff is in boot
<clever> nschoe: boot.supportedFilesystems = [ "ntfs" ]; and then nixos-rebuild
<clever> nschoe: what does `blkid /dev/sdb1` say?
<clever> nschoe: sudo mount
<clever> but libredirect does, lol
<clever> surprisingly, the kernel doesnt throw a fit when you do that
<clever> phry: the only time ive ever seen it fail, was when i discovered a nasty program that passed null pointers to things like stat()!
<clever> phry: yeah, that should work for any executable you want to redirect
<clever> and you cant use a tool like libredirect to change the file its reading at runtime?
<clever> ah
<clever> phry: and why are you trying to patch it?
<clever> phry: what exactly are you trying to patch?
<clever> phry: if the strings are of the same length, sed
<clever> and NIX_PATH=foo=/bar will map <foo> to /bar
<clever> so <foo> with NIX_PATH=/bar will check for /bar/foo
<clever> phry: for entries lacking a prefix=, nix will search for foo inside that dir
<clever> phry: its the `/nix/var/nix/profiles/per-user/root/channels` element in NIX_PATH
<clever> so i may break the locales locally, lol
<clever> i'm in the middle of an upgrade right now, just battleing low disk space
<clever> phry: the <foo> stuff just searches $NIX_PATH for foo
<clever> phry: imports = [ /home/clever/apps/nixpkgs/nixos/modules.... ];
<clever> phry: since it will be mixing the main nixpkgs with the unstable module
<clever> phry: you will also need an overlay to change the version of the package itself
<clever> in my exact case, i was fixing a bug with ntp, so i had to edit it and rebuild a lot
<clever> phry: and then just add a channel called unstable
<clever> you could also likely do imports = [ <unstable/nixos/modules/services/networking/ntpd.nix> ];
<clever> and i can then freely edit it
<clever> which re-defines all of the options
<clever> phry: this leaves me free to do imports = [ ./ntpd.nix ]; and point to a copy of the file
<clever> phry: with this set in my configuration.nix, the ntpd.nix from my channel effectively vanishes and all ntpd options are gone
<clever> disabledModules = [ "services/networking/ntpd.nix" ];
<clever> phry: one min
<clever> yep
<clever> if that was missing, you would be forcibly disconnected every time the config changes
<clever> Lorne1: so you have to manualy restart them with `systemctl restart` to apply any changes
<clever> Lorne1: the services are specially flagged to NOT restart when you `nixos-rebuild` or `nixops deploy`
<clever> Lorne1: yep, thats it exactly
<clever> Lorne1: ah, that gives me a thought
<clever> Lorne1: those may be of use
<clever> Lorne1: cant think of anything else
<clever> Lorne1: not really, but it has higher priority and could have broken things
<clever> Lorne1: does your user have a startwm.sh file in $HOME?
<clever> Lorne1: try running the one from startwm when your just at an xterm
<clever> Lorne1: then read the startwm.sh script inside that
<clever> Lorne1: read /etc/systemd/system/xrdp-sesman.service and find the directory called xrdp.conf
<clever> Lorne1: line 12-16, it creates a bash script called startwm that sources /etc/profile, then runs whatever you set as the defaultWindowManager
<clever> Lorne1: youll need to investigate how its starting by reading /etc/systemd/system/xrdp.service
<clever> Lorne1: i'm guessing xrdp may also have its own integrated window manager, and it may also not obey the normal services.xserver options
<clever> Lorne1: maybe -u xrdp
<clever> Lorne1: oh, then it wont be under the normal name
<clever> oh, and also `-u display-manager` to limit it further
<clever> the display manager should be near the top
<clever> Lorne1: you can also add `-b 0` to the command to limit it to the current boot
<clever> Lorne1: the journal should say what it is
<clever> Lorne1: slim doesnt have any mouse interaction at all
<clever> Lorne1: from slim, you can hit f1 to cycle thru the desktop managers and window managers
<clever> ah, i cant find that wrapper anymore, it may not be needed
<clever> thekolb: but you may need to use the special wrapper in nixos
<clever> kmod.out 0 s /nix/store/jyfq8333jy09vh743jmzsqwvv12kdxxi-kmod-24/bin/modprobe
<clever> logzet: --since and --until
<clever> or select the right one at the login screen
<clever> also of note, there is a xterm window-manager that sometimes winds up as default, you may need to services.xserver.desktopManager.xterm.enable = false;
<clever> logzet: the journal should contain the logs
<clever> hoshineko: should be safe to ignore
<clever> inquisitiv3: a lot of the dynamic options in nixos work like that
<clever> inquisitiv3: if you set boot.initrd.luks.devices.foo = { ... }; then the name will default to "foo"
<clever> inquisitiv3: my laptop happens to use the list form instead of the attrset form, but they are pretty much identical
<clever> 6 { name = "root"; device = "/dev/nvme0n1p2"; preLVM = true; }
<clever> 5 boot.initrd.luks.devices = [
<clever> inquisitiv3: i think so
<clever> uuid's dont go in the repo, because they would cause conflicts if i ever dup the machine
<clever> everything else is in a git repo and shared
<clever> tilpner: same, i just put everything into configuration.nix which is only the hardware related stuff
<clever> gchristensen: that should probably be added
<clever> tilpner: you can check the generated hardware-configuration.nix to confirm if its setup right
<clever> ah
<clever> for the non-boot stuff, you can get away with boot.luks.devices i believe, but its simpler to just put it all in the initrd variant
<clever> inquisitiv3: if anything is required for booting, then it must be in boot.initrd.luks.devices
<clever> so you always have to set that manually
<clever> inquisitiv3: i dont think nixos-generate-config can auto-detect luks
<clever> inquisitiv3: boot.loader.efi.efiSysMountPoint = "/boot/efi";
<clever> gchristensen: it can be split, but you need an extra option
<clever> inquisitiv3: ah, one min
<clever> inquisitiv3: did you create an efi system partition and mount it to /mnt/boot/ ?
<clever> File system "/boot" is not a FAT EFI System Partition (ESP) file system.
<clever> ldd will obey the current rpath and tell you what is still missing
<clever> you just have to name them, rather then dig them out of /nix/store/
<clever> a proper derivation will automate finding everything for you
<clever> ldd will tell you whats missing
<clever> mupf: its also recomended to write a derivation so nix can patch it automatically
<clever> nix-shell -p gcc patchelf
<clever> mupf: you need to be inside nix-shell
<clever> mupf: yes
<clever> mupf: and also fix the rpath
<clever> mupf: its in the nixpkgs manual
<clever> mupf: you need to patchelf it
<clever> superepic: try editing that file to say `nameserver 8.8.8.8`
<clever> superepic: then your dns is down, what does /etc/resolv.conf say?
<clever> what is the actual problem?
<clever> nixos.org is also fine
<clever> superepic: try google.com instead
<clever> superepic: the firewall blocks pings
<clever> superepic: use the network troubleshooting tool in windows
<clever> superepic: what does `ip route` show on the VM host?
<clever> superepic: can the VM host ping 54.217.220.47?
<clever> superepic: do you have an ethernet cable plugged in?
<clever> what is the default route in it?
<clever> superepic: what does `ip route` print?
<clever> superepic: how are you connecting to the internet?
<clever> superepic: E_NEED_MORE_INFO
<clever> and nix's packages are also functional, so now you can do functional programming while you functionally program!
<clever> hoshineko: you can also do `import (builtins.fetchTarball "https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable.tar.gz") {}` to refer to the latest nixos-unstable, or insert a git rev to lock it in
<clever> hoshineko: if you add a second channel and name it unstable, then you can just `import <unstable> {}` in your config to refer to it

2018-06-09

<clever> ixxie: it would be fairly simple to make a command that just takes the ip of a machine running linux and sshd, and hijacks it
<clever> ixxie: the only network install that can easily be done imperatively, is the kexec one
<clever> yeah
<clever> ixxie: and the net stuff runs a dhcp server, so you have to heavily reconfigure or rewire your lan to make it play nicely with other hardware
<clever> ixxie: possibly, but the net stuff really needs to go into configuration.nix
<clever> __monty__: and related, this puts the same ramdisk image into /boot with a grub option to select it
<clever> __monty__: in that example, its a 40gig swap, 512mb /boot, and it uses luks
<clever> __monty__: lines 22-25 of netboot_server configure what params justdoit uses when installing
<clever> __monty__: so you literally login as root, type justdoit, and it does it :P
<clever> __monty__: that module also includes justdoit in the ramdisk
<clever> __monty__: yep
<clever> ixxie: ah
<clever> __monty__: the above nixos module creates a network boot server, any LAN machine that tries to netboot loads up nixos in a ramdisk
<clever> ixxie: ah
<clever> __monty__: one min
<clever> ixxie: and nixos-in-place, and kexec+justdoit
<clever> ixxie: turning any linux machine with nix into nixos?
<clever> matrix

2018-06-08

<clever> thekolb: which is done via nix.extraOptions
<clever> thekolb: it has to go in nix.conf
<clever> thekolb: you need to set allow-new-privileges = true in your nix config
<clever> ah, no, thats different
<clever> i cant think of anything else that would have changed to break it
<clever> thekolb: run `type sudo`, note that sudo is in a different directory now
<clever> thekolb: and why do you need sudo?
<clever> thekolb: what was the hack?
<clever> thekolb: sudo should never work inside a nix build
<clever> boot from the liveusb again, mount the fs's up again, comment that out, and then nixos-install again
<clever> you probably didnt set it correctly, and its breaking roots shell