2020-07-19

<clever> superbaloo: and what is the expr that is generating that drv?
<clever> duairc: so that central machine will download the file, then upload it to the remote boxes
<clever> duairc: nixops always wants the entire closure on the machine running nixops
<clever> superbaloo: can you pastebin the output of `show-derivation`?
<clever> superbaloo: is it using bare stdenv.mkDerivation?
<clever> mudri: nix will give you binary identical replacements, which should function in the identical way
<clever> mudri: reinstalling wont make any difference at all
<clever> mudri: ah, weird
<clever> superbaloo: then youll want to modify the expr that is defining that derivation
<clever> superbaloo: check the `nix show-derivation` for its drv, does it show curl?
<clever> gueorgui: (facepalm), the one thing you never think to check!
<clever> superbaloo: they should be appearing in the $out/nix-support/ of each build
<clever> gueorgui: it sounds like the SD card is formatted with something weird
<clever> weird
<clever> (as root)
<clever> gueorgui: what about `blkid /dev/sda` ?
<clever> quinn: read that line of that file
<clever> > builtins.unsafeGetAttrPos "buildGoModule" pkgs
<clever> not sure then
<clever> gueorgui: `sudo hexdump -C /dev/sda1 | head -n30` ?
<clever> gueorgui: `sudo fdisk -l /dev/sda` ?
<clever> gueorgui: what does `blkid /dev/sda1` report?
<clever> time.timeZone
<clever> gueorgui: yeah
<clever> gueorgui: i think the only way to set the timezone is via configuration.nix
<clever> TheSirC[m]: ah, you can temporarily change $NIX_PATH to bypass the error, until you find the true cause
<clever> cole-h: the error happens with `nix-shell -p hello` which ignores the nixpkgs.overlays entry in configuration.nix
<clever> TheSirC[m]: types.nix is fishy, what happens if you disable it?
<clever> TheSirC[m]: can you pastebin all of the overlays?
<clever> mudri: probably here, but i'm not sure who would know more
<clever> havent seen that one yet
<clever> heh
<clever> mudri: those linker errors look weird, like something is out of date
<clever> mudri: ah, 2 haskell questions at once!
<clever> symphorien: xmonad itself, also includes wrappers, so `xmonad --reload` can recompile itself
<clever> evanjs: yeah
<clever> evanjs: look at the URL when using that hoogle server, youll see store paths in the addr bar
<clever> evanjs: or find another more secure way to host the server
<clever> evanjs: ive noticed a security issue with that hoogle server, its sharing all of the store, possibly the entire / dir
<clever> you would need to fix the network first, or smuggle a gdb in with `nix copy --from local?root=/mnt/` and a usb stick
<clever> ahh, but without network, i see
<clever> kl3: i tend to just run it under `nix-shell -p gdb`
<clever> Graypup_: yeah, self.callPackage ./something.nix { inherit (pkgs) pango; }
<clever> gchristensen: the error with read capacity, may prevent it from creating a device node
<clever> gchristensen: maybe there is a msg after that one, saying sdi disconnected?
<clever> gchristensen: can you pastebin the whole dmesg?
<clever> duairc: the difference vs using the nix assert statement, is that nixos can report multiple errors at once
<clever> duairc: nixos has a special "option" called assertions, it takes a list of { assertion = bool; message = "something"; }
<clever> numkem: you want to either `import sources.nixpkgs { config = config.nixpkgs.config; }` to make it respect the option, ot you can `{ config.allowBroken = true; }` to have a 2nd copy of config
<clever> numkem: when you re-import nixpkgs, it ignores nixpkgs.config, and instead obeys the config.nix in $HOME
<clever> are you importing a 2nd nixpkgs?
<clever> numkem: are you building it with nix-build, nix-env, or nixos-rebuild?
<clever> you can either run nix-shell on that, or nix-build if you have a Makefile with a default target that produces an avr.bin
<clever> tinhead77: one minute
<clever> try throwing a `pwd ; ls -ltrh` into the checkPhase, what does it show?
<clever> hexa-: the unpackPhase unpacks it to . for you, so its just .
<clever> rnhmjoj: undefined variable means you have an error in the nix, not an undefined option
<clever> rnhmjoj: just use it somewhere, and dont give it a default
<clever> Jake[m]: what is the full command that it ran, when having that error?
<clever> o1lo01ol1o: the nixos service will also install its own copy, that matches the daemon
<clever> o1lo01ol1o: lines 257 and 11
<clever> o1lo01ol1o: there will be a second problem after you fix that
<clever> TheSirC[m]: are you on a version of nixpkgs that includes the updates you want? check `nix-instantiate --find-file nixpkgs`
<clever> o1lo01ol1o: when you do `type pg_restore`, and then run realpath on that path, what does it output?
<clever> TheSirC[m]: they will update automatically when you update the channel and nixos-rebuild
<clever> hazel[m]: my trick is to just `cd /etc/ ; cat hosts > hosts.temp ; rm hosts ; mv hosts.temp hosts`
<clever> changing the permissions will break things in a worse way, it wont always be able to undo it
<clever> jlv: you want to delete the symlink at /etc/hosts, and replace it with a normal file, with the contents you want (which can be a copy of the old one)
<clever> jlv: thats worse

