2017-11-27

<clever> ertes-w: there is a new skype4linux in nixpkgs already
<clever> ottidmes: you usually want to append to sourceRoot in the right hook
<clever> ottidmes: sourceRoot must include the name of whatever it made
<clever> fearlessKim[m]: do you even need fetchgitlocal?, could you just use that directory directly?
<clever> fearlessKim[m]: and the job runs as nixbld1, so it just lacks permission to read the files
<clever> fearlessKim[m]: this forcibly stops nix from importing things as your current user, and just passes the string directly to the builder
<clever> yeah, that doesnt sound right at all
<clever> samueldr: is the qemu-user in the sandbox?

2017-11-26

<clever> sphalerite: maybe over sshfs it can work
<clever> sphalerite: ddrescue stores a log of things its done, and can resume
<clever> samueldr: i prefer ddrescue for things like that, but it still needs an FS
<clever> samueldr: nice
<clever> then you might want a small util that pre-fetches everything and gets the hashes, then inputs those into nix
<clever> pcarrier: do you know what the https url is before the build begins?
<clever> what is the network doing to transform it?
<clever> pcarrier: at eval time, nix will hash that input, and if the input changes, it will trigger a rebuild
<clever> pcarrier: foo = ./path/to/thing;
<clever> ive never used that flag
<clever> pcarrier: thats not a fixed-output derivation, so nix wont setup networking
<clever> pcarrier: can you gist your nix expression?
<clever> pcarrier: are you defining an output hash and a output hash algo?
<clever> nix supports S3 as a store
<clever> most distro's dont make it so simple
<clever> the cool part is just being able to configure all of that with a single file
<clever> pcarrier: so you can plug a machine into the laptop's ethernet port, and get both internet and netboot
<clever> pcarrier: it shares the internet access of the wifi to the wired users
<clever> complete with NAT so a laptop could serve netboot over ethernet, and share its wifi
<clever> pcarrier: a full PXE netboot server in a nixos module
<clever> i usually make it 512mb or 1gig
<clever> yeah, but then it will cost 300mb of /boot for every generation
<clever> yeah, grub has some trouble reading zfs
<clever> so if there is some fatal kernel problem in the linux nixpkgs provides, both die
<clever> the only potential problem i can see, is that the rescue env is always rebuild from the same nixpkgs as the host
<clever> so as long as /boot survives, you can boot a full nixos up
<clever> pcarrier: if you add this to your imports, it will put a ~300mb live environment into /boot, and in the grub menu
<clever> pcarrier: or my rescue boot config
<clever> but i always turn snapshotting off there, because then garbage collect doesnt work
<clever> ah, snapshots on /nix would preserve nix.db, and keep it in-sync with the rest of the store
<clever> 2nd worst would be a corrupt bootloader config
<clever> the version of nix you build something with shouldnt impact its hash
<clever> petersjt014[m]: what exactly do you want to do?
<clever> also, it needs a different command if you want to view the configuration.nix of a different install
<clever> nix-env -iA nixos.nix-repl
<clever> petersjt014[m]: nix-repl '<nixpkgs/nixos>' and then try to eval config i believe
<clever> but the nix sandbox fixes it
<clever> turns out the new glibc doesnt agree with the nssswitch.conf of rasbbian
<clever> i recently fixed my armv8 build slave
<clever> dhess: have you seen the 96 core arm servers packet.net has?
<clever> zero firewall
<clever> so the wan port is essentialy just a 5th lan port, until the OS boots
<clever> there is only one critical flaw with the one i got, the switch IC defaults into all ports linked mode
<clever> i was planning on using it as a router
<clever> i had gone with the bpi1 because it includes a 5 port gigabit switch
<clever> samueldr: but my PSU strugles to keep it stable, and it has yet to get into a linux kernel
<clever> samueldr: ive used the nixpkgs u-boot on the banana pi r1

2017-11-25

