2019-08-31

<clever> this is the simplest way: systemd.packages = [ (pkgs.callPackage ./your-package.nix {}) ];
<clever> visrelic: you need to somehow get the nix expr for building that storepath, into systemd.packages
<clever> visrelic: nix-env cant do systemd level things
<clever> visrelic: service stuff must go into a nixos module, not the package default.nix
<clever> visrelic: usually best to have nixos generate the systemd unit via systemd.services
<clever> visrelic: yes
<clever> ajs124: if you do clone the nix directory, its best to not make any other changes to it until you reboot
<clever> you could also ask a non-nix user that is nearby to just select a different option at grub, if others are stationed near the machine
<clever> but without ipmi, that step is difficult
<clever> ajs124: so if you do somehow tell grub to boot that image, it will be on the vpn
<clever> ajs124: the rescue-boot has a benefit over a normal iso, in that you can configure the vpn on that config
<clever> ajs124: i did basically the same thing with my laptop a few years ago, and thats when i made rescue-boot.nix
<clever> ajs124: ah, that makes things more tricky, and if you make any mistakes, its bricked
<clever> ajs124: you may be able to, but i find it simpler to do it offline
<clever> ajs124: you can then boot from the rescue env, move /nix to where it should be (an offline move) and then boot back to the new generation `nixos-rebuild boot` had made
<clever> ajs124: add that to your imports list, nixos-rebuild switch, then "fix" the configuration.nix to match where /nix will be, and nixos-rebuild boot
<clever> freeman42x[NixOS: host is required for hosting, guest is required for guests

2019-08-30

<clever> Miyu-chan: i think its a limitation of systemd containers
<clever> Twey: `strace -e openat,open nix show-config`
<clever> Twey: is there another nix.conf in the users home?
<clever> Twey: `nix show-config | grep sandbox` ?
<clever> Twey: and the user is not a member of nixbld?
<clever> Twey: what user owns /nix/store/?
<clever> Twey: is that in /etc/nix/nix.conf ?
<clever> nothing stops you from doing that
<clever> allan: gui programs can be ran from a terminal
<clever> allan: what if you ran your whole editor inside nix-shell?
<clever> __monty__: yeah, simple-test.nix also automates booting it in qemu
<clever> allan: if the inputs to the nix expr havent changed, you dont have to re-run ninja
<clever> allan: you must run ninja under nix-shell also, and ninja does work inder nix
<clever> __monty__: you might also be able to use the test stuff already in nixos/tests on nixpkgs
<clever> __monty__: https://github.com/NixOS/nixpkgs/issues/67707 this has directions on how to use my `simple-test.nix` to automate installing nixos and testing that it can boot
<clever> __monty__: my kexec test stuff
<clever> __monty__: i think this bootloader option generates config files compatible with syslinux, but youll need to install the bootloader yourself
<clever> gcc also wont look in that directory
<clever> probably bugs in those packages
<clever> pkgconfig cant find things you install with nix-env
<clever> nix-env wont install headers
<clever> and installing the build deps wont work often

2019-08-29

<clever> cjpbirkbeck: yeah
<clever> pkgs.python37Packages will bypass the overlay
<clever> cjpbirkbeck: you need to use python-self more, on line 10
<clever> and --delete-generations also supports the +5 syntax, and will be limited to a single profile, rather then all
<clever> the man page has examples of how to delete many
<clever> and this deletes one
<clever> removing generation 473
<clever> [root@amd-nixos:~]# nix-env --delete-generations 473 --profile /nix/var/nix/profiles/system
<clever> this lists generations for nixos
<clever> [root@amd-nixos:~]# nix-env --list-generations --profile /nix/var/nix/profiles/system
<clever> __monty__: nix-env has a --delete-generations and --list-generations sub-command, and --profile can change which profile it acts on
<clever> so some generations are rooted, even if you remove the generation root, and cant be GC'd until you reboot
<clever> gchristensen: another quirk, is that /run/booted-system prevents you from GC'ind whatever you booted, no mater how old it is
<clever> __monty__: you could also use a patch to insert @foo@, then postPatch to run substituteAll over the file, to replace it with ${foo}'s value
<clever> Ralith: i just use wpa_cli in a terminal, though i learned wpa before nm was a thing
<clever> freeman42x[m]2: i think you want to enable network manager
<clever> if the system is stationary, then you dont really need the config util
<clever> freeman42x[m]2: and it should continue to work on bootup, as long as the network name/pw dont change
<clever> freeman42x[m]2: typo on my part, its `systemctl restart wpa_supplicant.service`
<clever> freeman42x[m]2: i just said how
<clever> freeman42x[m]2: run `wpa_passphrase netname password >> /etc/wpa_supplicant.conf` and then `systemctl restart wpa_supplicant.conf`
<clever> freeman42x[m]2: then the firmware is present, you just didnt install anything for the tray
<clever> freeman42x[m]2: ah, maybe its just a firmware issue, any errors in dmesg?
<clever> freeman42x[m]2: `ip link set wlp13s0 up` then scan again?
<clever> freeman42x[m]2: the tray icon is probably just not installed
<clever> freeman42x[m]2: `iwlist wlp13s0 scan` ?
<clever> freeman42x[m]2: then you do have wifi, and just need to configure it
<clever> freeman42x[m]2: what are the device names?
<clever> freeman42x[m]2: ethernet cards usually start with an e, and wifi with a w
<clever> freeman42x[m]2: does `iwconfig` show the wifi card?
<clever> ivan: ah, thats one solution, but makes it harder to not use that cache, since you would have to mkForce in every one of your modules
<clever> craige: so if you set the list to anything, the default goes away
<clever> craige: the issue is that cache.nixos.org is in the default binary cache list
<clever> craige: your welcome :)
<clever> craige: you need to make sure https://cache.nixos.org is in the list
<clever> craige: what is your substituer list in nix.conf?
<clever> but if you can fix things, it can be used as the basis for a dotnet2nix, and fix all dotnet things
<clever> you just need to split fetch and compile in 2
<clever> yeah
<clever> only the fetching of the source
<clever> the output of compiling doesnt need to be deterministic
<clever> you need to convince it that the dependencies are already built, and to look in a given directory
<clever> then add the normal ones to buildInputs, as needed
<clever> ldlework: basically, for every dependency, you want 2 derivations, a fixed-output that downloads the src, and a normal that builds it
<clever> that has src= set to the fixed-output one
<clever> that is not fixed-output
<clever> you must compile it in a second derivation
<clever> it wont compile it
<clever> and that will simply download the source, and thats it
<clever> ldlework: for 99% of the packages in nix, your doing src = fetchurl ...;
<clever> and writing a dotnet2nix would help automate that process
<clever> ldlework: once you can solve that, you wont need -Deterministic
<clever> ldlework: i think the problem is that your still trying to compile in the fixed-output drv
<clever> ldlework: so your only option might be to use that prebuilt nuget, to build nuget from source
<clever> ldlework: it may be a similar problem to gcc and ghc, where you need nuget to build nuget
<clever> ldlework: then you should write one!
<clever> it does this step for you
<clever> iqubic: cabal2nix ./. > default.nix
<clever> iqubic: yes, or use cabal2nix
<clever> iqubic: add megaparsec
<clever> iqubic: do you see how base is on line 1?
<clever> iqubic: you are using haskellPackages.callPackage, so you just need to add megaparsec on line 1, thats it
<clever> iqubic: megaparsec is an attribute of haskellPackages
<clever> infinisil: neat
<clever> in my case, it wasnt a bluescreen, just an error in device manager
<clever> hyperfekt: yeah, that almost perfectly describes my issues
<clever> hyperfekt: several years ago, before i switched to nixos
<clever> hibernation may count
<clever> if linux ever touched the card, or windows had touched it and rebooted, the card was "spent" and needed a full hardware reset
<clever> and i had to specially flag the gpu to be assigned to the xen pciback driver, and for linux to never touch it even once
<clever> hyperfekt: i was doing it with a single gpu, and xen
<clever> 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Bonaire XTX [Radeon R7 260X/360]
<clever> hyperfekt: amd

