2017-11-08

<clever> :D
<clever> manveru: and with the right gui, he will already know nix!
<clever> manveru: what if we made a nix editor, with this kind of gui, lol
<clever> what was it called....
<clever> i just had an idea....
<clever> in all 3 cases, you could include justdoit, to nuke the hdd and reinstall in minutes
<clever> now you can network boot it from any machine on the LAN
<clever> now it lives in /boot/ and there is a grub option to pick it
<clever> within 2 minutes, it will be running nixos from a ramdisk
<clever> this method will generate a .tar file, scp it to ANY linux machine (nix not required), ssh in, unpack to /, and run /kexec_nixos
<clever> i have also written 3 different ways to boot the installer, depending on your needs
<clever> so you can just ssh in (or even make a systemd unit) to just run it
<clever> so you can then include that in the installer image, to pre-configure it
<clever> manveru: this module will install a bash script called justdoit, and nixos options configure what that script does
<clever> and i have a 3rd option, far dumber, no UI at all
<clever> manveru: you dont have to set the home= key if your using isNormalUser=true;
<clever> this is the html GUI for browsing the docs and creating a configuration.nix
<clever> that video was recorded by hydra, in a fully automated fasion
<clever> manveru: this is the old UI, from before i went http: https://www.youtube.com/watch?v=ETVJW59bL2s
<clever> manveru: ive got 3 different ways to automate the install
<clever> manveru: have you seen the UI's ive done?
<clever> depends on if your loading it via localhost or over the lan
<clever> manveru: make a daemon with an http UI, that does the full install
<clever> manveru: thats another idea i had
<clever> obadz: automated testing with qemu
<clever> bigvalen: there is also nixops, which can take a pre-made AMI of nixos, and upload the changes you need
<clever> so systemd will just run it on the first boot
<clever> bigvalen: an entire service, pre-installed and configured
<clever> bigvalen: thats a custom nixos option defined in another file in that repo
<clever> manveru: yeah, let me find it...
<clever> bigvalen: so you could infect the entire LAN with nixos, by just walking to each machine, f12, netboot, justdoit
<clever> bigvalen: also, the netboot the above module sets up, will run nixos from a ramdisk, and includes my justdoit script, which automates the entire nixos install
<clever> bigvalen: nix will also keep snapshots of the zone files, and rollback can undo changes to the service
<clever> bigvalen: then if you nixos-rebuild, nix will detect that the zone files have changed, and restart bind for you
<clever> bigvalen: oh, another thing thats handy with nix, put the dns zone files into /etc/nixos/ and use file = ./db.192.168.0;, it has to be unquoted
<clever> manveru: should be able to omit binutils on line 9
<clever> bigvalen: '' based strings will strip the common indent off of every line
<clever> manveru: can you gist what you have so far?
<clever> that also allows 117 to not have to escape them
<clever> and 115
<clever> bigvalen: line 136, another place for ''
<clever> while evaluating the option `systemd.services.docker-prune.serviceConfig':
<clever> its a bit cryptic to read them
<clever> yep
<clever> while evaluating the option `systemd.services.docker-prune.script
<clever> while evaluating the attribute ‘autoPrune.flags
<clever> bigvalen: line 23 to 249, use '' instead of ", and you can indent the entire string to make it pretty
<clever> value is a boolean while a set was expected
<clever> bigvalen: autoprune should be a set, with 3 keys, not a boolean
<clever> bigvalen: https://nixos.org/nixos/options.html#docker.autoprune
<clever> bigvalen: can you gist your configuration.nix file?
<clever> euniarte: the preConfigure hook makes a special patched version in a tmpdir, that can see all the qt modules
<clever> euniarte: part of the problem, is that the qmake in /nix/store doesnt know about everything your putting in buildInputs
<clever> so it has to be repaired every time you login
<clever> which systemd will helpfully delete upon logout
<clever> euniarte: the only way i found to get qtcreator to work, was to point it to the qmake binary in /run/user that was made by the preConfigure hook
<clever> euniarte: just give a list under the buildInputs in shell.nix
<clever> manveru: bss is just the mac for the access point
<clever> manveru: on sec
<clever> manveru: yeah
<clever> manveru: at a glance on the link you gave, it creates a pair of virtual radios, that share the "airspace", so you just run an AP on one and a client on the other
<clever> manveru: first you want to see if modprobe can even load it on normal nixos
<clever> euniarte: -p will combine them for you
<clever> ah
<clever> manveru: line 26 defines an ssh server, and 38 a second server with different config, 50 is a client
<clever> manveru: sounds like a perfect thing to integrate into the nixos test framework
<clever> QT also needs the preConfigure hook to be ran before qmake is usable
<clever> yeah
<clever> and it changes behavior based on argv[0]
<clever> its a bit complex, because nix-shell is just a copy of nix-build
<clever> nixer: line 407 causes the sub-shell to source setup.sh, which will handle setting up PATH the same as in normal builds
<clever> electrocat: nixos configures that automatically under /run/opengl-driver
<clever> nliadm: replace <nixpkgs> with builtins.fetchurl pointing to github
<clever> sphalerite: :D
<clever> sphalerite: ah, didnt know of that point
<clever> make it hunter2, and you will detect very bad passwords, because the script breaks :P
<clever> srhb: i believe bash lets you make that marker as long&complex as you want
<clever> yeah
<clever> doing it at runtime is where you would have to fall back to bash
<clever> srhb: it just returns a string, toFile is what puts it into the store
<clever> sphalerite: i use that to cheat, builtins.toFile (builtins.toJSON
<clever> sphalerite: oh, and almost anything that accepts yaml, also accepts json
<clever> sphalerite: have you seen the implementation of substituteInPlace?
<clever> romildo: you may need to ensure the right flags are passed to unzip, so it doesnt set the permissions so open
<clever> romildo: ah, there has recently been some security changes within nix, to present exploits based on that
<clever> romildo: the group has +w on it, which isnt pure
<clever> romildo: what permissions does the file have after the build finishes?
<clever> ah
<clever> rycee's comment implied making it as a directory
<clever> __monty__: nix-cache-info is a file, not a directory
<clever> fuzzy_id: nix-collect-garbage should be used
<clever> fuzzy_id: not really
<clever> fuzzy_id: you may need swap and to resize the /nix/store/.rw-store mount point (df should show its path)
<clever> fuzzy_id: thats a bug, it tries to do the entire install to the tmpfs on the "host" first, then copy it over
<clever> LnL: i suspect its the ^L characters
<clever> it only happens in certain files
<clever> LnL: the auto-completion bug i have, is that i start typing a word starting with a, and it gives completion results starting with f, for example
<clever> LnL: my main machines use all of those
<clever> LnL: i had to comment the others out because they depended on clang and one machine was low on space
<clever> LnL: ive run into an anoying problem where it is trying to complete things that are just plain wrong
<clever> infinisil: it just works after typing ~3 characters of a word you have used elsewhere
<clever> infinisil: this gets me completion for any open file (via :tabe), i havent figured out how to make it auto-inspect headers
<clever> and hydra can rebuild the image whenever things change that have any impact: https://hydra.iohk.io/job/serokell/cardano-sl/dockerImage.x86_64-linux
<clever> so now we can benefit from both, its easy to maintain the image with nix, and the consumers get the simplicity of docker
<clever> everything is built by nix, but nix is not required to run it
<clever> using the above hydra link, and the docker.md directions, you could run a copy of cardano on your machine, under docker
<clever> as an example of what the above nix expression can do
<clever> the host can be anything that supports docker (pretty much any linux distro)
<clever> but, you can also just skip that initial ubuntu, and make an image that just has your app, and nothing else
<clever> docker would typicaly just download a pre-made ubuntu image, where you then apt-get whatever, and can then convert back into an image (or a layer)
<clever> the container is basically just a second root fs image, and some code to trick the "guest" into thinking it has the entire system to itself
<clever> nix lacks the imperative mess
<clever> docker is just a way to contain the imperative mess and nuke it easily to start over
<clever> yeah
<clever> nix specifies the exact version of mysql in the expressions, and wont upgrade things without warning
<clever> you may get a diferent mysql server tomorrow, and then your app breaks
<clever> though if your docker file says "fetch app X and also apt-get install mysql-server"
<clever> sconybeare: i always use "sudo -u USER -i" to deal with that
<clever> sconybeare: ahh, that would explain it
<clever> dj_goku: either edit it in the checked out copy, add it in the config.nix for your user, or make a config.nix in the current directory and nix-build -A hello --arg config 'import ./config.nix'
<clever> dj_goku: nix-build -A hello, in the root of the nixpkgs checkout
<clever> sconybeare: not sure, but those AMI's are mainly meant to be used with nixops
<clever> sconybeare: "sudo systemctl status nix-daemon"
<clever> sconybeare: is nix-daemon running as root and NIX_REMOTE set to daemon?

2017-11-07

<clever> c0bw3b: its best to not touch builder 90% of the time
<clever> c0bw3b: it overrides everything
<clever> kyren: for example: pkgs.callPackage ./netatalk.nix {};
<clever> kyren: run pkgs.callPackage on netatalk
<clever> Lisanna: but at that point, whats the difference between copying version 1234 into nixpkgs, and just updating the "1234" string in nixpkgs?
<clever> Lisanna: maybe.....
<clever> noobly: you need to insert that key=value into your existing set, not put 2 sets in the file
<clever> noobly: can you gist an example of what your doing now?
<clever> but you would have to download the source and binary, every time
<clever> the binary cache would be able to give you a copy of the source, which you then eval, and find that the binary is also on the cache
<clever> Lisanna: what i do, is i keep my own default.nix in the root of the project, with src = ./.; and then whenever nixpkgs has a version bump, i copy the default.nix from the project over, and change it to src = fetchFromGitHub
<clever> so it will never scale to all of nixpkgs
<clever> because it wants to check if yourpackage.name contains "hello", and it has to download the source to get the default.nix
<clever> Lisanna: but it has the downside, that something as simple as nix-env -i hello, has to download your source always
<clever> Lisanna: the only real solution is import from derivation, where you fetchFromGithub, then import a default.nix in that fetched result
<clever> ldlework: i havent looked into it either
<clever> yeah
<clever> ldlework: nixops is built ontop of the nix expressions in nixos, which is built ontop of the expressions in nix
<clever> ldlework: at runtime, nixops is evaling multiple instances of <nixpkgs/nixops>, with the system attribute set to linux
<clever> dhess: oh, thats new!

2017-11-06

<clever> codedmart: what nix-shell args did you use?
<clever> not sure how to tell emacs how to do that
<clever> romildo: you need to tell cabal repl which executable to load in ghci
<clever> dhess: the haskell will post-process the yaml into topology.nix, then the deployment file makes heavy use of map to turn that into an array of lists
<clever> dhess: nope
<clever> dhess: its mostly a wrapper around nixops, that turns some yaml files into nix so the deployment file can generate machines based on the yaml
<clever> yep
<clever> and then server-side scripting can be used to send it a different config, based on the mac
<clever> the dhcp config tells ipxe to report its mac address to "boot.php" (which isnt even a php script in that version)
<clever> the only problem i ran into when using that last week, is that it lacks uefi support, and it gets confused by nvme drives
<clever> and justdoit is pre-installed on the netboot image, you just run "justdoit" in the shell, and it installs nixos
<clever> plug any machine into the ethernet port, and it can network boot, and it can leech off the wifi of the server
<clever> it turns a laptop into a combination network boot server, and router, with full NAT/bind/dhcp
<clever> this is another thing i did recently
<clever> it wont even initialize PATH though, so it can be tricky to get the system into a usable state
<clever> that will bypass everything
<clever> you can also boot with init=/bin/sh to get root without any password prompts
<clever> so you can just boot it at any time, to do any kind of recovery
<clever> dhess: this one puts the entire installer into /boot and your grub config
<clever> dhess: but i have recently made some recovery tools
<clever> nothing with vault yet
<clever> yep
<clever> then you can enable it as needed
<clever> yeah, make each module off by default, like everything in nixos
<clever> require works in a similar way, but isnt as smart as imports
<clever> imports will accept a list of nixos modules, which recursively get loaded and merged into the final nixos build
<clever> require and imports work in a similar way
<clever> and each is treated the same as configuration.nix
<clever> and defaults is a special one, that applies to every machine
<clever> the attributes within all of them, define machines
<clever> require specifies more files that operate at the nixops level (same as deployment.nix)
<clever> dhess: that can also work when using default.imports
<clever> the require stuff doesnt directly use the nixos module framework
<clever> kuznero: there are also tests under nixos
<clever> iamrecursion: make a systemd unit or prestart on a unit, that runs mkdir
<clever> iamrecursion: thats how every service is nixos is written
<clever> Unode: i think you could use one of the audit tools to track the use of the unlink syscall, systemwide
<clever> there is something systemd related that does that in /run/user, but not /tmp
<clever> Unode: are they actually in /tmp/ ?
<clever> boomshroom: you would need to do something like mplayer does, with runtime cpu feature detection, and auto-selecting the right version of the function
<clever> that might work
<clever> it doesnt really matter who you install it as
<clever> the client itself needs root for some backwards reason
<clever> i'm not sure what will happen if you run the whole thing as root
<clever> the last fun problem i had, was that it ran, but the connect button was just missing
<clever> yeah, the teamviewer developers
<clever> tobiasBora: also, you need to set allowUnfree to true to allow it
<clever> tobiasBora: c: every time i fix the teamviewer package, they delete it and force an upgrade, and break it in new ways, lol
<clever> tobiasBora: b: teamviewer has a daemon that requires root, which you will have to manualy run after installing on every boot
<clever> tobiasBora: a: nix-env -iA nixpkgs.teamviewer
<clever> tobiasBora: config.nix, at the path the error shows
<clever> tobiasBora: oh, didnt see the q, that should be good then
<clever> tobiasBora: that likely isnt what you want to do
<clever> tobiasBora: the nix-env command you ran would try to install every single melpa package

2017-11-05

<clever> orivej: and if that node already exists with a value of false, it should change it to true, rather then add an invalid duplicate entry
<clever> orivej: but i want to also preserve any functional code in the nix file
<clever> orivej: lets say i want to use a gui to enable services.openssh.enable
<clever> lars_: maybe
<clever> lars_: nixos should also repair the missing files when you login, if you have write access
<clever> lars_: if you correctly copied them over
<clever> lars_: then lars will own his own home folder
<clever> lars_: yeah
<clever> codygman: configuration.nix has an option to control NIX_PATH
<clever> lars_: do you own your own home folder?
<clever> lars_: otherwise, things are going to be using /home and making it very difficult
<clever> lars_: its best done when booted into a different OS
<clever> then at reboot, all changes got reverted
<clever> so nixos-rebuild wrote to the /boot directory on /, not the /boot partition
<clever> ive also seen many nixos users failing to mount /boot
<clever> so it can only be found if you first umount the /boot partition :P
<clever> ive heard of people hiding their porn in /boot, under the boot partition
<clever> yes
<clever> lars_: and can only be seen if you umount the new home from /home
<clever> lars_: the old home is probably still in /home
<clever> lars_: then umount, and mount it to /home
<clever> lars_: mount the new home to not /home, then move the old /home into the new /not-home place
<clever> lars_: you will want to do that
<clever> lars_: did you move your old home folder over?
<clever> rycee: some commands try to create a symlink in the current directory
<clever> lars_: and expect the -dev packages to fix everything
<clever> lars_: oh, and there are the users that just nix-env -iA nixos.gcc
<clever> rycee: what is your working directory?
<clever> lars_: yep, as long as the end-users dont try to forcibly modify files under /nix and "sudo make install" random junk
<clever> sphalerite: yeah
<clever> sphalerite: as long as its not a hardware issue
<clever> sphalerite: one great thing with nixos, i can just take you config, throw it into a vm, and perfectly reproduce your system, right down to the software/config problems
<clever> ive been wanting something that can parse it into an AST, apply some mutations, then serialize it back out
<clever> that puts the entire installer into /boot (300mb cost) and adds it to the grub menu
<clever> joehh_: if you use grub, that "something else" can be https://github.com/cleverca22/nixos-configs/blob/master/rescue_boot.nix
<clever> joehh_: and you need to boot from something else to perform that mv
<clever> joehh_: ive done it once before, i had to use a debug flag in the initrd, and manualy mount the new /nix before continuing the boot
<clever> sphalerite: lol, identical repo name!
<clever> https://www.youtube.com/watch?v=ETVJW59bL2s and the link is in the description
<clever> ive also worked on one a bit
<clever> lars_: if you had mounted home to /mnt/home/, nixos-generate-config would have configured it for you
<clever> lars_: fileSystems."/home" = { fsType = "ext4"; device = "/dev/sda10"; };

2017-11-03

<clever> bbl
<clever> srk: a true netboot, with everything fully configured in nixos
<clever> srk: oh, and one other thing
<clever> so you need to tweak the config to ensure its still in PATH
<clever> bgamari: and also, the non-shell ssh's use a different rc file in $HOME
<clever> bgamari: thats it
<clever> bgamari: "ssh user@remote 'echo $PATH'"
<clever> bgamari: make sure nix is in PATH
<clever> yeah
<clever> those usually have an Unstable postfix in the attribute path, and a date in the .name as a version
<clever> but if your in single-user mode on another distro, you can freely chmod +w anything, and break the rules hard
<clever> as long as your using nix-daemon, it will enforce the rules and stop you from chmod'ing things you shouldnt
<clever> bgamari: yeah, that can happen, just chmod the source in the working dir
<clever> bgamari: when nix copies the result of fetchgit, its still -w, but it may need a chmod +w -R
<clever> bgamari: within postInstall, try doing an "ls -ltrh" on the path your copying from
<clever> srk: this puts the entire "netboot" image into /boot and your grub.cfg
<clever> srk: i also recently made 2 netboot related things
<clever> srk: thanks
<clever> bgamari: can you also gist the full log output when it fails?
<clever> srk: doesnt matter that much
<clever> srk: its not flagged as a fork, though..., did i ever put it on github?
<clever> srk: ah, i had a feeling those filenames where familiar, lol
<clever> can you gist the nix expression?
<clever> it becomes immutable after all phases have finished
<clever> bgamari: but $src points to a different job
<clever> bgamari: it happens after the installPhase
<clever> bgamari: and fetchgit does the download in a seperate job
<clever> bgamari: nix removes +w on everything once the build is finished
<clever> unset NIX_PATH before you source nix.sh
<clever> and then the shells inside tmux append to it
<clever> the shell from before you ran tmux set it once