<clever> i dont think so
<clever> changing the permissions on $HOME with chmod so that updatedb can read it
<clever> so it can only find files outside of home
<clever> its also possible that permissions wont let updatedb read in /home
<clever> jmc_fr: check "ps aux | grep update" and see if its still running
<clever> jmc_fr: it takes time to build the db
<clever> ah, its called update-locatedb.service
<clever> it helps if update is spelled correctly
<clever> yeah
<clever> jmc_fr: you can also "systemctl start updatedb.service" to force it to run
<clever> jmc_fr: the service will run update every day at 2:15 am i believe
<clever> manveru: also, some types support merge (lines and such), and others dont (bool, int)
<clever> manveru: id prefer to have full AST rather then just strings, because the user may have if statements in the configuration.nix
<clever> benley: and XAUTHORITY is always in $HOME
<clever> benley: nixos only supports one display at :0, so you can just assume its value is always :0
<clever> infinisil: i think part of what lets it work in nix, is that the module system can know the keys, without knowing the values, and that lets it route the request to the right module
<clever> havent looked into that function yet
<clever> infinisil: i dont think you can give a function its own return value as an argument
<clever> so they get their own return value as an argument
<clever> infinisil: basically, nix will iterate over every module (reading the imports in each), and then merge the .config and .options of each, then pass that config and options as an argument to every module
<clever> infinisil: lazy evaluation allows for some really wonky things that id never get in another language
<clever> gchristensen: a bigger problem is if the imports value depends on other config
<clever> gchristensen: pkgs doesnt depend on systemPackages, so it should be safe
<clever> gchristensen: i dont think it will cause recursion in that case
<clever> gchristensen: is it actually giving infinite recursion the way it is now?
<clever> but it costs about 300mb on /boot
<clever> that lets you get a rescue env from grub at any time, so you can repair any boot problems
<clever> ottidmes, infinisil: you will also want to use https://github.com/cleverca22/nixos-configs/blob/master/rescue_boot.nix
<clever> ah yeah, looks like luks doesnt care if its a file or block
<clever> losetup can turn any file into a block device
<clever> ottidmes: you could also put that key file onto /boot/
<clever> ottidmes: but GPT uses more space and doesnt allow that
<clever> ottidmes: thats what grub did with MBR drives
<clever> ottidmes: just a bit anoying to waste an entire partition on something that simple
<clever> ottidmes: but now you need 4 partitions, boot, key, root, swap
<clever> ottidmes: so you use the passphase to unlock a given partition, then the raw data inside that is used to decrypt 2 more
<clever> ottidmes: yeah, i have seen one guide that had a dedicated key partition, without even a partition
<clever> and you have to read the swap to know that
<clever> ottidmes: and then switch to writable if your not resuming
<clever> ottidmes: you would need to ensure you do a read-only import of the pool to read the file without allowing journal recovery
<clever> it resumed anyways...
<clever> i turned it on, and discovered, it was in hibernation
<clever> i once put a windows pc back together, after it being in pieces for 3 months
<clever> that reminds me
<clever> infinisil: but that cant handle hibernation
<clever> infinisil: nixos has a random luks option for swap, which just generates a random key every time you boot
<clever> ottidmes: what i havent looked into yet, is having 2 options for unlock, and detecting it at bootup
<clever> and i can just pop out the card when i need to lock it down more
<clever> so it just boots without any intervention
<clever> what if i add a secondary keyfile to the SD card, for automatic unlock when at home
<clever> the laptop has an SD card reader
<clever> ive also had another idea that i havent tested yet
<clever> ottidmes: the rootfs must not be modified when resuming
<clever> ottidmes: hibernation probably wont like that
<clever> ottidmes: then you need to enter 2 passphrases at bootup, to unlock the zfs and swap
<clever> ottidmes: i also do lvm on luks, then swap+zfs on lvm
<clever> yeah
<clever> so 8gig to spare
<clever> 32gig of ram, and i wanted to support hibernation
<clever> but i made a mistake in the units when installing this laptop, 40mb swap, rather then 40gig
<clever> same
<clever> infinisil: i tried zvol swap 2 days ago, the machine locked up solid
<clever> behind the scenes, --upgrade just calls nix-channel --update
<clever> hyper_ch: that has the same effect
<clever> m`: then you just "nix-channel --update" and "nixos-rebuild switch" to upgrade everything
<clever> m`: depends on if it was installed with nix-env or nixos-rebuild and systemPackages
<clever> not override
<clever> you want overrideAttrs
<clever> oh
<clever> and what error does it fail with?
<clever> aminechikhaoui: you want to set the nix.package option