2019-08-28

<clever> ivan: you need per-slot reset, and it may be specific to the gpu drivers
<clever> ivan: ive found that without the right motherboard, your forced to reboot the host any time windows reboots
<clever> i prefer using grub at all times, even on efi
<clever> freeman42x]NixOS: either use a 2nd hard-drive, or use gparted to shrink the windows partition
<clever> freeman42x]NixOS: mostly, just install nixos as normal, without deleting windows, and then use grub.extraConfig to add a menu option for windows
<clever> freeman42x]NixOS: trivial
<clever> freeman42x]NixOS: the version of wine it gives you
<clever> jlv: that is how nixops generates some of the nixos config
<clever> jlv: you want to look at the nixops source code
<clever> hyperfekt: the + is also using the path type
<clever> hyperfekt: no need for the + and string
<clever> > <nixpkgs/.version>
<clever> freeman42x]NixOS: but windows doesnt make that easy
<clever> freeman42x]NixOS: you would need some pulseaudio style features on the host to force it into working
<clever> when you find the option, you could share it so i can update the iohk qemu stuff too
<clever> which would then reboot, and destroy the clone, and fix the issue
<clever> write failures should probably result in termination
<clever> yeah
<clever> and the guest wont notice a thing (other then the fact that it was hung for an hour)
<clever> and you can resume the vm once the issue is resolved
<clever> gchristensen: at least with virtualbox, it will suspend the vm if writes fail due to out of space
<clever> gchristensen: oh, lol
<clever> at the cost of more latency, you could have obs on windows, capture audio, stream it somewhere, then have obs on nixos play that stream, and re-stream it
<clever> freeman42x]NixOS: the simpler option is to just run obs on windows
<clever> freeman42x]NixOS: yes
<clever> freeman42x]NixOS: then you first need to figure out how to force windows to route its loopback into the virtualbox capture device
<clever> gchristensen: fsck it!
<clever> gchristensen: wtf? :D
<clever> freeman42x]NixOS: but what about the source of the audio, is it also in nixos?
<clever> freeman42x]NixOS: are you trying to capture audio playing from nixos, or windows?
<clever> gchristensen: obs automatically captures from the loopback of a device
<clever> freeman42x]NixOS: which end is obs running on? where is the audio source?
<clever> not many other things we can check
<clever> gchristensen: and if you read it with less, it looks fine?
<clever> gchristensen: what about `file /nix/store/0623dk7hhb392f7c17kxq4kww3lrwm4s-stdenv-darwin/setup` ?
<clever> gchristensen: can that bash actually run?
<clever> ok, so its not the classic linux binary on a mac
<clever> gchristensen: run nix-store --query --binding builder /nix/store/7nz6z7f1j5vigd97qh0qvziwdry7b99x-aws-sdk-cpp-1.7.53.drv
<clever> stites: nope, i dont do much python stuff in nixpkgs
<clever> stites: you want to add python to the arguments, and then use that
<clever> stites: ^^^
<clever> > python3.sitePackages
<clever> vika_nezrimaya: read the .service file, and then run nginx under strace
<clever> vika_nezrimaya: logs?
<clever> vika_nezrimaya: strace the pid?
<clever> vika_nezrimaya: i would just continue to use normal acme
<clever> DariusTheMede: and 31
<clever> DariusTheMede: i would probably also fix lines 15-26, to use another <<EOF
<clever> hmmm, no, it should match 60
<clever> DariusTheMede: also, fix the indent on lines 62-67, to match 61
<clever> DariusTheMede: just put both things in installPhase
<clever> DariusTheMede: as for your gist, if you set installPhase, then postInstall stops working
<clever> DariusTheMede: if you get it into the buildInputs, it should just work
<clever> qubasa: the unknown in your error is fishy, makes me thing something is wrong somewhere
<clever> > pkgs.platform
<clever> qubasa: can you pastebin that file?
<clever> damn thats an old releaaaaaaaaaase note, lol
<clever> nix-build now defaults to using ./default.nix if no Nix expression is specified.
<clever> hmmm, that just makes a passing reference to it, but doesnt explain it
<clever> jonge[m]: if you try to treat a set as a string, it will use the .outPath attr on the set
<clever> > let set = { outPath = "boo"; }; in "${set}"
<clever> > let set = { outPath = "boo"; }l in "${set}"
<clever> > let set = { outPath = "boo"; } in "${set}"
<clever> once its working, you can use the nix as an example of how to properly patchelf in your own expr
<clever> and it will patchelf foo
<clever> lambda-11235: if you run nix-build directly on that file, it will generate a bash script, so you can just ./result ./foo