2020-07-18

<clever> utf64: just `nix-build '<nixpkgs/nixos/release.nix>' -A netboot.x86_64-linux`
<clever> utf64: there is an attribute for it in the main nixos/release.nix
<clever> should be
<clever> yeah, thats a work-around to make it boot without efi vars
<clever> so if you delete the partition first, the efi var is permanently stuck, until you run out of space for efi vars
<clever> i have also heard of some bios that wont let you delete an efi var if the partition is missing
<clever> "it booted windows, ship it"
<clever> fyuuri: i have seen some bios's that ignore all atempts to change the efi vars, and only boot the .efi file windows uses
<clever> fyuuri: the `can touch efi vars` lets grub modify the efi vars, and `efiboormgr -v` just prints the efi vars
<clever> fyuuri: normally, `efibootmgr -v` should show the partition uuid of the efi system partition, and the path to a .efi file within it
<clever> /dev/nvme0n1p1: UUID="7DBC-2698" TYPE="vfat" PARTUUID="27c99b08-455d-4dfe-a44f-6150cbc09ef8"
<clever> Boot0004* UEFI OS HD(1,GPT,27c99b08-455d-4dfe-a44f-6150cbc09ef8,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
<clever> fyuuri: not sure, efi is a bit of a mess, there is an official spec, and then every motherboard vendor breaks it in unique ways
<clever> fyuuri: your welcome
<clever> yeah, you can add it to the kernel params in grub
<clever> fyuuri: and boot.kernelParams to set them in configuration.nix
<clever> fyuuri: you can hit e while at grub to make temporary changes to the kernel params
<clever> archh: users.mutableUsers = false;
<clever> archh: it may only work if you set mutableusers = false
<clever> which is how the usb stick can even boot in efi mode
<clever> fyuuri: that lets the efi firmware load it, without it being properly setup in the efi vars
<clever> fyuuri: it makes grub use a special filename, that the bios thinks is for any removable disk
<clever> archh: did you run nixos-rebuild switch? is the new hash showing up in /etc/shadow?
<clever> correct
<clever> the `bios boot partition` is only needed if you want legacy booting on gpt
<clever> then it works either way
<clever> legacy+efi can be simpler if you dont know what the bios will be doing
<clever> but grub can also do legacy + efi at the same time
<clever> fyuuri: yeah, grub.device is only for legacy, and you can set it to "nodev" to disable legacy booting
<clever> fyuuri: the guide you linked also says to use unetbootin, that typically breaks booting from the usb stick entirely
<clever> fyuuri: can touch efi variables should be set to true
<clever> fyuuri: yep
<clever> fyuuri: try setting `boot.loader.grub.efiInstallAsRemovable = true;` and re-run nixos-install while its all mounted
<clever> fyuuri: what does `efibootmgr -v` report?
<clever> fyuuri: the usb image is both efi and legacy
<clever> fyuuri: have you tried turning efi off in the bios?
<clever> fyuuri: is boot.loader.grub.device set?
<clever> fyuuri: are you using grub or systemd-boot?
<clever> fyuuri: EF00 is for booting via efi
<clever> fyuuri: EF02 is only used if you want to do legacy booting from GPT
<clever> yep
<clever> __monty__: i think the problem, is that a python thing you ran, dynamically generated a pyc in the store, when you ran it as root
<clever> __monty__: ah, its safe to just `sudo rm -rf /nix/store/trash`
<clever> __monty__: what file is problematic?

2020-07-17

<clever> codygman___: look into haskell.lib.doJailBreak
<clever> main things i focus on are rpi firmware (both flat bin and elf files), with the occasional static-arm-linux and dos-x86 on the side
<clever> ah, ive only disassembled fully static binaries
<clever> is it for ghidra to run, or ghidra to disassemble things?
<clever> you could put it into a shell.nix as an env var
<clever> and then build it with nix-build
<clever> evanjs: i would just use buildEnv to merge them together
<clever> just grep the nixpkgs source for examples of how to use it
<clever> > pkgs.fetchpatch
<clever> LHurttila: fetchpatch isnt a package
<clever> LHurttila: how did you try looking?
<clever> you can find examples in nixpkgs
<clever> LHurttila: you can also use pkgs.fetchpatch to download it
<clever> LHurttila: if the entire change is in one commit on git, you can just add .patch to it
<clever> or is the phrase, "special snowflake" i think?
<clever> apple had to be a special sunflower, and make their nvme drive non-compatible
<clever> LHurttila: the file i linked, was to fix a driver problem when running linux on mac hw
<clever> LHurttila: you need to unpack the current linux source, and then checkout master for the above branch, and use `diff -ru` between the 2 dirs to generate a patch
<clever> you just shove a set into boot.kernelPatches, which has a name and the path to a patch
<clever> > kernelPatches.mac_nvme_t2
<clever> LHurttila: boot.kernelPatches
<clever> Henson: i think #nixos-aarch64 has been looking into that
<clever> zanc: behind the scenes, nix-channel and nixos-rebuild are just acting on different nix-env profiles
<clever> zanc: nix-env --profile /nix/var/nix/profiles/per-user/clever/channels/ --list-generations
<clever> AWizzArd: it should just be a matter of adding pkgs to the list on line 1
<clever> AWizzArd: and what is the exavt error?
<clever> AWizzArd: can you put all of the files into gist.github.com ?
<clever> AWizzArd: yeah, then you just do `haskellPackages.callPackage ./second.nix {}`
<clever> lovesegfault: -I nixpkgs=/path/to/custom
<clever> zanc: what about `nix-store --query --roots` on one of those paths?
<clever> AWizzArd: for example, the 2nd file would have `{ pkgs }:` and the 1st file would be `import ./second.nix { inherit pkgs; }`
<clever> AWizzArd:
<clever> AWizzArd: you need to pass the value of pkgs over as function args
<clever> zanc: if you want to delete a path, you use `nix-store --delete /nix/store/path`
<clever> colemickens: that means its in environment.systemPackages
<clever> sephii: thats a seperate thing, runtime vs compiletime
<clever> sephii: so you would just set php.bz2 = true; in config.nix or nixpkgs.config.php.bz2 = true; in configuration.nix
<clever> sephii: that is the main config.nix or nixpkgs.config
<clever> sephii: can you paste an example one?

2020-07-16

<clever> woleium: but the option name uses an s
<clever> woleium: with an s or a z?
<clever> zanc: nix-prefetch-url doesnt really work on a raw directory, you want nix-hash for that
<clever> zanc: which you need, depends on how your fetching the thing in the nix code
<clever> zanc: prefetch --unpack will return the hash of the NAR of the directory you get from unpacking
<clever> zanc: prefetch on its own, returns the hash of the tar .tar.gz file
<clever> zanc: some things want the `nix-prefetch-url --unpack` hash
<clever> colemickens: tossed into my notes, that will probably come in handy later
<clever> colemickens: yeah, ive just done `docker load < ${expr} && docker push something`
<clever> sanny: try `nix-store --verify --check-contents --repair`
<clever> sanny: that would also make every single file executable, which makes things worse
<clever> sanny: of note, files and directories should have diff permissions
<clever> sanny: how did you try to fix it?
<clever> sanny: most of /nix/store should be 555, but /nix/store itself should be 1775
<clever> that might be /etc/bashrc to blame, not sure
<clever> which distro are you on?
<clever> so things can malfunction if you use any other env
<clever> nix-shell is only really meant to work on things using the stdenv
<clever> that should do the same thing
<clever> clangStdenv.mkDerivation { buildInputs = []; src = ./hello-2.10.tar.gz; }
<clever> you probably want to use stdenv more
<clever> what are the contents of hello.nix ?
<clever> the ; wont run irb until after nix-shell exits
<clever> johnbcoughlin: nix-shell --pure hello.nix

2020-07-14

<clever> gchristensen: doit!
<clever> cap_sensitive: can you screenshot the error msg and the cmd that was ran?
<clever> maybe you forgot the {} there too?
<clever> cap_sensitive: is the command in irc further up, the exact one you ran?
<clever> cap_sensitive: you forgot the {} at the end
<clever> cap_sensitive: that should just work..., what happens if you run that expr in `nix repl` ?
<clever> cap_sensitive: contents of package.nix?
<clever> cap_sensitive: what are the contents of package.nix? is it part of nixpkgs or outside?
<clever> gueorgui: linuxPackages_5_7 and boot.kernelPatches

2020-07-13

<clever> bbl
<clever> dansho: only the rustc in the nix store will work, and its being dumb and re-running the broken rustc's from ~/.rustup/ to "help you" with changing versions (which cant work on nix)
<clever> dansho: its reading that same config file, and running the "wrong" rustc
<clever> execve("/home/dansho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc", ["/home/dansho/.rustup/toolchain"..., "--version"], 0x55e1e0906310 /* 124 vars */) = 0
<clever> dansho: i think this config file is forcing it to run the wrong rustc
<clever> openat(AT_FDCWD, "/home/dansho/.rustup/settings.toml", O_RDONLY|O_CLOEXEC) = 3
<clever> dansho: it printed a version without any errors..., weird
<clever> write(1, "rustc 1.41.0-nightly (bbb664a99 "..., 44rustc 1.41.0-nightly (bbb664a99 2019-11-28)
<clever> dansho: it feels like the rustc you ran ldd on, is working perfectly fine, but it then decides to run a totally different rustc, check `strace rustc --version` ?
<clever> dansho: then why are you getting an error from /home/dansho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc ?
<clever> i mean, `which rustc`
<clever> dansho: what does `which rustup` report?
<clever> dansho: what does `LD_TRACE_LOADED_OBJECTS=1 rustc` report?
<clever> > builtins.readFile
<clever> patagonicus: thats just a helper, that sets buildCommand for you
<clever> patagonicus: there is also `pkgs.runCommand "name" { buildInputs = []; } "script goes here"`
<clever> patagonicus: if you set buildCommand, it skips all phases, and its unpackPhase that complains about $src
<clever> Fare: there is builtins.match, but its not full regex
<clever> > builtins.pathExists ./version.nix
<clever> ixxie: and its relative to the path that ./foo exists within, not the file doing readFile
<clever> ixxie: ./foo is relative to the dir the file is in
<clever> sphalerite: i had started a sort of lib for that kind of thing, but the only thing i implemented was reversing an ip, to create PTR records: https://github.com/cleverca22/nix-tests/blob/master/ip-magic/core.nix
<clever> midchildan: you can still add those binaries to the store

2020-07-12

<clever> or restart, or start
<clever> 445 system("@systemd@/bin/systemctl", "start", "--", sort(keys %unitsToStart)) == 0 or $res = 4;
<clever> 433 system("@systemd@/bin/systemctl", "restart", "--", sort(keys %unitsToRestart)) == 0 or $res = 4;
<clever> m1cr0m4n: i think that happens if reload fails?
<clever> 425 system("@systemd@/bin/systemctl", "reload", "--", sort(keys %unitsToReload)) == 0 or $res = 4;
<clever> 424 print STDERR "reloading the following units: ", join(", ", sort(keys %unitsToReload)), "\n";
<clever> so some just fail to update and keep working, others "successfully" but then brick itself, and wont work even if you do update with nix (you have to clear the right state)
<clever> except the new ver isnt patchelf'd so it fails after the update, when it next launches
<clever> ixxie: but i have seen that dropbox tries to put its update into something like ~/.dropbox/ and then the old ver runs the new ver automatically
<clever> ixxie: some programs try to edit themselves in /nix/store, that will just hard fail
<clever> systemd is about the simplest modern way to run something on startup
<clever> yeah, it would be one-shot, so it only runs on login and wont stay running
<clever> when nix parses that, it will turn into `gpg recv-keys /nix/store/hash-keys`
<clever> raghavsood: i'm thinking a systemd-user service, that just runs `gpg recv-keys < ${./keys}`
<clever> duairc: when updating /boot, the scripts will read whatever path you gave it, and copy the secret into the initrd
<clever> duairc: i think you want to use deployment.keys to put the key on the machine, and set boot.initrd.network.ssh.hostKeys = "/path/on/remote/box"; to the path you told deployment.keys to use
<clever> and you never notice that its not using the new shell.nix
<clever> my problem with things like lorri, is that when you get such eval errors, it just silently uses the old env
<clever> ,libraries Ankhers
<clever> > :p mapAttrs (k: v: "${k} == ${v}") { a = "42"; }
<clever> Graypup_: mapAttrs takes a function of 2 args, key&val
<clever> > builtins.attrNames pkgs

2020-07-11

<clever> bbigras: but a simpler option might be to just try and cross-compile it, via pkgs.pkgsCross
<clever> bbigras: i cant remember the name of the flag, but there is one to just not put buildInputs into $PATH, and not link to nativeBuildInputs
<clever> yurb: fetchzip matches to `nix-prefetch-url --unpack`
<clever> txt_file: /build/ only exists in the sandbox the build is happening under
<clever> nabataeus: if any user calls nix-build directly, they will still use their own config.nix file
<clever> nabataeus: nixpkgs.config only affects what nixos-rebuild is building
<clever> evanjs: you can also do `nixpkgs.config = import ./config.nix;` in configuration.nix, to split the config out, and be able to reuse it
<clever> nabataeus: nixos-rebuild only obeys nixpkgs.config in configuration.nix, but nothing stops you from importing config.nix
<clever> nabataeus: nixpkgs.config = import /home/clever/.config/nixpkgs/config.nix;
<clever> nabataeus: nixos-rebuild ignores config.nix by default
<clever> raghavsood: so for root, its no longer the initial boot when you deploy things
<clever> raghavsood: i think the problem with initialHashedPassword and nixops, is that the machine boots once before you deploy
<clever> maralorn: not really, you would need to return a set that has both your pkg and the pkgs tree, or return an overlay and let something else assemble things
<clever> > buildEnv { name = "name"; paths = [ hello mpv ]; }
<clever> colemickens: buildEnv and symlinkJoin are derivations
<clever> > haskell.lib.dontCheck
<clever> and `nix-instantiate '<nixpkgs/nixos>' -A system` will give the new drv based on current cfg
<clever> chipb: `nix-store --query --deriver /run/current-system/` will give the drv for the currently running nixos
<clever> chipb: run `nix-diff` on the before and after .drv files
<clever> if you give nix-env -i a list or set, it will just install all of the things
<clever> then you have the fun of figuring out which result you wanted
<clever> colemickens: if you give nix-build a list or a set, it just barfs a ton of result-42 symlinks into the current dir
<clever> moet: also, its using fetchzip, which matches up to `nix-prefetch-url --unpack`
<clever> 195 in self.callCabal2nix pkg (pkgs.fetchzip {
<clever> ,tofu moet
<clever> colemickens: i tend to use buildEnv
<clever> but often, the defaults are fine
<clever> like callPackage ./foo.nix { withBar = true; }
<clever> the {} at the end, is for an args the default.nix accepts on line 1
<clever> moet: the standard {} that all callPackage things want
<clever> so i think that would be: callHackageDirect { pkg = "doctest"; ver = "0.17"; sha256 = "hash"; } {}
<clever> callHackageDirect = {pkg, ver, sha256}:
<clever> s/calt/cant/
<clever> you want to switch over to callHackageDirect, which needs a sha256 of the src
<clever> but it can be out of date, and then you calt callHackage
<clever> moet: nixpkgs has an all-cabal-hashes.tar file, that has every single .cabal file for every single version
<clever> yep
<clever> it uses an flock to determine if the thing is actually building or not, and those get released when the proc dies
<clever> nope
<clever> probably
<clever> moet: they are some of the first things deleted by a GC, so `nix-collect-garbage --max-freed 1` will delete most of them, and then 1 random piece of garbage
<clever> moet: those get created when a build starts, and an flock is held on it while building

2020-07-10

<clever> and you often put overrides into an overlay
<clever> an overlay can change how other packages see that package
<clever> an override is used to change the package in some way
<clever> so it also depends on the size of the store
<clever> it just reads every single file in /nix/store and hashes them
<clever> depends on disk io and cpu speed
<clever> --repair will auto repair anything found to be wrong
<clever> --verify alone, will just search for a whole dir thats missing
<clever> bqv: `nix-store --verify --check-contents` will scan for corruption
<clever> bqv: "unknown-deriver" can also happen if you simply garbage-collect
<clever> you can then switch over to `mkForce ''your config here'';` and put newlines in it
<clever> yeah, mkForce will clear the value made down here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/xserver.nix#L712
<clever> ah
<clever> virus_dave: nix-build '<nixpkgs>' -A foo`
<clever> KarlJoad: where is the problem then?
<clever> build wont change the symlink
<clever> that symlink only updates when you `nixos-rebuild switch`
<clever> what are the contents you got after doing build? how did you find the path to xserver.conf ?
<clever> it only builds them
<clever> `nixos-rebuild build` wont apply changes to the running system
<clever> KarlJoad: but, what else is this code doing? stuff that ignores the config key
<clever> KarlJoad: that mkForce causes the $config on line 141 to be an empty string