2017-11-24

<clever> joko: make a systemd unit to run it at the right time
<clever> das-g[m]: check the same path as root
<clever> gchristensen: the parser is pretty simple: https://github.com/NixOS/nix/blob/master/src/libstore/derivations.cc#L156
<clever> gchristensen: let me grab a second sample
<clever> gchristensen: cant remember where the nodejs one went
<clever> no idea
<clever> gchristensen: haskell and node already have them
<clever> and you could just create those yourself
<clever> hyper_ch: the tarballs probably contain some special files that include the metadata
<clever> /nix/store/l16wmfx8gaja9mknv9j03l1vx3njksi7-libvirt-3.6.0/bin/virt-xml-validate: TYPE="nwfilter"
<clever> [clever@amd-nixos:~]$ grep -r --color nwfilter /nix/store/l16wmfx8gaja9mknv9j03l1vx3njksi7-libvirt-3.6.0/bin/
<clever> snajpa: you would also want to greb the source for every package in your closure
<clever> snajpa: sounds like thats normal virtual machine stuff, from libvirt starting up
<clever> snajpa: what are the files called?
<clever> it has to be set to legacy, and configured in the nixos config
<clever> oh, and nixos doesnt play nicely with the mountpoint stuff in zfs
<clever> it may need the requiredForBoot flag on the filesystem
<clever> snajpa: if you configure it properly, nixos will mount it from the initrd, and that should be early enough
<clever> it will need to be patched
<clever> buildFHSUserEnv is generally the wrong answer to most problems
<clever> pcarrier: and i believe buildFHSUserEnv is to blame
<clever> pcarrier: nix-shell does nothing to actually block the agent, just re-set that env variable with export
<clever> i only use bash
<clever> can you gist the full error and your nix expression?
<clever> pcarrier: is this inside nix-shell or nix-build?
<clever> can you gist the full error?
<clever> then the agent should just work
<clever> pcarrier: omit --pure
<clever> rcshm: this is how i did my vim plugins: https://github.com/cleverca22/nixos-configs/blob/master/vim.nix
<clever> had to use a new java, linked with the new ld.so
<clever> vaibhavsagar: the gl libraries where incompatible with the old ld.so i think
<clever> oops, wrong room
<clever> org.lwjgl.LWJGLException: X Error - disp: 0x7f858d431a10 serial: 149 error: GLXBadContext request_code: 155 minor_code: 4
<clever> dont quote it
<clever> pcarrier: to start with, install nix-repl and then try to eval just <nixpkgs> alone
<clever> pcarrier: this function will print the 1st argument when evaluated, then return the 2nd argument
<clever> nix-repl> builtins.trace "printme" "return me"
<clever> "return me"
<clever> trace: printme
<clever> if you dont pass a config argument to nixpkgs, it will internally import ~/.config/nixpkgs/config.nix to get the config
<clever> so you want import <nixpkgs> { config = import ./user.nix; }
<clever> but that user.nix you linked is actually a config.nix file
<clever> your importing the path to nixpkgs, and calling that function with an empty set, which leaves everything at the defaults
<clever> yeah
<clever> nix also has a -I that prepends things to $NIX_PATH
<clever> just like #include <stdint.h> searches in the -I paths of gcc
<clever> that searches for 'foo' within NIX_PATH
<clever> pcarrier: what dont you understand about it?

2017-11-23

