2019-04-20

<clever> `nix-shell '<nixpkgs>' -A linux` then `unpackPhase ; cd linux-4.19.33/`
<clever> similar commands have worked for me in the past
<clever> nh2: all i can think of is to google it
<clever> runtime deps are a subset of buildtime deps, based on what paths are in the $out
<clever> thats how build-time deps work in nix
<clever> when you put a string with context into a derivation, the derivation will depend on everything in the context
<clever> nh2: yeah, that should have worked...
<clever> nh2: i'm able to build a kernel under nix-shell
<clever> pie_: same :P
<clever> dycan: you can use `nixos-enter` to chroot into it, the man page for `journalctl` also says how to open the logs of another fs mounted at not /
<clever> you need either a rust specific override function, or to just modify the file and callPackage your new one
<clever> pie_: and overrideAttrs cant update the cargo cache or cargosha256
<clever> pie_: ah, buildRustPackage has to process the src, and create a cargo cache
<clever> why does it have 2 srcs?
<clever> pie_: next, try comparing the src of both, nix-build -A cntr.src on the old, then check your src in /nix/store/syppz54ksr35kjy62362jw5m1mv86cs7-source or /nix/store/0bph7415azz4asa9v4bsyj7jscrb8idb-cntr-1.2.0-vendor ...
<clever> pie_: what was src set to originally?
<clever> pie_: is the sha256 correct?
<clever> nice!
<clever> ah, ddellacosta already said that, lol
<clever> dycan: changes wont be saved, and it only takes effect for a single boot
<clever> dycan: when nixos is booting, you can just hit e on any option in the menu to edit it
<clever> dycan: what if you edit the cmdline in grub, and add `single` to the end of it? or `init=/bin/sh` ?
<clever> dang, tab-complete keeps messing up! lol
<clever> dycan: and then run (i think) nix-store --add-fixed sha256 ./gcc-5-base_5.4.0-7.really.6+steamrt1.1+srt2_amd64.deb
<clever> dycan: try finding a copy of gcc-5-base_5.4.0-7.really.6+steamrt1.1+srt2_amd64.deb on another mirror
<clever> dycan: have you tried booting an older generation at the grub menu?
<clever> oh, i was thinking of nixos-generate-config, not the kernel config
<clever> nh2: ive noticed purity problems with it before, if any mass-storage is plugged in, it bakes mass-storage support into the initrd
<clever> though now that i look at it, i feel the urge to rewrite half of it, lol
<clever> pie_: oh, i didnt even see that!
<clever> yeah, nix doesnt care about bash level comments
<clever> so nix-shell doesnt need -A
<clever> you can also have a shell.nix with `(import ./default.nix).foo`
<clever> it will re-eval it, but thats cheap
<clever> so you can just `nix-build -A toDebug` inside the shell
<clever> a second option, make your nix file return an attribute set
<clever> checking
<clever> yeah
<clever> buildInputs is still handled before parsing buildCommands
<clever> and then pkgs.runCommand "name" {buildInputs = [];} ''script here'' will just call mkDerivation and set buildCommand for you
<clever> pie_: you can also use buildCommand to replace all phases without setting phases=
<clever> then you can run it when you choose to
<clever> pie_: yeah, use an alias in shellHook, to put that command into the bash aliases
<clever> pie_: then why do ou want to run nix-build on it?
<clever> pie_: you could then make an alias of that using shellHook
<clever> (or fetch it from a cache)
<clever> pie_: if you run `nix-store -r ${hello.drvPath}` it will build hello
<clever> > hello.drvPath

2019-04-19

<clever> > ADT
<clever> wolfman154: possibly
<clever> in my case, i'm choosing to ignore the desktop-env stuff, and just forcibly taking over the session
<clever> if you dont have an exec in sessionCommands, then it will continue and run whatever you selected as your desktop-env
<clever> nh2: aha, thats weird!

2019-04-18

<clever> the tty should work without /dev/
<clever> nh2: ah, but you can now just make a haskell binary to do whatever you want, and maybe write logs to disk?
<clever> ah
<clever> nh2: what you up to?

2019-04-17

