2020-05-23

<clever> numkem: i would just put it all in configuration.nix
<clever> cole-h: somewhat, but each key just overwrites the other
<clever> numkem: .config/nix/nix.conf
<clever> numkem: is there another nix.conf in $HOME ?
<clever> craftyguy: thats where you want ${builtins.placeholder "out"}
<clever> numkem: do you have duplicate trusted-public lines in nix.conf ?
<clever> numkem: you must use nix.binaryCachePublicKeys for it to merge right
<clever> numkem: extraOptions wont merge duplicates correctly, look at the resulting /etc/nix/nix.conf
<clever> mac10688: it will source ~/.xprofile if it exists, and then exec ~/.xession if it exists (which blocks the remaining normal logic)
<clever> mac10688: one minute
<clever> numkem: sounds like you forgot to nixos-rebuild switch?
<clever> numkem: what about `curl http://172.31.99.3:5000/c4iqxx69kv5ln5b9jw84fmg710f6cwy1.narinfo | grep Sig` ?
<clever> numkem: yep, all of those look valid at a glance
<clever> yeah
<clever> numkem: can you paste the exact line from nix.conf, that has all of the public keys?
<clever> that would have put things at /usr/local/etc/ on another distro
<clever> craftyguy: it usually happens via the same --prefix=$out logic
<clever> craftyguy: that often happens automatically, because the sysconfdir you passed to it, gets baked into the code
<clever> craftyguy: for defaults, you usually patch it to read from $out/etc/, the same place it installed to
<clever> craftyguy: for config stuff, you usually run the program with `--config-file /path/to/config`
<clever> numkem: probably as the hydra user
<clever> numkem: `nix-store --generate-binary-cache-key` was just ran directly on hydra, that is the output path it was given
<clever> craftyguy: for things to get into /etc/, it must be done from a nixos module like configuration.nix
<clever> craftyguy: nix-env can only ever modify ~/.nix-profile/
<clever> numkem: also, hydra has its own nix-serve built in, on the same port as the UI, you dont need nix-serve running seperately
<clever> numkem: that implies that you got the public key wrong, any change you used the name hydra for 2 different keys?
<clever> numkem: what is the exact error your getting?
<clever> numkem: the command that generated the secret should also have made a public at the same time
<clever> numkem: yeah, so your pubkey in nix.conf has to be in the form of hydra:<base64>
<clever> numkem: if you curl the narinfo like in the example above, what does the signature say?
<clever> numkem: so you need to setup nix.conf on that local machine first, to be able to pull everything from hydra
<clever> numkem: yeah, the nixops machine will want the full closure on itself before it tries to deploy
<clever> ldlework: yeah, thats not really possible with current nix
<clever> numkem: ah, i would expect the hydra machine to already have the paths in question?
<clever> numkem: i think you want to adjust deployment.hasFastConnection
<clever> numkem: is the remote machine using any caches at all?
<clever> numkem: oops, wait, mixed you up with ldlework , lol
<clever> numkem: substituteAll just takes a set of anything, and will replace each @foo@ with the foo from that set
<clever> numkem: but its using the old nix.conf, from before the deploy
<clever> numkem: then based on the has fast network thing, it may allow the remote machine to use its own nix.conf to download things from caches
<clever> numkem: first, it uses the local nix.conf, to build/fetch the entire closure of things
<clever> s
<clever> numkem: nixops will respect both the local and remote nix.conf as it deploy
<clever> ldlework: there is also substututeAll and pkgs.substituteAll
<clever> ldlework: this example overrides the __mul function, causing `1 * 2` to return boo
<clever> ldlework: its like import, but it can temporarily mutate the globals for the imported thing
<clever> ldlework: builtins.scopedImport
<clever> numkem: the name comes from when you ran nix-store --generate-something
<clever> numkem: so the public key must begin with cache.nixos.org-1:
<clever> Sig: cache.nixos.org-1:+ukfbj7lDJgRkA9rYoujpAw484EYsfpCqoy2sB+rWeFMmgPaIYmPAqpUbCYvihqOwTXv6MuXXLtdNVZZpUntAA==
<clever> > "${hello}"
<clever> numkem: there will be a signature in there, along with a name
<clever> numkem: try downloading http://cache.example.com/hash.narinfo, for /nix/store/hash-name
<clever> numkem: the name in the key, must match the name in the signatures
<clever> numkem: the port isnt part of the key
<clever> numkem: and yeah
<clever> numkem: the -1 is part of the name
<clever> might that work?
<clever> energizer: nix-env --profile /nix/var/nix/profiles/system --rollback 42
<clever> the difference only crops up if youve already had several failures and keep doing rollbacks
<clever> energizer: rollback goes to current-1, not previous, so if you are on generation 10, switch to 12, then rollback, you wind up on 11
<clever> energizer: also, if you switch1, rollback, switch2, rollback, it goes to switch1, not what it was before switch2
<clever> energizer: also, if you run rollback twice, but only made 1 generation, it can go back too far
<clever> energizer: test may not create a generation, so rollback might go back further then you meant
<clever> Henson: but rollback can revert it back to the previous state as well
<clever> --rollback can have unpredictable affects sometimes when ran repeatedly
<clever> Henson: you can also just resolve the /run/current-system symlink before you test, then run $THATLINK/bin/switch-to-configuration test, to switch back to whatever it was before
<clever> numkem: you need to lookup that default key, and add it back yourself
<clever> numkem: the cache.nixos.org key is in the default list, so you loose it upon setting any extra keys
<clever> and just exclude the other things
<clever> Henson: you can just give nix copy the path to the start of that 750mb closure
<clever> Henson: that gets complex real fast because you dont know what paths the machine is lacking, and what paths may be on the cache
<clever> Henson: it will always copy every dependency
<clever> Henson: both of those will create a directory containing a closure, which you can then --from on the other end
<clever> Henson: then you want `nix copy --to local?root=/mnt/` or `nix copy --to file:///mnt/`
<clever> Henson: you usually want to just use `nix copy` or `nix-copy-closure`, rather then import/export
<clever> cole-h: yeah
<clever> cole-h: binaryCaches is the list of default caches, which are trusted automatically
<clever> cole-h: trustedBinaryCaches lets a user opt-in by using `--option substituters` without that user being trusted
<clever> numkem: then you simply never added the hydra to nix.conf
<clever> numkem: and does `nix show-config | grep substituters` show the hydra?
<clever> numkem: and what is the actual path?
<clever> numkem: thats a different error, about you having colliding channel names between your user and root
<clever> numkem: and which path are you trying to build?
<clever> numkem: what is the error it gives in repl?
<clever> numkem: which path is giving the error?
<clever> putting it somewhere you cant override, makes it a bit more obvious, you cant override it
<clever> cole-h: mostly, and for the confusion when people try to override version= and rec doesnt listen
<clever> error: Package ‘HTF-0.14.0.3’ in /home/clever/apps/nixpkgs-older/pkgs/development/haskell-modules/hackage-packages.nix:9295 is marked as broken, refusing to evaluate.
<clever> Miyu-saki: yeah
<clever> Miyu-saki: boot.kernelPatches is a list of sets, each one containing a name and patch, you can check the pkgs.kernelPatches for examples
<clever> Miyu-saki: youll probably want to use the kernel patches system...
<clever> Miyu-saki: intree or out-of-tree?
<clever> andreoss: you can forcibly install it with nix-env, but a lot of the install stuff assumes certain kernel features you may not have
<clever> numkem: `nix show-config | grep narinfo` you can adjust these options with --option
<clever> numkem: if nix cant find something in a binary cache (hydra/nix-serve), it wont bother checking again for an hour
<clever> ldlework: nix-store --query --roots and nix why-depends

