2019-11-09

<clever> omnipotententity: how is cmake being told to search for sqlite?
<clever> omnipotententity: is pkgconfig in nativeBuildInputs ?
<clever> leo_: i did a grep for "issue" to find where /etc/issue was made
<clever> numinit_: read that nix file
<clever> /home/clever/apps/nixpkgs/nixos/modules/services/ttys/agetty.nix: target = "issue";
<clever> ilya-fedin: use split outputs on the crystal derivation itself, to seperate the source and libraries/binaries
<clever> lane-s: nixos.org blocks pings
<clever> lane-s: the dns server in your router may have died, try restarting it?
<clever> lane-s: i only need the lines that start with nameserver
<clever> lane-s: what are the contents of /etc/resolv.conf?
<clever> lane-s: the browser has a dns cache
<clever> infinisil: nope
<clever> PING nixos.org (54.217.220.47) 56(84) bytes of data.
<clever> infinisil: even if you cant ping it, that will tell you the result of the dns lookup
<clever> lane-s: what if you try to ping it?
<clever> oops, that was for lane-s
<clever> drakonis2: what does `dig nixos.org` return?
<clever> lane-s: sounds like a problem for nix to solve!
<clever> lane-s: works for me
<clever> m1cr0man: correct
<clever> m1cr0man: nothing in /nix/store can have setuid bits set, nixos must generate those on bootup, in a tmpfs
<clever> m1cr0man: security.wrappers
<clever> tbenst: i think so
<clever> tbenst: the bigger question, is why you need to do that
<clever> tbenst: then you can add a special attribute to a derivation, to have it opt-out
<clever> tbenst: you first have to set sandbox=relaxed in nix.conf (configuration.nix has a flag for that)
<clever> sondr3: you want gcc9Stdenv.mkDerivation
<clever> nix-shell should get its own gcc, based on the expr
<clever> sondr3: installing gcc with home-manager wont work
<clever> sondr3: did you try gcc9Stdenv ?
<clever> then i had no use for it, disabled the module, and never did anything with it, lol
<clever> i had to write my own config for the card, and even patch pulseaudio itself (to support multiple muxes), to make full use of it
<clever> but by default, pulseaudio only supports 1 channel of capture
<clever> (mic, rear-line-in, front-line-in)
<clever> for example, my desktop soundcard has 3 physical inputs, 3 muxes to select any input, for 3 full capture channels
<clever> lucus16: that changes how many inputs and outputs a card has
<clever> lucus16: ah, you probably wanted to go to the configuration tab of pavucontrol, and select a profile there
<clever> that can also happen if something was using the alsa device when pulse started
<clever> oops
<clever> worldofpeace: does the hdmi appear on the output devices tab of pavucontrol?
<clever> worldofpeace: ive never had any issues with slim + xfce
<clever> lucus16: id say, check `/proc/asound/cards` to see if the alsa device exists first
<clever> so the hdmi audio just never works (on purpose)
<clever> enable=1,0 means to enable the 1st device, and disable the 2nd device
<clever> and pulse semi-randomly selects that output, resulting in no audio
<clever> in my case, hdmi goes to a monitor, with no speakers
<clever> 85 options snd_hda_intel enable=1,0
<clever> 84 extraModprobeConfig = ''
<clever> ive had the reverse issue!
<clever> worldofpeace: weird, i have both the socket, and autospawn, maybe the socket was already working before you set autospawn=no?
<clever> Active: active (running) since Fri 2019-11-01 17:01:25 ADT; 1 weeks 0 days ago
<clever> $ systemctl --user status pulseaudio.socket
<clever> lucus16: and that tree includes what service is responsible for starting things
<clever> lucus16: if you run `systemctl status`, it shows a giant tree
<clever> lucus16: systemctl --user status pulseaudio.socket ?
<clever> lucus16: is the pulseaudio actually a rogue one? or is it the one systemd is spawning?
<clever> lucus16: but it sounds like youve got boot mounted right, so thats not an issue
<clever> lucus16: so all changes you made would be undone at reboot
<clever> lucus16: ive seen a few new nixos users, that didnt mount /boot correctly, so all reboots where effectively a rollback
<clever> worldofpeace: i was refering to the commit you made to pulseaudio
<clever> lucus16: is /boot mounted?
<clever> lucus16: are you booting with efi or legacy?
<clever> so, systemd should now be opening the socket, and when you try to connect, systemd will spawn it for you
<clever> lucus16: ah, the comments say its now using socket activation
<clever> worldofpeace: what happened? :P
<clever> it will never begin with autospawn=yes
<clever> on master, client.conf can only ever contain autospawn=no
<clever> lucus16: i'm also seeing fishy things on github
<clever> nix-repl> config.system.stateVersion
<clever> "20.03"
<clever> nope
<clever> mine has that
<clever> [root@amd-nixos:~]# cat /etc/pulse/client.conf
<clever> autospawn=yes
<clever> daemon-binary=/nix/store/mfykadn8csjx10ww65ilcwgvwgnbcjff-pulseaudio-12.2/bin/pulseaudio
<clever> lucus16: that would be why its not auto spawning! but why...
<clever> lucus16: what is inside /etc/pulse/client.conf ?
<clever> lucus16: then it must be an issue with the auto-starting...
<clever> lucus16: does audio work now?
<clever> lucus16: dont bother rebooting
<clever> lucus16: try just running pulseaudio in a shell
<clever> ?
<clever> lucus16: try kill
<clever> mojjo: it also overwrites any other value, rather then merging
<clever> mojjo: and foo overwrites foo, so you lost your foo.a, causing confusion!
<clever> > :p { foo.a = 1; } // { foo.b = 2; }
<clever> > { foo.a = 1; } // { foo.b = 2; }
<clever> mojjo: // will just merge sets, so
<clever> lucus16: if you close every application related to pulseaudio, can you stop the daemon?
<clever> lucus16: then the parent is already gone, and pid1 adopted the orphan
<clever> lucus16: to start with, does `ps -eH x` show which process is the parrent of pulseaudio?
<clever> mojjo: also, using // on nxios config will cause more problems, your better off putting my.nix into the imports list, it will merge things a lot better
<clever> mojjo: you need to get writeTextFile from somewhere else, (import <nixpkgs> {}).writeTextFile
<clever> mojjo: it does work, but nixos must know the content of your nixos config, to know what the value of pkgs is
<clever> lucus16: try killing the rogue daemon, while pavucontrol is open
<clever> lucus16: run pavucontrol, what does it show?
<clever> lucus16: are there audio applications running outside of the X11 session?
<clever> lucus16: is hardware.pulseaudio.enable = true; set?
<clever> lucus16: if any client program tries to use pulse, but cant find an existing server, it will spawn its own server on the spot
<clever> then you can call those, to make a new crystal, the same way its already doing to make a dozen versions of itself
<clever> i would modify the default.nix to just expose generic and genericBinary directly
<clever> and when you change crystal, the old buildCrystalPackage remains, and refers to the old crystal
<clever> so, crystal has a buildCrystalPackage, that references the original crystal
<clever> 139 passthru.buildCrystalPackage = callPackage ./build-package.nix {
<clever> 142
<clever> 141 };
<clever> 140 crystal = compiler;
<clever> 42 let compiler = stdenv.mkDerivation rec {
<clever> pkgs/development/compilers/crystal/crystal2nix.nix:crystal.buildCrystalPackage {
<clever> pkgs/development/compilers/crystal/default.nix: passthru.buildCrystalPackage = callPackage ./build-package.nix {
<clever> you need to figure out how buildCrystalPackage was made, and give it the new crystal
<clever> ilya-fedin: that is referencing the old pre-overlay crystal
<clever> ilya-fedin: aha, crystal.buildCrystalPackage is likely to blame
<clever> ilya-fedin: what about the full nix code for the one that doesnt work?
<clever> ilya-fedin: can you pastebin or gist all of the files in full?
<clever> ilya-fedin: where did you put the overlay?
<clever> ilya-fedin: how does it fail?
<clever> ilya-fedin: and is that new sha256 different from the old one?
<clever> check the nuke-refs docs (or source) and try to nuke only references to crystal
<clever> but that on its own will likely result in a binary that doesnt run
<clever> nuke-refs $x
<clever> # nuke-refs will just replace all storepaths with an invalid one
<clever> extraBuildInputs = if win64 then [ wine nukeReferences ] else [ nukeReferences ];
<clever> ilya-fedin: nukeReferences
<clever> to start with, split output crystal, so the source and compiler arent in the same output
<clever> ilya-fedin: i think the compiler needs to be fixed, to not do that
<clever> ilya-fedin: those look like error messages pointing to lines of source in the compiler
<clever> ilya-fedin: can you pastebin the bit of strings output, that includes the offending string?
<clever> ilya-fedin: does ldd on the binary show crystal?
<clever> but its also fairly cross-platform, and i could in theory shove media-center.nix onto an rpi with no changes
<clever> nas.nix has media-center.nix in the imports, but its currently not reused by anything else
<clever> and yeah, then i have profiles, for certain tasks, some shared, some i just want an easy off switch
<clever> machine1.nix is per-device, and each has its own entry-point
<clever> blaggacao: so i dont need to make a host symlink, the imports entry handles that
<clever> blaggacao: and then i do imports = [ ./machine1.nix ];
<clever> blaggacao: personally, i keep configuration.nix rather bare, only the stuff related to the hardware (like fs uuid's, and bootloader cfg)
<clever> blaggacao: there is a hello world example in the comments, which will print "hello world!" out the serial port, without any closed-source firmware (other then the boot rom)
<clever> blaggacao: https://github.com/NixOS/nixpkgs/pull/72657 is where ive been adding vc4 support
<clever> ilya-fedin: you could try running strip on the binary, in a postBuild hook
<clever> blaggacao: ive not looked into the wayland stuff, so i dont know that
<clever> blaggacao: but vc4 is a dual-core cpu, that is heavily specialized into vector operations
<clever> blaggacao: basically, v3d is just a 3d rendering core, its highly specialized at turning textures and vertexes into 3d renderings
<clever> blaggacao: vc4 is a whole new beast, that ive only just recently started to play with
<clever> blaggacao: it was mostly just a matter of setting a config.txt flag to disable start.elf from touching v3d, and then writing linux drivers to poke the right registers
<clever> blaggacao: i was once writing v3d drivers for the rpi, they ran entirely from the arm side of things
<clever> ilya-fedin: somewhere inside the binary of that file, is a path to the library, youll want to run strings on the binary to get the full path, crystal (the compiler) may need to be modified to be split output, so the libs are in their own output
<clever> that then loads kernel.img, and turns the ARM core(s) on
<clever> that then enables the dram, and loads start.elf (another VC4 binary)
<clever> that loads bootcode.bin into the L2 cache (128kb of sram)
<clever> when you first power on, the pi, it begins running the boot rom on the VC4 cpu
<clever> nope
<clever> VC4 is more if you want to replace the gpu firmware entire with opensource
<clever> wayland could be done entirely on the arm side, using the dispmanx api
<clever> models*
<clever> VC4 is the GPU side for all modems
<clever> the rules say you cant share the boot rom, but nothing stops you from reading it, so you could always dump your own boot rom, and dis-assemble it
<clever> blaggacao: i also have a PR open to add the entire VC4 toolchain (the gpu side of things) to nixpkgs, which can disassembly the gpu firmware
<clever> blaggacao: partially, your only getting a trace of what filenames it tries to read
<clever> [root@router:/tftproot]# ls -ltrh 9080d9b6/root.squashfs -L
<clever> -r--r--r-- 4 root root 41M Jan 1 1970 9080d9b6/root.squashfs
<clever> so you can abuse the tftp boot, as a way to see what the bootrom is thinking, and find hidden features
<clever> and some of those files also work on the sd card, and arent documented
<clever> that reveals, what files its searching for
<clever> another neat thing, is that if the rpi boot rom tries to netboot, it will query the tftp server for all the files
<clever> or, the nix expresion in the profile, could generate a directory for every mac in the setup, and manage them all as one unit
<clever> so i could just make a 2nd profile, and point other macs to that other profile
<clever> and i have symlinks for some macs, pointing to the rpi3-netboot profile
<clever> blaggacao: the boot rom in the rpi, will search for a directory named after its mac addr
<clever> lrwxrwxrwx 1 root root 48 Apr 7 2019 55a4377c -> /nix/var/nix/profiles/per-user/root/rpi3-netboot
<clever> lrwxrwxrwx 1 root root 48 Dec 11 2016 9080d9b6 -> /nix/var/nix/profiles/per-user/root/rpi3-netboot
<clever> [root@router:/tftproot]# ls -ltrh
<clever> blaggacao: behind the scenes, nixos-rebuild is just a shell script that runs `nix-env -p ... foo.nix -A bar --set`
<clever> ilya-fedin: use `nix-store -qR ./result` and `nix why-depends ./result /nix/store/something` to figure out what it depends on, and why
<clever> blaggacao: so if i brick the netboot image, its a single command to instantly un-brick it
<clever> blaggacao: now, the real magic, is that `nix-env -p /nix/var/nix/profiles/per-user/root/rpi3-netboot --rollback` can do a rollback!
<clever> so when an rpi netboots, it grabs from the last build
<clever> blaggacao: i then have a symlink in my tftp root dir, that points to rpi3-netboot
<clever> blaggacao: it basically behaves the same as `nixos-rebuild switch`
<clever> blaggacao: this will build whatever is in .rpi_image of release.nix, and then set rpi3-netboot to point to the result
<clever> nix-env -p /nix/var/nix/profiles/per-user/root/rpi3-netboot -f not-os/release.nix -A rpi_image -I nixpkgs=./nixpkgs/ --set
<clever> blaggacao: one min
<clever> its mostly a security thing, if you turn it on after the card fell out, it will netboot, and you may not trust the local network
<clever> blaggacao: and once enabled, it cant be disabled, but it will still support booting from sdcard
<clever> blaggacao: with the rpi3, you need an entry in config.txt on the sdcard, to enable network boot
<clever> so you can now update the boot code, without having to keep an SD card around
<clever> the rpi4 also added an SPI flash chip, to solve that problem for good
<clever> blaggacao: with some models of rpi, the boot rom cant fully network boot on its own, but if you make an SD card with ONLY bootcode.bin and nothing else, that can patch the boot rom bugs, and the card never accepts any writes
<clever> and i do have it booting on rpi's, but currently without X11
<clever> blaggacao: oh yeah, and there is not-os, ive gotten the image down to ~40mb
<clever> ive also had some issues with the boot rom netboot code, i suspect it doesnt check checksums
<clever> you could also have a variant, that will re-flash its own SD card, over the network, on bootup, so the card acts like a cache
<clever> so it only churns on startup or reboot
<clever> blaggacao: the network boot i was thinking of, downloads the entire image on bootup, and then runs from ram
<clever> then you can just swap the image file out, hit reboot, and your updated
<clever> blaggacao: 3: network boot them all from a single image!
<clever> blaggacao: 2: use nixops to deploy changes to each pi over the network
<clever> blaggacao: 1: just re-image the sd card when changes happen, nix can build the whole .img file
<clever> blaggacao: 3 main ways you could manage a farm of those
<clever> dongcarl: import just parses whatever was in the given file, and returns that
<clever> which accepts localSystem, system, platform, crossSystem, config, overlays, and crossOverlays
<clever> dongcarl: and impure.nix defines a function
<clever> dongcarl: <nixpkgs> refers to this file, which just returns whatever was in impure.nix
<clever> dongcarl: function
<clever> dongcarl: to bring all of nixpkgs into scope
<clever> infinisil: now you made the bot scream, lol
<clever> dongcarl: nixpkgs is a path, not a function
<clever> lordcirth: yeah, but the problem has been there for a month
<clever> dongcarl: import is a function that will just import a nix expression, and return whatever was inside that file
<clever> skrzyp: https://gist.github.com/cleverca22/c9ba411b7dd251c781d426dea4520dc0 every time that string has been in the topic, there has never been anything after it
<clever> skrzyp: i checked the logs, and it never had anything after that
<clever> ,howoldis contrun[m]
<clever> eyJhb: if you run ls -lh, does that file actually exist?
<clever> eyJhb: thats all you needed
<clever> > "${zlib}/lib/libz.so.1"
<clever> eyJhb: 90% of the time, you dont want toPath

2019-11-08

<clever> eyJhb: you want to wrap it with ()'s
<clever> eyJhb: line 2 of the paste, that is a list containing a function and a set
<clever> mikky: multiple output derivations
<clever> LnL: the pr also changes racerd at the same time?
<clever> mikky: depends on if libxml2 is in scope or not already
<clever> mikky: ${libxml2.dev}
<clever> kuznero: ^^
<clever> /nix/store/99xkqxwnarz307385dv7yafdhzszyfk6-gawk-5.0.1/bin/gawk
<clever> [clever@amd-nixos:~]$ realpath /run/current-system/sw/bin/awk
<clever> Hindsight44: best to use ''strings'' with that, so the indenting gets cleaned up
<clever> Hindsight44: https://nixos.org/nixos/options.html#<name>.script the 2nd one
<clever> Hindsight44: .script is a full bash script, and can be multiple lines and use normal \ from bash
<clever> Hindsight44: you can also use .script instead of .serviceConfig.ExecStart
<clever> Hindsight44: nix ignores any whitespace outside of a string, so you can just shove newlines anywhere you want
<clever> kuznero: src must be the path to a file, not a string
<clever> mikky: if you want a new version, update the channel, and then nixos-rebuild
<clever> mikky: systemPackages will always install whatever is the current version in your channel, and it updates all of them at once
<clever> kuznero: it will copy from src to $out, and return that $out
<clever> kuznero: yeah
<clever> kuznero: any attributes you passed to pkgs.substituteAll, will be in the env during that bash substituteAll
<clever> kuznero: which will replace any @foo@ with the value of ${foo}
<clever> kuznero: all it does is run the bash substituteAll on the src and target paths
<clever> kuznero: line 423 of all-packages.nix
<clever> > builtins.unsafeGetAttrPos "substituteAll" pkgs
<clever> kuznero: this will replace @nix@, and a few other things, within nixos-rebuild.sh
<clever> nixos-rebuild is such a script
<clever> ,escape'' kuznero
<clever> its both a bash function and a nix function, they basically do the same thing
<clever> kuznero: then maybe you want pkgs.substituteAll
<clever> kuznero: { x }: "....${x}..." and then just `import ./test { x = "foo"; }`
<clever> kuznero: why not make test a nix function?
<clever> LnL: so if the string in the overrides.nix is updated, it should work once more
<clever> LnL: oh, i see now
<clever> and the vim fix
<clever> eyJhb: https://github.com/cleverca22/nixos-configs/blob/master/vim.nix#L16 is how i manage things, but the ycm fix is absent
<clever> LnL: i havent noticed that actually working, and the problem is more that its trying to use an interpreter, when there was already a working #!
<clever> eyJhb: probably
<clever> KarelWDingeldey[: there is a month of overlap when a new release comes out, then the old release stops getting updates
<clever> eyJhb: b: patch ycm to obey the #!
<clever> eyJhb: a: tell ycmd to explicitly use python3 (but its still ignoring the #!)
<clever> eyJhb: its probably designed for lesser OS's that dont use #!'s as heavily
<clever> eyJhb: and its ignoring the fact that ycmd already had a #! that did the right thing
<clever> eyJhb: the problem is that the vim script, is looking in places like /usr/bin to find a python binary, to run ycmd
<clever> eyJhb: its already using python3
<clever> eyJhb: nix-build '<nixpkgs>' -A python3 -o ~/python3-root, for ex
<clever> eyJhb: youll need to build a python3 then, put its link somewhere predictable, and put its path into the vimrc
<clever> eyJhb: and all of that is pointless, because ycmd already had a #!/nix/store/foo/bin/python on it
<clever> eyJhb: the problem, is that the ycm stuff in vim, tries to run `python /path/to/ycmd`, but looks up the python path in a number of places
<clever> eyJhb: you need to add this to the vimrc
<clever> 48 let g:ycm_server_python_interpreter='${pkgs.python3.interpreter}'
<clever> eyJhb: one sec
<clever> davidak: what exactly is it fetching from the internet? could you fake it with an nginx server and /etc/hosts?
<clever> davidak: the internet is disabled during all testing
<clever> mananamenos: run `id`
<clever> davidak: not sure why its so slow then, but usually better to do the test in the derivation, without qemu
<clever> davidak: does /dev/kvm exist on your machine?
<clever> so chromium itself isnt a module, but it relies on a module to start
<clever> i think the only reason things like chromium are in a nixos test, is because it needs X11 to test
<clever> davidak: for cli apps, its usually simpler to just put it into the derivation, as a checkPhase
<clever> Yaniel: i saw a solution in this channel already, blow away a beta dir
<clever> yeah
<clever> red[m]: once staging is confirmed to not break everything, somebody usually merges it into master
<clever> bsima: that should work...., does any interface exist in the guest?
<clever> bsima: what QEMU_NET_OPTS did you set?
<clever> bsima: if you tcpdump the ethernet if inside qemu, does it show traffic on port 22?
<clever> evanjs: it might be peeking in $HOME
<clever> bsima: is ssh enabled in the guest?
<clever> bsima: what args are you using to ssh?
<clever> yeah
<clever> pre196201.07d4df59626
<clever> [clever@amd-nixos:~/apps/nixpkgs/lib]$ cat ~/.nix-defexpr/channels_root/nixos/.version-suffix
<clever> its just a string within the file
<clever> > pkgs.path + "/.version-suffix"
<clever> pkgs.path + ".version-suffix