<clever> then it cant delete that path
<clever> and it will create a root-name symlink in the current directory (just like the result links)
<clever> if you know the exact storepath you want to keep, you can also `nix-store -r /nix/store/foo --add-root root-name --indirect`
<clever> without --max-freed, that chance is 0%, since it deletes everything
<clever> what it deletes is random, but it will have a chance of keeping things you want, based on how much garbage there is
<clever> rprije: other then that, you can use `nix-collect-garbage --max-freed 1g` to make it only delete 1g worth of garbage
<clever> rprije: if you have a nix-shell open when you GC, it wont be able to delete things
<clever> heading out for supper, later
<clever> some can of course be baked in, depending on what nixops maintainers like to maintain
<clever> nixops.withPlugins (ps: [ packet digitalocean ovh ] )
<clever> gchristensen: and i'm thinking the plugins should support existing outside of the nixops repo
<clever> infinisil: just have a backend of terraform:aws that you set in nixops
<clever> gchristensen: then packet.net, ovh, and DO, would provision hardware with apis, call the above plugin, (optionally reboot), and then deploy as normal
<clever> gchristensen: i also want modular plugins, for example, a plugin that takes root on a rescue shell and just installs nixos
<clever> infinisil: and then there could be a terraform wrapper/plugin, that just abuses terraform for provisioning, and then does the rest with nixops
<clever> infinisil: my idea, is to make nixops more plugin based, so you can add any backend or util you want

2019-04-16