2020-05-22

<clever> emily: this attr is also a plain string, and can force similar behavoir
<clever> > pkgs.hello.drvPath
<clever> das_j: i would just use nix-instantiate
<clever> das_j: but if you point nix eval at a drv, it will print every key/value pair within it and follow sets recursively
<clever> das_j: if you point nix-build at a drv, it will build the drv
<clever> 2020-05-22 16:15:22 < bqv> which will fail because function -> json is bogus
<clever> 2020-05-22 16:15:15 < bqv> e.g. take `toJSON (x: 1)`
<clever> but it can only catch certain things
<clever> bqv: builtins.tryEval
<clever> anderson_: there is probably an INSTALL statement in one of the cmake files, that says what permissions to use
<clever> anderson_: yeah
<clever> anderson_: simplest thing is to just patch it out of the install/build scripts
<clever> jakobrs: so you would need to hack together a wierd cross-compile like setup, where you run the 64bit lkl with 32bit inputs
<clever> jakobrs: ah, something with lkl doesnt support 32bit for osme reason
<clever> > lkl.meta.position
<clever> or modify the meta.platforms in lkl
<clever> yeah, you can try that to force it
<clever> oh, its probably using lkl to generate disk images without using qemu
<clever> > pkgs.lkl.meta.description
<clever> > pkgs.lkl.meta.platforms
<clever> things that are included inside the ova, dont have 32bit labeled as supported
<clever> ah
<clever> how does it fail now?
<clever> you can also use `--arg supportedSystems '[ "..." ]'` to modify that arg
<clever> so you have to add i686 to line 5 as well
<clever> jakobrs: its filtering this second list down further
<clever> 5 , supportedSystems ? [ "x86_64-linux" "aarch64-linux" ]
<clever> jakobrs: and forMatchingSystems will filter one list by another list, then run a func
<clever> 189 ova = forMatchingSystems [ "x86_64-linux" ] (system:
<clever> tab-completion only shows one by default
<clever> nix-repl> ova.x86_64-linux
<clever> [clever@amd-nixos:~/apps/nixos-configs]$ nix repl '<nixpkgs/nixos/release.nix>'
<clever> jakobrs: should be a simple matter
<clever> cybertron: you need to wrap line 3 with a { and }
<clever> cybertron: can you pastebin the whole influxdb.nix?
<clever> Henson: what is the contents of sshd_config on the remote machine?
<clever> Henson: are you able to `ssh root@ip` with that agent?
<clever> Henson: you need to add the module to the imports of each container
<clever> Henson: it works the same way outside nixops, the containers are an isolated nixos instance, with their own module set
<clever> Henson: how did it get upset? what error did it give?
<clever> including define declarative containers
<clever> Henson: each value there, is basically the full contents of a configuration.nix, and can do anything configuration.nix could have done
<clever> Henson: the nixops { key = value; } file, is a set of nixos configs
<clever> Henson: ah, that version is using multiple systemd services, rather then multiple containers
<clever> Henson: i tend to just use normal declarative containers in the nixos config for the host, and let nixops only deal with the host
<clever> Henson: after nixops deploys, it will whitelist its own key, and not need the agent anymore
<clever> Henson: simplest is to add a secondary keypair, with agent and manual editing, to let nixops deploy once
<clever> Henson: you may need to edit /root/.ssh/authorized_keys first, to ensure you can get in
<clever> Henson: ensure the agent is running, and ssh-add a key to it
<clever> Henson: you want the ssh agent running, and a key in the agent that can access the machine
<clever> Henson: that will make it worse!
<clever> Henson: did you start an ssh agent?
<clever> Henson: nixops can use any keys in ssh-agent
<clever> betawaffle: if the result ever changes, the hash changes, and you just get a new drv
<clever> betawaffle: its not really impure, because the results are what get hashed to make the drv
<clever> betawaffle: use a let block and dont pass it to mkDerivation
<clever> for runCommand, yeah, i agree
<clever> betawaffle: for example?
<clever> betawaffle: if you lack a src, its common to use pkgs.runCommand
<clever> angerman: yeah, it prints that its restarting to stderr i believe
<clever> angerman: ive been thinking of adding some profling like that to hydra itself
<clever> so the heap usage can be wiped clean at regular intervals
<clever> angerman: every time the heap usage (as tracked by the GC library) goes over a set limit, the child proc will exit, and the parent will fork out a replacement
<clever> angerman: and now we can browse the exact src you have running
<clever> angerman: the UI shows "Hydra 0.1.1234.fdd58d (using nix-2.4pre7250_94c93437)" at the bottom of https://hydra.iohk.io/
<clever> angerman: nix show-derivation /nix/store/lmncqxk33z965nmy6pf3hs0avcky6445-hydra-2019-08-30.drv | grep source
<clever> angerman: what does `nix-store -q --deriver /nix/store/z9zbc4w8ln20m89ixnz19k5h0jk0sx84-hydra-2019-08-30` say?
<clever> angerman: hmmm, not seeing that version on any attr for current nixos-20.03
<clever> angerman: which attr from nixos-20.03, pkgs.hydra doesnt exist and i see ~4 versions...
<clever> angerman: which git revision of hydra is it?

2020-05-21

<clever> eyJhb: you could also just `systemctl stop firewall` to turn the whole thing off
<clever> eyJhb: thats where tmate can help, it doesnt need any firewall changes
<clever> eyJhb: tmate is another simple option, it also doesnt need port forwarding
<clever> evanjs: how does it "not work" ?
<clever> evanjs: nixos-install is just a wrapper to combine chroot and nixos-rebuild
<clever> evanjs: you want nixos-rebuild boot, with --install-bootloader
<clever> evanjs: nixos-install wont work with a root of /
<clever> freeman42x[m]1: after you get stuck at the black screen, it switches you back to tty1
<clever> freeman42x[m]1: grub rollbacks?
<clever> freeman42x[m]1: ctrl+alt+f1 ?
<clever> evanjs: nixos-enter --root /elsewhere
<clever> evanjs: ah, just nixos-install --install-bootloader boot, under nixos-enter
<clever> evanjs: ?
<clever> hpfr[m]: then you can just `lib = pkgs.lib` and use that
<clever> hpfr[m]: does `pkgs.lib` exist?
<clever> hpfr[m]: try `config.<tab>`
<clever> hpfr[m]: nix repl '<nixpkgs/nixos>'
<clever> yes
<clever> CMCDragonkai: the name in the cabal file
<clever> CMCDragonkai: pkgs.haskell.lib
<clever> CMCDragonkai: you could run haskell.lib.dontCheck over it
<clever> CMCDragonkai: the testcases are failing
<clever> ,pastebin CMCDragonkai
<clever> thats just normal IFD
<clever> thats not nix inside nix
<clever> CMCDragonkai: it calls cabal2nix for you, then runs callPackage on the result
<clever> CMCDragonkai: try using self.callCabal2nix "name" (fetchGit ..) {};
<clever> angerman: i also recently discovered the server that responds to those cmds, so i know some more of the internal ones
<clever> angerman: that
<clever> > raspberrypi-tools
<clever> angerman: one sec
<clever> hpfr[m]: thats how you get what will be the new version, after any updates are done applying
<clever> nix-repl> config.boot.kernelPackages.kernel.version
<clever> "4.19.84"
<clever> [root@amd-nixos:~]# nix repl '<nixpkgs/nixos>'
<clever> jonreeve[m]: those are just the debian ghc with patchelf ran over it, so they arent entirely "pure"
<clever> jonreeve[m]: not sure, maybe ghcWithPackages doesnt really work on the Binary based ghc's
<clever> jonreeve[m]: can you pastebin the whole output?
<clever> hpfr[m]: and if you check /etc/systemd/system/surface-sleep.service, does it have a PATH?
<clever> jonreeve[m]: why are you using ghc865Binary?
<clever> jonreeve[m]: why are you trying to delete something from there?
<clever> hpfr[m]: can you pastebin your code?
<clever> hpfr[m]: ah, path = [ pkgs.kmod ]; should just work
<clever> hpfr[m]: boot.kernelModules = [ "mod1" ]; is the recomended way to load a module

2020-05-20

<clever> systemctl restart container@name
<clever> nope, it doesnt for some weird reason
<clever> T0pH4t: you need to restart the container manually
<clever> T0pH4t: ah, containers dont restart when you nixos-rebuild
<clever> T0pH4t: and did you add your module to module-list.nix ?
<clever> T0pH4t: how did you define the user?
<clever> T0pH4t: is the module actually being loaded?
<clever> so both modules and configuration.nix can create users
<clever> T0pH4t: configuration.nix is a nixos module!
<clever> instead adding Wants= to the other thing
<clever> hpfr[m]: i think it uses overrides.conf to add it to the thing your wantedby
<clever> > pkgs.notfound or "fallback"
<clever> typetetris: DynamicUser ?
<clever> typetetris: which you use, depends on how many lines youll need to run
<clever> typetetris: ExecStartPre accepts only one line, which must start with an absolute path to a program
<clever> typetetris: .preStart will generate a script with #! for you, and accepts multiple lines
<clever> and you have 1mb of unallocated space, that is perfect for that
<clever> the grub.device only works once you make a bios boot partition
<clever> freeman42x[m]1: just allocate it, to bios boot partition
<clever> freeman42x[m]1: just after that 8gig swap, is 1mb of unallocated
<clever> then it will work for both at once
<clever> freeman42x[m]1: you could also just turn the 1mb at the end into a bios boot partition
<clever> you just need to both set grub.device and enable efi, and ensure you have both a bios boot partition, and an ESP at /boot
<clever> you can also configure it for both bios and efi
<clever> freeman42x[m]1: if grub supports whatever is on / then you can just do without the /boot partition, and you can just keep the /
<clever> freeman42x[m]1: just make a bios boot partition (its a special type), 1mb, not formatted, not mounted, then set boot.loader.grub.device = "/dev/sdX";
<clever> freeman42x[m]1: if you want BIOS booting on gpt, its pretty simple

2020-05-19

<clever> tarelerulz2: yes
<clever> tarelerulz2: it must be { config here }, not { config } here }
<clever> tarelerulz2: the } must be at the end of the file
<clever> numkem: you can cancel all jobs in an eval
<clever> numkem: hmmm, yeah, the button is missing for me too, the closest you can do is disable and hide
<clever> numkem: and if you hit edit?
<clever> numkem: there should be a delete button, in the jobset's actions
<clever> numkem: is it a declarative project or a normal project?
<clever> tarelerulz2: after the first set of boot config, you have a } that breaks everything, then more boot config
<clever> tarelerulz2: every { must be matched to another }
<clever> tarelerulz2: you have an extra } that marks the end of the file, in the middle of the file
<clever> tarelerulz2: can you pastebin the new config file?
<clever> pingiun: when you import <nixpkgs-unstable> {}, you can change it to { config.allowUnfree = true; }
<clever> tarelerulz2: and you only need to set grub.device if you want to boot without EFI, set it to "nodev" to disable legacy setup
<clever> tarelerulz2: also, you need to disable systemd-boot on line 17
<clever> tarelerulz2: lines 6-9 need to be moved, they must be between the { on 10 and the } on 102
<clever> tarelerulz2: that is not the contents of the file
<clever> tarelerulz2: can you pastebin the contents of the file?
<clever> tarelerulz2: thats the whole point of os prober
<clever> tarelerulz2: if you want it enabled, then you need to add it to the file
<clever> tarelerulz2: yep
<clever> not sure whats up then
<clever> alj[m]: has this machine ever built something from source before?
<clever> but reverting to a checkpoint will undo everything on the entire pool
<clever> pistache_: basically, a checkpoint is just a pool-wide snapshot, there can only be one, and it can even undo zpool feature upgrades
<clever> pistache_: there is also the new checkpointing feature, which might be able to undo such a thing
<clever> pistache_: ah, i'll read those tickets for more info
<clever> alj[m]: so you need to build gcc just to get the ability to build anything
<clever> alj[m]: i think the problem, is that the gcc used to build everything may not be in the cache?
<clever> alj[m]: on the arm
<clever> pistache_: ah
<clever> alj[m]: if you take the 2 drv's you gave to nix-diff, and run `nix-build --dry-run` on each, what is the results?
<clever> pistache_: i have however had problems deleting a file while full, because deleting a file modifies the dir, but `echo -n > file` truncates without updating the dir
<clever> pistache_: i dont think ive ever had problems deleting a snapshot while full
<clever> pistache_: how did it break the pool? ive been creating snapshots like mad, with the auto-snapshot flag
<clever> then the only tricky part is moving your /boot fs over, which depends on how your booting
<clever> that whole thing can be done online, while your using the machine (at the obvious cost of IO load)
<clever> when its done, you can just tell it to tear the mirror apart, and run pure from the new disk
<clever> zfs will happily copy all of your data over to the new disk
<clever> basically, just convert a single-disk array, into a "broken" mirror between the old&new disk
<clever> with the magic of zfs, i can change the entire hard-disk out without even a reboot (assuming the new disk is already in the box)
<clever> ~5 years, and ive not had to reinstall, even when changing the hard-drive out (repeatedly)
<clever> nixos has an undo button
<clever> tareluerlz2: remember that time apt-get dist-upgrade broke everything and you spent days fixing it?
<clever> alj[m]: yeah, i would expect that to have very very minimal changes
<clever> alj[m]: ah, i didnt see the link
<clever> alj[m]: can you post a screenshot of the nix-diff output?
<clever> alj[m]: and it built without any changes?
<clever> alj[m]: if you undo the change and nixos-rebuild, what happens?
<clever> alj[m]: it will only be copying tiny .drv files and any paths from foo = ./.;
<clever> then you can use x86 nix-diff
<clever> alj[m]: use nix-copy-closure to copy both drv files to an x86 machine