2020-04-18

<clever> bifunc2: anything that runs linux well should be fine, ive been using a system76 laptop lately
<clever> bifunc2: ive also done a variant before where i skip the installer iso, i just build nixos directly in /nix/store, and then overwrite the bootloader to change which /init it begins at
<clever> bifunc2: yeah, any x86-linux based machine can run that
<clever> bifunc2: yep
<clever> ixxie: leave a link to it in my issue, so others can find it later on?
<clever> ixxie: i'm thinking to start, nixops would just run your script during the first deploy, maybe with a few changes
<clever> cole-h: ive set `repeat = 1` on my `nix.conf` so i can see anything that cant be reproduced
<clever> jtojnar: i think ive seen chromium take 48 hours to build
<clever> and the changes are already done, so you can quickly turn it into a PR
<clever> and once you have it working, you know what has to change, and can translate it into an override
<clever> matthuszagh: and sometimes, its faster to edit nixpkgs and just `nix-build -A kicad && ./result/bin/kicad` when testing
<clever> in my case, i had copied the gradle/default.nix to ~/.nixpkgs/gradle.nix, so i could still change nixpkgs freely with git
<clever> $ grep gradle ~/.nixpkgs/config.nix #gradle = pkgs.callPackage ./gradle.nix {};
<clever> keeping an edited copy of nixpkgs like that is sometimes needed, because the package isnt override friendly
<clever> exactly that happened to me 2 days ago :P
<clever> matthuszagh: and then 4 years down the road, youll discover a gradle override in ~/.nixpkgs/config.nix and thats why its such an ancient version, lol
<clever> matthuszagh: so 99% of it comes from the channel, but kicad comes from the edited nixpkgs
<clever> matthuszagh: yep
<clever> and optionally file a PR to make things better for others in the future
<clever> clone down a copy of nixpkgs, just edit the file, and then do `kicad = self.callPackage /home/clever/apps/nixpkgs/pkgs/applications/science/electronics/kicad {}` to make your overlay mix the copy into everything else
<clever> and at that point, your basically copy/pasting the entire thing
<clever> and change installPhase
<clever> matthuszagh: or change the makeWrapperArgs, and swap in the new kicad-base value
<clever> matthuszagh: you must instead change kicad-base, which is in a let block, and impossible to change...
<clever> matthuszagh: this derivation ignores $src entirely, so changing src wont do anything!
<clever> 52 src = kicad-base;
<clever> 53 dontUnpack = true;
<clever> matthuszagh: i think i see the problem
<clever> and ngspiceSupport is true by default
<clever> 9 , ngspiceSupport ? true, libngspice
<clever> ok, its a plain stdenv.mkDerivation
<clever> 47 stdenv.mkDerivation rec {
<clever> 24399 kicad = callPackage ../applications/science/electronics/kicad { };
<clever> matthuszagh: yep
<clever> matthuszagh: can you gist your nix files?
<clever> matthuszagh: inputDrvs is computed automatically, based on the strings given to the derivation
<clever> the new cmd needs to be told what file to open
<clever> energizer: you want `nix build -f foo.nix`
<clever> energizer: the format of the args, and output
<clever> matthuszagh: what do you see if you run `nix show-derivation /nix/store/foo.drv` on the derivation in question?
<clever> pie_[bnc]: it detects this file in the root of nixpkgs
<clever> 177 versionSuffix =
<clever> 178 let suffixFile = ../.version-suffix;
<clever> pie_[bnc]: doesnt really work on a git checkout i think, works best on a channel
<clever> > lib.version
<clever> pie_[bnc]: the git rev?
<clever> matthuszagh: if cmakeFlags is empty, it just runs cmake with fewer flags
<clever> ixxie: they get left in /nix/store but wont show up in -qR
<clever> matthuszagh: whatever args where being sent to the real stdenv.mkDerivation, are the ones you manipulate with .overrideAttrs (old: and also the ones that appear within `old`
<clever> matthuszagh: .overrideAttrs works on the final call to the real stdenv.mkDerivation, so all of the other stuff in the middle is just going to manipulate the set with things like //
<clever> ixxie: then use `nix why-depents ./result /nix/store/fat-path` to find out why a big thing is in the closure, override, rebuild, repeat
<clever> ixxie: then run `du -h --max=0 -c $(nix-store -qR ./result) | sort -h` to see how big the closure is
<clever> ixxie: instead of building kexec_tarball, build kexec_script, so you get the uncompressed store path
<clever> slow it enough, and you can keep up while reading
<clever> ornxka: i think you can add rootdelay=10 to the kernel cmdline, and it will delay by 10ms after every line
<clever> ornxka: shift+pageup doesnt work?
<clever> ixxie: that lets you use the same tar, but customize the key at boot time
<clever> ixxie: if /ssh_pubkey exists on the ubuntu host when you /kexec_nixos, it will copy that file to /root/.ssh/authorized_keys as it boots
<clever> ixxie: where is it generating the iso and why?
<clever> time? disk used? network used?
<clever> yep
<clever> definitely could reuse that code in the nixops stuff too
<clever> just the 1st deploy
<clever> yeah
<clever> ah, and then the CI servers deploy for you?
<clever> ah
<clever> ixxie: are you hacking github's CI system to run nixos? lol
<clever> ixxie: yep
<clever> jbox: systemd.services.*.restartIfChanged.

2020-04-16

<clever> energizer: run why-depends on current-system, not current-system/sw
<clever> kalbasit: check if lorri is setting any odd vars when it runs nix?
<clever> i havent figured out why its different half the time, and why some of the text consoles look diff
<clever> freeman42x[m]: i find you sometimes need ctrl+alt+f2
<clever> niso: would need to fire a HEAD request to every single url in every package, and try on both http and https
<clever> niso: that could fail if the server doesnt have https up yet
<clever> but nixpkgs master does still have the same bug!
<clever> > gradle.src.urls
<clever> dang old overlays! lol
<clever> 127 gradle = pkgs.callPackage ./gradle.nix {};
<clever> > gradle
<clever> why is it there? lol
<clever> "~/.nixpkgs/gradle.nix" 39L, 1271C written
<clever> wait a second
<clever> niso: yep, that bypasses the problem
<clever> [clever@amd-nixos:~/apps/ghidra]$ nix-prefetch-url https://services.gradle.org/distributions/gradle-2.6-bin.zip
<clever> oh!
<clever> seems like gradle is broken on nixpkgs master
<clever> curl: (22) The requested URL returned error: 403 Forbidden

2020-04-15

<clever> pie_[bnc]: you need to basically patch the python code to use an absolute path, or use LD_LIBRARY_PATH to adjust where it can search
<clever> pie_[bnc]: at the time, it was just to detect that it was running under wine
<clever> so nix knows it was deleted
<clever> raboof: run `nix-store --delete` on the path you had deleted
<clever> dsal: #nixos-aarch64 may also be of more help
<clever> dsal: it looks like my banana-pi and your orange-pi are both sunxi/allwinner based, so the exact same directions work on both
<clever> and that happens to be the exact name you need for the orange pi as well
<clever> dsal: this shows how to get a u-boot-sunxi-with-spl.bin using nix, but it needs an armv7 builder
<clever> one min
<clever> dsal: you may need to do that, after using etcher to put sd-image-armv7l-linux.img onto the SD card
<clever> dsal: down under "boot u-boot", you need a copy of the right u-boot blob at a certain offset within the SD card
<clever> dsal: the 1st pic here, says there is an 8gig EMMC chip on it, which is basically an 8gig SD card
<clever> dsal: ahh, i was thinking it was an rpi
<clever> dsal: what computer is it?
<clever> dsal: you have netboot setup?
<clever> dsal: if you plug a monitor in, youll see it should look identical to android
<clever> dsal: that looks like android
<clever> dsal: which directory did you run that in?
<clever> dsal: ls -l / ?
<clever> dsal: what about /nix ?
<clever> dsal: what is in /lib ?
<clever> dsal: what is it lacking?
<clever> zeta_0: ive not used ghcide, so i'm not sure i can help much more
<clever> and its using stateVersion to figure out if you installed before or after, and keep it from changing and breaking
<clever> so that was changed somewhere just before march of 2019
<clever> energizer: if you are at least nixos 19.03, it will use ${dataDir}/.config/syncthing, but if you are older then 19.03, everything goes directly into dataDir
<clever> energizer: oh!, line 394!!
<clever> energizer: not sure, maybe some things in syncthing expect it to be in ~/.config/syncthing, so its being setup with dataDir as the parent and $HOME, to maintain that setup
<clever> energizer: line 474, 476, 479, 487, things are copied to configDir and the program is ran and told where to find configDir
<clever> energizer: line 31, something is made that points to the configDir
<clever> energizer: line 444, the home of the user is set to dataDir, and createHome=true; is set, so nixos will try to make the user and chown the dir to it
<clever> energizer: line 395, the configDir defaults to a subdir of dataDir

2020-04-14

<clever> energizer: using writeText, you should be able to name the derivation hello, but the file $out/bin/,hello
<clever> qyliss: try a -9 to the head then
<clever> qyliss: try `kill 20093` ?
<clever> qyliss: try `strace -p 20093`
<clever> qyliss: sudo wont work
<clever> qyliss: as root?
<clever> qyliss: ls -l /proc/*/fd/* | grep gc
<clever> gchristensen: CI is green!
<clever> gchristensen: i believe &lt;nixpkgs&gt; will fix it
<clever> gchristensen: a <nixpkgs> caused problems due to a lack of </nixpkgs>
<clever> manual failure
<clever> gchristensen: updated!
<clever> gchristensen: sounds like a good idea
<clever> gchristensen: hows the PR look now?
<clever> symphorien: nix repl '<nixpkgs/nixos>'
<clever> dsal: you must tell stack to add zlib to the requirements in nix-shell
<clever> ,libraries dsal
<clever> dsal: installing zlib wont put zlib.h into gcc's search path
<clever> virus_dave: a systemd service that depends on the fs being mounted, i guess
<clever> virus_dave: so if you chown it once, it should persist
<clever> virus_dave: when you mount nfs, it will inherit the uid/gid of the dir, on the remote end
<clever> gchristensen: got the 2nd review bit, and working on docs...
<clever> gchristensen: the printInfo is updated
<clever> gchristensen: do you think ^ needs some docs added to it?
<clever> cole-h: but it still has enough headers to link to libGL at runtime
<clever> cole-h: i think noglu lacks the userland libraries for driving a lot of open-source drivers
<clever> pie_[bnc]: probably mesa_noglu?
<clever> ,locate GL/gl.h
<clever> behind the scenes, nixos-rebuild will run switch-to-configuration (switch|test|boot)
<clever> cole-h: i think the "switch" arg you pass to it, will also update the bootloader, and make it the default, not entirely sure
<clever> energizer: the rollback just changes what nixos-rebuild and the bootloader stuff thinks is "current"
<clever> nopsled: nope
<clever> energizer: the default on boot may not be changed
<clever> energizer: that will just immediately switch to generation 35, without doing any rollbacks
<clever> energizer: yep
<clever> thequux[m]: i think it always ends in .a, since its just an ar(chive) of .o files
<clever> and just run the switch-to-configuration from the right generation
<clever> you can also skip the rollback/switch-generation step if you want
<clever> infinisil: and then you can manually run the switch, `/nix/var/nix/profiles/system/bin/switch-to-configuration switch`
<clever> `man nix-env` -> nix-env {--switch-generation | -G} {generation}
<clever> [root@amd-nixos:~]# nix-env --profile /nix/var/nix/profiles/system --list-generations 559 2019-11-25 08:31:04 560 2019-11-27 12:12:00
<clever> energizer: you can use `nix-env --profile ... --rollback` instead
<clever> ,callPackage nopsled

2020-04-13

<clever> pie_[bnc]: id just run unpackPhase in nix-shell if i wanted it interactively
<clever> pie_[bnc]: id just use runCommand and unpackPhase then
<clever> pie_[bnc]: what do you want to then do with the src?
<clever> > clang-unwrapped.src.builder
<clever> > clang-unwrapped.src.urls
<clever> pie_[bnc]: pkgs.fetchurl should do?
<clever> Cadey: nix-channel --rollback
<clever> pie_[bnc]: fetchzip unpacks for you
<clever> thats another way
<clever> sshow: you may need to edit the ./package.json line, to instead do "${foo}/package.json" and then let foo = fetch...
<clever> sshow: you then need to commit that default.nix to the repo, and load it with callPackage and fetchzip
<clever> WinchellsM: did you ctrl+c mid way thru?
<clever> WinchellsM: i'm a bit surprised nix-build even worked, the binary should have been missing
<clever> WinchellsM: nice
<clever> noonien: and nix-diff can compare 2 drv's
<clever> noonien: the .drv path is enough to see if it changed
<clever> $ nix-instantiate '<nixpkgs>' -A hello.outPath --eval
<clever> "/nix/store/n214akq42as1ckzj605c3s6y42cxby02-hello-2.10"
<clever> noonien: which hash? the output path?
<clever> noonien: -I nixpkgs=~/nixpkgs
<clever> noonien: and you didnt specify a filename, so it loads default.nix from the current dir
<clever> noonien: but if your never doing `<foo>` or `<nixpkgs>` then the NIX_PATH and -I get toally ignored
<clever> noonien: `-I .` means to search for `<foo>` at `./foo`
<clever> noonien: the `-I .` doesnt really do anything
<clever> energizer: which also conflicts with having a secrets.nix, because you have no way to write it out from nix
<clever> energizer: ive not read that yet, but the general solution is to give the service the path to a secret, rather then the secret itself
<clever> energizer: but what you pass the values to, may still write them to the store
<clever> energizer: i think you want `import (root + "/secrets.nix")` to stop it from copying the file into the store
<clever> you can also eval that in `nix repl ~/nixpkgs`
<clever> > pkgs.hello.meta.position
<clever> noonien: nix edit -f ~/nixpkgs hello
<clever> zeta_0: probably in the nixpkgs manual
<clever> evertedsphere: .override can undo other .override's so you may want to use .extend more
<clever> evertedsphere: then its pkgs.haskellPackages
<clever> evertedsphere: so haskellPackages = super.haskellPackages.extend (self: super: { idris = self.callPackage ~/idris/default.nix {}; });
<clever> evertedsphere: and idrisPackages is based on haskellPackages.idris
<clever> 8527 });
<clever> 8526 idris-no-deps = haskellPackages.idris;
<clever> 8525 idrisPackages = dontRecurseIntoAttrs (callPackage ../development/idris-modules {
<clever> evertedsphere: so if your override impacts idrisPackages, you can still use pkgs.idris, and nix will rebuild everything it needs to
<clever> evertedsphere: pkgs.idris is the result of calling idrisPackages.with-packages
<clever> 8529 idris = idrisPackages.with-packages [ idrisPackages.base ] ;
<clever> evertedsphere: whats the difference?
<clever> zeta_0: nix-prefetch-git
<clever> evertedsphere: yeah, its manual
<clever> evertedsphere: youll need to use callCabal2nix and fetchFromGitHub then to override it
<clever> evertedsphere: has it made it into a new hackage release?
<clever> evertedsphere: what is it doing with the hooks and what could fail if they arent ran?
<clever> nikola_i: it will rebuild everything, but only update the bootloader config, so the changes wont take effect until you reboot
<clever> nikola_i: you need to either `nixos-rebuild boot` or `nixos-rebuild switch` for that to take effect
<clever> for most things in /etc, its a symlink to the store, and will recover after you switch
<clever> yep
<clever> WinchellsM: rm /etc/nsswitch.conf ; touch /etc/nsswitch.conf
<clever> it will go away after you relog
<clever> safe to ignore that warning
<clever> WinchellsM: try `nixos-rebuild switch -I nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-19.03.tar.gz -I nixos-config=/etc/nixos/configuration.nix
<clever> WinchellsM: try `nixos-rebuild switch -I nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-19.03.tar.gz
<clever> WinchellsM: what is within it?
<clever> WinchellsM: does /nix/var/nix/profiles/per-user/root/channels/nixos exist?
<clever> WinchellsM: and you want to be editing roots channels
<clever> WinchellsM: add overwrites
<clever> WinchellsM: sure
<clever> WinchellsM: nix-channel --add https://nixos.org/channels/nixos-unstable nixos ; nix-channel --update
<clever> WinchellsM: ah, thats why --update didnt help
<clever> oops
<clever> WinchellsM: what is the contents of /root/.nix-channels ?
<clever> WinchellsM: what is the contents of /root/.nix-channel ?
<clever> WinchellsM: echo $NIX_PATH ?
<clever> WinchellsM: what does `nix-instantiate --find-file nixpkgs` say?
<clever> WinchellsM: did `nix-channel --update` as root complete?
<clever> WinchellsM: rm /etc/hosts ; touch /etc/hosts
<clever> WinchellsM: you may need to logout and back in, but i wouldnt do that into the switch finishes
<clever> ornxka: <nixpkgs/nixos>
<clever> WinchellsM: that gets remade automatically next time you open a terminal
<clever> WinchellsM: it will be remade automatically next time you install something with nix-env
<clever> WinchellsM: you can always just mount the FS's under /mnt (from the installer iso) and run nixos-install, if all else fails
<clever> WinchellsM: `nix-daemon`
<clever> WinchellsM: and nix-daemon must be running
<clever> WinchellsM: you need to run `nix-channel --update` to recover your copy of nixpkgs
<clever> WinchellsM: how is it not letting you?
<clever> then mix with the 2nd half of maralorn's idea
<clever> and then you have the ability to do rollbacks, nix-env --profile /nix/var/nix/profiles/per-user/clever/myapp --rollback
<clever> Ilya_G: you could also make your own custom profile, nix-env --profile /nix/var/nix/profiles/per-user/clever/myapp -f foo.nix --set -A attribute.path
<clever> Ilya_G: if you import the programs default.nix in configuration.nix, then nixos-rebuild will rebuild the service, and restart the systemd service for you, so you dont need anything fancy
<clever> Ilya_G: systemd on nixos actively ignores /run/current-system, you need to define it properly in the definition of the service
<clever> infinisil: it also has a constant pubkey, mapping back to your pubip, so you can be tracked at all times
<clever> infinisil: last i checked, it reports the hash of every single file you have a copy of to the DHT, so others can then find your pubkey, and then ip
<clever> simpson: i wonder if they are also running that ssh version? .....
<clever> simpson: one issue i can see with ipfs, is that i could query the cloud for everybody with a copy of a vulerable ssh version, then i have a list of IP's i can download it form
<clever> nilsirl[m]: you can also do: with import <nixpkgs> {}; ccextractor.overrideAttrs (old: { buildInputs = old.buildInputs ++ [ extra ]; })
<clever> nilsirl[m]: you can also do: with import <nixpkgs> {}; ccextractor
<clever> nilsirl[m]: then you just want `nix-shell '<nixpkgs>' -A ccextractor` and dont need a shell.nix or default.nix
<clever> nilsirl[m]: are you trying to build ccextractor or use it?
<clever> nilsirl[m]: and which package do you want to inherit, and use how?
<clever> nilsirl[m]: can you put the current default.nix into a pastebin?
<clever> nilsirl[m]: id need to see the default.nix first
<clever> nilsirl[m]: in your default.nix
<clever> nilsirl[m]: { inherit (pkgs) hello; }
<clever> and how that interacts with -I on a compiler
<clever> ornxka: think of it like #include <foo.h> in c/c++
<clever> ornxka: you forgot the -A, so its trying to open the file nixos.emacs25-nox in the current dir
<clever> hoplaahei: if you swap out /tmp, youll loose the unix socket for X11, and have to restart display-manager.service

2020-04-12

<clever> zeta_0: try running it inside nix-shell and see if it makes any difference
<clever> monokrome: now you can look thru for important things your missing, and adjust the config to make the diff smaller
<clever> monokrome: try `nix-store -q --deriver /run/booted-system` instead
<clever> monokrome: ah, that would be why then
<clever> monokrome: did you do nixos-rebuild at any point?
<clever> monokrome: thats normal, does it actually show a diff?
<clever> monokrome: weird, try updating the nix-diff cmd
<clever> monokrome: it shouldnt have
<clever> monokrome: again
<clever> monokrome: try `nix-store -q --deriver /run/current-system` say?
<clever> 2020-04-12 19:37:13 < monokrome> points to a nix-store
<clever> monokrome: the .drv file is not a bash script
<clever> nix-env -iA nixos.nix-diff
<clever> the command also doesnt need root
<clever> monokrome: you need to install nix-diff first
<clever> then you just edit configuration.nix to remove differences, and repeat the nix-diff
<clever> monokrome: that will show you the difference between your currently running os, and the current configuration.nix
<clever> monokrome: now try `nix-diff /nix/store/5ywfdxcg4arbxc7fb32gfxwv02bg76ip-nixos-system-peru.home.monokro.me-19.09.2395.02f2241354a.drv $(nix-instantiate '<nixpkgs/nixos>' -A system)`
<clever> monokrome: what path does it give?
<clever> monokrome: next, what does `nix-store -q --deriver /run/current-system` say?
<clever> monokrome: then you want boot.loader.grub.device = [ "nodev" ];
<clever> monokrome: first, do you know if it boots with efi or legacy?
<clever> monokrome: there are other options
<clever> monokrome: ah, and you now have boot.loader.grub.device(s) set in the new configuration.nix?
<clever> monokrome: is it already installed, or running from the installer iso?
<clever> monokrome: which file did you set that in?
<clever> monokrome: the steam in nixpkgs, is trying to simulate a debian system in a chroot
<clever> monokrome: yeah, the nixos release notes tell you what exactly you need to change