<clever> Cypi: that will create a python that can use those 2 packages
<clever> Cypi: you could put something like (python3.withPackages (ps: with ps; [jupyter beautifulsoup4])) into systemPackages
<clever> pcarrier: you may need to logout and log back in for it to take effect
<clever> pcarrier: nix.nixPath is system wide
<clever> Cypi: something like this: nix-shell -p 'python3.withPackages (ps: with ps; [jupyter beautifulsoup4])'
<clever> [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs" "nixos-config=/etc/nixos/configuration.nix" "/nix/var/nix/profiles/per-user/root/channels" ]
<clever> Value:
<clever> [root@amd-nixos:~]# nixos-option nix.nixPath
<clever> pcarrier: nixpath
<clever> pcarrier: the nixos-option command
<clever> Cypi: you need to use pythonWithPackages
<clever> but you will need to use -I nixos-config=path the first time, to make it find the config that contains the config path
<clever> pcarrier: so nix.nixPath can be used to change its location
<clever> pcarrier: nixos will just use <nixos-config> from your $NIX_PATH to find configuration.nix
<clever> pcarrier: and you can change that variable with nixos config
<clever> pcarrier: if this file exists, nixpkgs will ignore the config.nix in $HOME
<clever> [clever@amd-nixos:~]$ echo $NIXPKGS_CONFIG
<clever> /etc/nix/nixpkgs-config.nix
<clever> sphalerite: depends on the kernel param panic=
<clever> i suspect it might...
<clever> hmmm, but can it work at all over wifi ...
<clever> sphalerite: nice
<clever> sphalerite: nice
<clever> sphalerite: netconsole can show the panic?, i should rig that up between all my machines
<clever> sphalerite: if you write a 'c' to /proc/sysrq-trigger it should immediately crash, without even a flush to disk
<clever> [3634187.500929] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
<clever> sphalerite: hmmm, not sure abotu that one

2017-11-22

<clever> yeah
<clever> symphorien: was wavemon even a thing then?
<clever> i last used it in 2011
<clever> and the code is 6 years old
<clever> it uses QT
<clever> my custom GUI also monitored the cpu temp, and had its own PID loop to manage the cpu fan speed
<clever> it was sensitive enough to detect the screen being tilted
<clever> i once had a bargraph showing the signal level, updating 20 times a second
<clever> i have also written my own UI's for wpa before
<clever> it helps me too, so i can speed up the same problems you mentioned
<clever> and then select_network to force it to connect
<clever> ah, add_network just creates an empty network, then set_network configures params of it
<clever> list_networks = list configured networks
<clever> add_network = add a network
<clever> select_network <network id> = select a network (disable others)
<clever> try help in wpa_cli, look for add network, and select network
<clever> wpa_gui is just a wrapper over the same protocol wpa_cli uses
<clever> i think wpa_cli has a command for that as well
<clever> so i can just write to it at any time and systemctl restart
<clever> i leave /etc/wpa_supplicant.conf untouched by nix
<clever> wpa_gui should be fixed by then
<clever> you may need to do "wpa_cli -i wlan0" to tell it which interface to scan on
<clever> run wpa_cli, scan, wait for results, scan_results, copy/paste
<clever> ive never used a gui, i just manualy run wpa_passphrase, append it to /etc/wpa_supplicant.conf and restart the daemon
<clever> wpa_cli still works
<clever> i havent found a solution yet
<clever> QT plugin, ive been having the same issue with virtualbox
<clever> jmc_fr: i'm thinking you want to set the variable with https://nixos.org/nixos/options.html#environment.sessionvariables
<clever> it doesnt appear to set LC_MESSAGES
<clever> jmc_fr: click on the declared in link
<clever> and that involves looking in /proc
<clever> benley: correct, nix-env obeys ~/.config/nixpkgs/config.nix
<clever> aminechikhaoui: it has no effect on all of the other nix tools
<clever> aminechikhaoui: the nixpkgs.config option is only passed to the instance of nixpkgs used within nixos-rebuild
<clever> aminechikhaoui: and thats over in ~/.config/nixpkgs/config.nix
<clever> aminechikhaoui: the problem is that the option has to go into config.nix, not a shell.nix
<clever> yeah, that will re-run the script inside a shell that has those tools in $PATH
<clever> :q!
<clever> aminechikhaoui: that only has an impact on nixos-rebuild, it doesnt affect nix-shell, nix-build, or nix-env
<clever> ah, my only guess is to put allowUnfree into your config.nix like the error says
<clever> asuryawanshi: which package does it complain about?
<clever> das-g[m]: ah, just run the app like ./result/bin/appname
<clever> das-g[m]: depends on what kind of string its inside, can you gist the entire file?
<clever> steveeJ: that allows gaining access to a handle to /
<clever> steveeJ: there is something special about having access to a filehandle of an FS outside the container
<clever> if i ever have to duplicate the install, the boot stuff is going to change anyways, no need to preserve it
<clever> Rovanion: so everything that isnt needed to boot, goes into a file in the nixcfg git repo
<clever> Rovanion: i mostly put the boot related stuff into configuration.nix, then add ./nixcfg/hostname.nix to the imports list
<clever> ive also played with a custom container type using systemd-nspawn and fuse
<clever> steveeJ: at the kernel level, there isnt much difference
<clever> steveeJ: it may have that option, but it would be more complex to setup, docker doesnt expect the sharing, and there are security issues with just jaming your own mounts into docker
<clever> i havent played with lxc yet
<clever> hiroshi: docker, is more about having pre-made images (or making them) that dont depend on the host in any way, and it cant share the /nix of the host
<clever> hiroshi: ^^^
<clever> hyper_ch: everything under the containers attribute is declarative containers, you give it a nixos module describing the container, and nixos-rebuild will build it and launch it for you
<clever> Rovanion: ive used that before to spawn 100 containers, 10 per host, limited mainly by how much ram the target application required
<clever> Rovanion: nixos hosts support containers, and will automaticaly build the container and spawn it with a shared copy of the host /nix/
<clever> Rovanion: nixpkgs also contains routines for making docker images, they usually lack full nixos, and ive gotten them down to 69mb
<clever> Rovanion: nixos containers share the /nix directory with the host, so the data isnt duplicated
<clever> nixos-rebuild switch
<clever> then it will never find the output, and do a rebuild
<clever> i always change a digit of the hash to 0, or increment a digit
<clever> yeah
<clever> fixed-output rules bypass the normal automatic rebuild triggers
<clever> so nix trusts you, and uses the previous value, because you claimed it has the same hash as before
<clever> elvishjerricco: the issue, is that nix already has an output with that name + hash, and by definition, the output is fixed to always have that hash
<clever> elvishjerricco: you have to make the hash invalid
<clever> just add a preFetch string to the derivation, and have builder.sh eval it
<clever> a preFetch script might do it
<clever> elvishjerricco: it would probably be simpler to make your own fixed-output derivation that sets $HOME and does all of those git config flags, then git clones
<clever> i dont see any simple way to do that
<clever> ah, fun
<clever> elvishjerricco: what config are you trying to modify?
<clever> systemd.services.libvirtd.restartIfChanged = lib.mkForce true;
<clever> so you can just mkForce it like any other option
<clever> its a normal option in the options framework

2017-11-21

<clever> forgetful: yeah
<clever> yeah
<clever> just point nix-channel at a server you can see access.log on, and you can see what its doing
<clever> yeah
<clever> forgetful: you can also package those expressions up into a nixexprs.tar.gz and then use nix-channel on that
<clever> forgetful: then the user can just git clone, and run nix-env -f . -i or nix-shell
<clever> forgetful: youll want to modify the nix expression to work without <nixpkgs> How_to_fetch_Nixpkgs_with_an_empty_NIX_PATH
<clever> forgetful: if the user has the exact same nixpkgs as hydra used (pinning it in your expresison helps)
<clever> forgetful: depends on what you want private, if the end-user is given the full nix expression for building it, along with the sha256's of the sources, nix will just grab the build from a binary cache
<clever> forgetful: ive never seem them work
<clever> forgetful: you need to just eval the same expressions hydra is evaling
<clever> forgetful: i dont think that channel hydra serves works anymore
<clever> forgetful: and hydra already provides the same API as nix-serve
<clever> forgetful: did you set hydraUrl in the nixos config?