<clever> and have plans to extend it further
<clever> i prefer nixops
<clever> gchristensen: oops!
<clever> pxc: or `phases=configurePhase genericBuild` which handles that detection logic for you
<clever> pxc: you need to eval $configurePhase (the env variable)
<clever> pxc: `configurePhase` in nix-shell runs the bash function, not the new definition
<clever> pxc: did you redefine configurePhase?
<clever> pie_: i know it tends to fail erase cycles if exposed to lots of xrays, lol
<clever> gchristensen: you could also just use nixops or a variant
<clever> gchristensen: that will create a dummy configuration.nix (based on some cfg) at bootup, so you can then nixos-rebuild
<clever> gchristensen: there is a copy-config thing somewhere
<clever> lovesegfault: its also a function, so add {} after the path, import (...) {};
<clever> lovesegfault: you just want hie-nix.whatever, and skip adding it to overlays
<clever> lovesegfault: so it wont work right when added to the overlays list
<clever> lovesegfault: the default.nix in hie-nix isnt an overlay
<clever> lovesegfault: can you also add the --show-trace output to the gist?
<clever> parsnip: if you resize the EBS volume in the aws console, and reboot the machine, nixos will resize the FS automatically
<clever> force repoducible builds on all!
<clever> carter: for repeat=1, that will be 2 builds total, nix will then diff the results, and fail the build if they dont match
<clever> carter: of note, you can set the `repeat` option in nix.conf (or --option repeat 1), and then nix will build it an extra N times
<clever> so you could have a machine with 128gig of ram and 2gig of disk, or a machine with 1gig of ram and 2tb of disk
<clever> parsnip: disk drive size isnt connected to instance type, you can just expand the disk to whatever you want
<clever> parsnip: looks like it ran out of disk space in http://ix.io/1Gpf, which is unrelated to the instance type
<clever> reading...
<clever> *looks more*
<clever> parsnip: and what error is it failing with?
<clever> :)
<clever> parsnip: what is failing to build?
<clever> it wont recurse
<clever> then a dumb nix-build only does a/b
<clever> carter: if you give it { a=package; b=package; c = { d = package; }; }
<clever> carter: also, thats likely why nix-build didnt build everything
<clever> carter: and i think you wanted just `nix repl .` the `.` is what tells it to load default.nix
<clever> carter: i think you want a.build, rather then a
<clever> carter: override is a function, so that cant be put into paths
<clever> carter: nix 2.0 has repl in the `nix` command
<clever> carter: run `nix repl .` and then try to eval a, b, and c?
<clever> carter: and what type does a/b/c return?, a derivation? a function?
<clever> carter: can you pastebin the whole nix file?
<clever> carter: your passing it a function somewhere
<clever> parsnip: yep, your out of inodes, `nix-collect-garbage --max-freed 1g`
<clever> parsnip: df -i /
<clever> `with` also has a slight performance cost, that explicit references wont have
<clever> set*
<clever> the one in the sec!
<clever> > :p let a = 1; in rec { a=2; b=3; c = a+b; }
<clever> which a will it use?
<clever> > let a = 1; in rec { a=2; b=3; c = a+b; }
<clever> so you can choose if you want it or not
<clever> rec just blindly puts every key into scope, but lib.fix makes all keys a part of the argument passed to you
<clever> > :p lib.fix (self: { a=1; b=2; c = self.a + self.b; })
<clever> > :p lib.fix (self: { a=1; b=2; c = self.a + self.b; }
<clever> carter: i like using lib.fix instead of rec{
<clever> carter: that would work, but then you cant build just a
<clever> carter: foo = buildEnv { name = "name"; paths = [ a b c ]; };
<clever> carter: you may want to use something like buildEnv to create a single derivation, that contains the result fo the rest
<clever> carter: thats what nix-build does by default, but only if the attribute contains a derivation
<clever> not directly
<clever> then you can just `nix-build -A a`
<clever> with import <nixpkgs> { a = callPackage ./a.nix {}; b = callPackage ./b.nix {}; }
<clever> carter: and default.nix should be doing callPackage on its own if it has several things
<clever> carter: space after -A
<clever> carter: if the default.nix contains an attrset, you want to select an attr with -A
<clever> ah
<clever> srhb: use nixops deploy --dry-run, to get the .drv for the build, and nix-store --query --deriver to get the .drv for a remote path
<clever> srhb: next would be nix-diff
<clever> infinisil: yeah, that could also work
<clever> -system76-19.09pre174426.acbdaa569f4
<clever> srhb: that should say what nixpkgs rev it was built from, if using a channel
<clever> srhb: first, check what git rev is pointed to by current-system
<clever> infinisil: and then the version depends on when you opened a shell
<clever> infinisil: when you do an update, NIX_PATH wont refresh until you restart the shells
<clever> so then everything will remain in sync
<clever> srhb: and then 12 makes NIX_PATH on those remote machines use it
<clever> srhb: line 16 copies whatever nixpkgs nixops is using (see above) to /run/current-system/nixpkgs on the deployed machines
<clever> srhb: and then always use that -I at every deploy
<clever> srhb: if you run `nixops modify -d name -I nixpkgs=URL deployment.nix`, it will pake that `-I` into your nixops state file
<clever> srhb: then nixops will use whatever <nixpkgs> maps to within NIX_PATH, when running nixops deploy
<clever> srhb: does `nixops info` show a nixpkgs=?
<clever> jakub: https://github.com/cleverca22/thermostat_firmware/blob/master/default.nix is enough to build my AVR firmware

2019-04-15

<clever> growpotkin: but, nixops also has things like an ec2 backend, which will auto-create machines in aws, and then do everything
<clever> growpotkin: this is all using the "none" backend for nixops, which requires an existing nixos machine, with root ssh
<clever> hydra is then configured to build that against nixos-unstable
<clever> i also have a release.nix, that builds both machines from a single attrset
<clever> you could also omit that line for the localhost deploment, so nix-channel continues to work
<clever> and then when you drop -I nixpkgs, it will stick, and remain on that rev until you -I nixpkgs= again
<clever> but, nixops-managed, will make the path to that "temporary" nixpkgs, into your NIX_PATH (if you deploy to yourself)
<clever> so that will temporarily override what <nixpkgs> is during the deploy
<clever> and then you could for example: nixops deploy -d house -I nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable.tar.gz
<clever> that also changes what <nixpkgs> is on the remote machines, to match the <nixpkgs> that was used at the time nixops deploy was ran
<clever> this will intentionally break nixos-rebuild, so you dont
<clever> so if you edit that and nixos-rebuild, it undoes whatever nixops did
<clever> and it wont update the remote configuration.nix
<clever> so you have to gather the 3 versions of those, and put them all in 1 spot
<clever> note, that it entirely ignores the remote configuration.nix and hardware-configuration.nix
<clever> deploy will build all the machines locally, and then nix-copy-closure things to the remote boxes
<clever> and then `nixops deploy -d house` to update all of them at once
<clever> growpotkin: you then run `nixops create -d house deployments/house.nix` to create the record in nixops
<clever> growpotkin: this defines that my network has 2 machines, called nas and router, which have the nixos config after the = on those lines
<clever> growpotkin: then it will use whatever <nixpkgs> maps to on the machine where nixops is ran
<clever> growpotkin: you could use nixops to deploy all 3 machines at once
<clever> which left me unable to nixos-rebuild at all
<clever> ive had to rollback my router before, because the new rev failed to build
<clever> i dont think any other distro makes it so simple to un-update the system
<clever> so you know when it updates, and you can un-update
<clever> growpotkin: using nix-channel, will give you `nix-channel --rollback`, so you can undo --update
<clever> growpotkin: so it will random update with zero warning
<clever> growpotkin: note, that setting nixpkgs=url, will cause nix to re-download the url every hour or so

2019-04-14

<clever> jophish: that forces nixpkgs to ignore your config.nix and overlays, making it more pure
<clever> and maybe --arg overlays '[]'
<clever> jophish: --arg config {}
<clever> jophish: oh, another thing that can help here
<clever> lol
<clever> kk
<clever> jophish: you can also run `nix show-derivation` on a .drv to pretty-print it
<clever> jophish: so only running on a real arm differs for you?
<clever> --argstr and --option both given identical derivations for me, /nix/store/4v3ily2b08d5lj5qakdxdzmcg307z6xc-cmake-3.13.4.drv
<clever> i ran fetch, not checkout, lol
<clever> wait
<clever> nixpkgs-channels is a subset of nixpkgs
<clever> jophish: is it from a fork?
<clever> [clever@system76:~/nixpkgs]$ git fetch acbdaa569f4ee387386ebe1b9e60b9f95b4ab21b
<clever> fatal: 'acbdaa569f4ee387386ebe1b9e60b9f95b4ab21b' does not appear to be a git repository
<clever> jophish: --arg can supply foo, bar, and baz
<clever> { foo }: { a = { bar }: { b = { baz }: "${foo}${bar}${baz}"; }; };
<clever> note, that --arg will call functions at many levels
<clever> what rev of nixpkgs does this happen on?
<clever> `--argstr system` will just execute functions with { system = "x"; }
<clever> `--option system` will mutate `builtins.currentSystem` which fully convinces nix you are X
<clever> jophish: what about `--option system armv7-linux` on an x86 machine?
<clever> jophish: where is openssh appearing then, when it does appear?
<clever> is openssh in the inputs in the drv?
<clever> jophish: are you using nix-diff to compare them?

2019-04-13

<clever> brb
<clever> then either the config telling it where to log isnt set, or the package is broken
<clever> laalf: what does ls -lhd say about data?
<clever> linarcx: data doesnt even exist, its trying to create logs in the immutable store
<clever> ls: cannot access '/nix/store/qmf09w1k84073yxm0k57d7nhncvgav87-nextcloud-15.0.6/data/': No such file or directory
<clever> laalf: is data a symlink?
<clever> growpotkin: and my memory is just wonky, ive memorized most of nixpkgs, lol
<clever> growpotkin: i dont contribute much to nixpkgs, but i do use nix heavily at work, and do a lot of crazy things with it
<clever> and `complete` (at least under bash) shows what function to run for each cmd
<clever> growpotkin: i think if you run `set`, you can see the functions involved in that

2019-04-11

<clever> WARNING #2: Do not use /dev/disk/by-uuid/… or /dev/disk/by-label/… as your swap device when using randomEncryption as the UUIDs and labels will get erased on every boot when the partition is encrypted. Best to use /dev/disk/by-partuuid/…
<clever> AlexRice[m]: windows may overwrite files in there

2019-04-10

<clever> and i prefer grub over systemd-boot
<clever> grub works pretty much the same way
<clever> that one should support merging
<clever> qubasa: try systemd.services.<name>.environment instead
<clever> qubasa: some options cant be merged
<clever> qubasa: nixos will merge things
<clever> fresheyeball: when you copy things from /nix/store, the directories are read-only
<clever> fresheyeball: cp --no-preserve=mode,ownership
<clever> fresheyeball: one sec
<clever> ,locate gst-play
<clever> AlexRice[m]: weird
<clever> chrisaw: it appears to be tied to the pluginSupport flag, which is true by default
<clever> AlexRice[m]: it could be that the usb stick is damaged or just loose
<clever> AlexRice[m]: usb device?
<clever> not by default, and i havent looked into that
<clever> opened the lid, and it instantly woke up, like nothing happened!
<clever> and it put itself to sleep, lol
<clever> i was using a voice chat on the laptop, while servicing the desktop, and the lcd panel got in the way, so i just closed the lid
<clever> suspend still works fine though, as i discovered by accident!
<clever> emilsp: i dont think hibernation works with zfs
<clever> emilsp: nixos will now reuse the password if both devices share the same one
<clever> emilsp: just put the swap on its own luks partition
<clever> emilsp: the lvm i used is no longer needed, that was just to support encrypted swap
<clever> emilsp: yep
<clever> emilsp: my laptop has zfs on lvm on luks
<clever> _Geeko_: looks like share/icons, what happens if you drop them into /etc/nixos/foo/share/icons and nixos-rebuild?
<clever> _Geeko_: what path would the icons normally be installed to?
<clever> _Geeko_: could probably just add them to the same directory
<clever> it must be let ... in { ... }
<clever> let ... in {...} {...} is invalid
<clever> _Geeko_: after the in, you have 2 sets, that should be 1 set
<clever> _Geeko_: can you pastebin your whole configuration.nix?
<clever> my example had it near the very top
<clever> _Geeko_: why is it on line 50?
<clever> _Geeko_: ahh, systemPackages has gotten more strict, one min
<clever> _Geeko_: looks right to me, what error does it give?
<clever> _Geeko_: can you pastebin that file and any erorrs its giving?
<clever> _Geeko_: just make a directory like /etc/nixos/foo/share/themes, drop some themes into it, and then add ./foo to your systemPackages in configuration.nix
<clever> which could be as simple as environment.systemPackages = [ ./foo ];, and then create a foo/share/themes
<clever> _Geeko_: packages containing themes have to be added to environment.systemPackages
<clever> _Geeko_: you must configure that in configuration.nix
<clever> _Geeko_: /run/current-system/sw/share/themes/
<clever> you can also do { pkgs, lib }: without the ..., to see what other arguments are available to you
<clever> but { pkgs, lib, ... }: allows the lib to be isolated from pkgs
<clever> it may need lib to compute pkgs.lib, and then infinite recursion
<clever> the difference comes into play if you start using lib to mutate pkgs in drastic ways
<clever> oh, but i'm basing that on nixos, home-manager may do it differently
<clever> so it wont directly depend on the pkgs
<clever> i think { lib, ... }: gets it by directly importing lib/default.nix
<clever> wolfman154: i prefer { config, pkgs, lib, ... }:
<clever> ninjin: then its likely not using a network namespace
<clever> ninjin: what does `ifconfig -a` show inside the container?
<clever> averell: the problem is likely that your desktop manager (xmonad) is not sourcing /etc/profile on startup
<clever> averell: the tmux var should wind up in a set-environment file, which is referenced by /etc/profile
<clever> averell: one min...
<clever> averell: did you set programs.zsh.enable?
<clever> averell: which shell are you using?
<clever> averell: how are you logging in when it isnt set?
<clever> averell: that should eval XDG_RUNTIME_DIR at runtime i think
<clever> _Geeko_: why do you think its not building the nvidia drivers?
<clever> _Geeko_: what error is it giving?
<clever> _Geeko_: what is not working?
<clever> infinisil: :O, i could see that helping performance in some cases
<clever> This feature enables the use of the Edon-R hash algorithm for checksum, including for nopwrite (if compression is also enabled, an overwrite of a block whose checksum matches the data being writ‐
<clever> infinisil: if the previous one fails to unlock the device, it will just prompt again
<clever> also, the reason i even wanted stable encryption on the swap was hibernate, but zfs doesnt support that, so: swapDevices.*.randomEncryption
<clever> infinisil: but, the nixos initrd can now reuse the same luks passphrase on multiple devices, so thats not required