2019-08-27

<clever> exarkun: grub will detect if its gpt or mbr, and do the right thing
<clever> exarkun: yeah, no other changes
<clever> exarkun: legacy on gpt requires an extra bios boot partition, 1mb, no fs, not mounted
<clever> vika_nezrimaya: i too had to rummage thru the source to figure out why both are used
<clever> vika_nezrimaya: store-uri is used by the c++ to upload build products to the store when the build is done
<clever> vika_nezrimaya: binary_cache_secret_key_file is used by the perl code to serve the cache over http
<clever> its documented in the commit msg that added it
<clever> vika_nezrimaya: the new runcommand stuff in hydra.conf can do that
<clever> so i can now see when upgrading will fail to build things, before i try to upgrade
<clever> vika_nezrimaya: i configured my hydra to build every machine in the house, against the latest nixos-unstable
<clever> vika_nezrimaya: should be perfect then
<clever> vika_nezrimaya: youll want to be sure the fileSystems = and boot= stuff are set right, or the machine may not be able to boot
<clever> you can retry once it is unlocked
<clever> or just give up and fail
<clever> vika_nezrimaya: it will probably just fail to get in over ssh, due to it not listening on 22
<clever> vika_nezrimaya: it will only work after you have unlocked the disk
<clever> ah
<clever> vika_nezrimaya: what does `ssh-add -l` return? what error did it give?
<clever> vika_nezrimaya: so you only need to use the ssh agent temporarily, to get the initial deploy out
<clever> vika_nezrimaya: the none backend will generate its own key, and add it to the authorized_keys of root automatically
<clever> vika_nezrimaya: which backend are you using to deploy?
<clever> vika_nezrimaya: nixops can also use your ssh-agent
<clever> vika_nezrimaya: then youll need to add one
<clever> vika_nezrimaya: nixops uses ssh keys to login
<clever> exarkun: thats why you should generally avoid editing hardware-configuration.nix
<clever> exarkun: correct
<clever> exarkun: make sure to re-run nixos-generate-config so it picks up the lack of a /boot partition
<clever> exarkun: yep, so you should be fine just ignoring the boot partition
<clever> iqubic: the cabal binary is in the cabal-install package
<clever> exarkun: `fdisk -l /dev/sdX` and look for the disklabel type
<clever> exarkun: mbr or gpt tables?
<clever> exarkun: efi or legacy?
<clever> exarkun: should be fine to just have /boot on / then
<clever> iqubic: having special expressions for nix-shell by default
<clever> exarkun: exarkun what fs is the root partition?
<clever> alp: network access to what?
<clever> alp: that would make the derivation impure!
<clever> alp: what are you concerned about?
<clever> alp: dont think so, but there are files that will be missing, like /home and many others
<clever> abbradar[m]: ^^
<clever> Ariakenom: he is currently using the ntfs driver in the kernel
<clever> not sure what to do then
<clever> Ariakenom: can root write to it?
<clever> Ariakenom: what if you do `mount -v /mnt/windows` ?
<clever> Ariakenom: did it say anything about /mnt/windows?
<clever> Ariakenom: thats the windows way of fixing most problems :D
<clever> Ariakenom: `ls -lh /proc/*/fd/* | grep windows`
<clever> just missed him!
<clever> Ariakenom: what directory did you find 12 in?
<clever> Ariakenom: `ls -l /proc/*/* | grep windows` ?
<clever> Ariakenom: is something currently cd'd into it?
<clever> Ariakenom: try umount and then mount -v ?
<clever> Ariakenom: the kernel itself
<clever> Ariakenom: those are global ones, check `man mount`
<clever> Ariakenom: i also tend to not trust any write support for linux+ntfs, id rather use a fat32 middleman then risk the partition becoming corrupt
<clever> Ariakenom: the other option is the ntfs3g stuff that uses fuse, but i dont remember how to mount it from configuration.nix
<clever> Ariakenom: oh wait, next line down, it does have limited write support
<clever> Ariakenom: the driver your using only supports read-only mode
<clever> qubasa: map takes a function and a list, you only gave it a function
<clever> DariusTheMede: yep, either works
<clever> DariusTheMede: if you want to override it, then you need to set packageOverrides in config, to include an override against haskellPackages
<clever> DariusTheMede: it links to directions on how to make macos case sensitive
<clever> DariusTheMede: and --arg config with version= wont do what your expecting
<clever> DariusTheMede: hackage2nix
<clever> o1lo01ol1o: or "ls -lh ${foo}"
<clever> o1lo01ol1o: pkgs.runCommand "name" { buildInputs = [ foo ]; } "foo --help"
<clever> qubasa: or use `nix repl`
<clever> qubasa: add --strict i believe
<clever> o1lo01ol1o: then you want pkgs.runCommand "name" {} "bash code"
<clever> betaboon: nope
<clever> o1lo01ol1o: just run that bash and do nothing else? or after the build happens?
<clever> ldlework: it should purely download source, and nothing more
<clever> ldlework: but you shouldnt be doing any builds in the fetch derivation
<clever> just run that binary, from the hydra package
<clever> rnhmjoj: hydra-eval-jobs -I . nixos/release.nix
<clever> rnhmjoj: you can use hydra-eval-jobs without setting up hydra
<clever> rnhmjoj: the hydra-eval-jobs binary will restart the eval every time the memory usage hits a certain set limit, so it can keep going
<clever> DariusTheMede: if your on nixpkgs master, it already would have been
<clever> davidtwco: and nix isnt looking in /lib, so it cant find the "right" one
<clever> davidtwco: its likely that your preloaded thing needs a different libstdc++ version then what nix has
<clever> davidtwco: ah, that would definitely break some things
<clever> davidtwco: checking ~/.bash_history will reveal what you did
<clever> davidtwco: you must have set an env var in that terminal that broke things, and re-opening the terminal undid it
<clever> davidtwco: that command shouldnt have fixed anything, it just lists what is wrong
<clever> davidtwco: nix-store --verify --check-contents
<clever> pbb: and thats armv6, not 7 or aarch64
<clever> pbb: you want this, to change the stdenv entirely
<clever> nix-shell -E 'with import <nixpkgs> {}; pkgsCross.raspberryPi.stdenv.mkDerivation { name = "name"; }'
<clever> pbb: which gives you the x86 stdenv, with an arm stdenv jammed in sideways
<clever> pbb: that did stdenv.mkDerivation { buildInputs = [ pkgsCross.raspberryPi.stdenv ];
<clever> pbb: how are you using it? can you pastebin your example?
<clever> hmatrix*
<clever> probably "hamatrix-sundials" = super.hamatrix-sundails.override { sundials_arkode = pkgs.sundials; sundials_cvode = pkgs.sundails; };
<clever> DariusTheMede: ah, then youll need to fix it in configuration-common.nix, like vulkan = super.vulkan.override { vulkan = pkgs.vulkan-loader; };
<clever> DariusTheMede: you can either fix the cabal file, or use an override like vulkan to force it
<clever> DariusTheMede: and cabal2nix is just obeying that
<clever> DariusTheMede: i think the problem is that the cabal file is asking for the "wrong" library
<clever> ldlework: rm that sucker?
<clever> DariusTheMede: like this one
<clever> vulkan = super.vulkan.override { vulkan = pkgs.vulkan-loader; };
<clever> ldlework: yeah, if it makes a new hash each time
<clever> DariusTheMede: you want .override then, in configuration-common.nix
<clever> ldlework: it renames it to match the actual hash, rather then the wanted one
<clever> ldlework: but it should rename it upon failure, to match the hash it got
<clever> ldlework: thats the path it was trying to make
<clever> DariusTheMede: what is the key difference that fixes it?
<clever> ldlework: the storepath is a hash of that hash
<clever> ldlework: the hash from the error wont be in the store path