2017-10-18

<clever> keta_suki: and if those generations are gone, you dont even need to GC
<clever> keta_suki: no need to create an empty file if you manualy delete those generations
<clever> keta_suki: this will delete those problem generations, and then it should just activate without any problems
<clever> nix-env -p /nix/var/nix/profiles/system --delete-generations 44 45 46 47 48
<clever> rebooting wont clear that
<clever> keta_suki: yeah, until generations 44 to 48 are deleted, it will expect that path to exist
<clever> keta_suki: and generations 49 + 50, dont need the secret
<clever> keta_suki: so the currently booted system, along with generations 44 to 48, expect that secret to exist
<clever> the above 2 commands should confirm it
<clever> keta_suki: ls -l /nix/var/nix/profiles/
<clever> keta_suki: what do these 2 commands output: nix-store --query --roots /nix/store/sbr38724gcj1iznqj4p6y31wb55k6lb7-append-initrd-secrets
<clever> keta_suki: so its trying to make sure your old rollback options still have the secrets they are asking for
<clever> keta_suki: for each generation you have built, it will fetch the secrets that generation wants
<clever> keta_suki: oh, i think i see the problem
<clever> keta_suki: the bootloader generation is what is causing the problem
<clever> keta_suki: what about nix-store --verify --check-contents, does it return any errors?
<clever> keta_suki: what does "nixos-option boot.initrd.secrets" say?
<clever> keta_suki: can you gist /nix/store/sbr38724gcj1iznqj4p6y31wb55k6lb7-append-initrd-secrets/bin/append-initrd-secrets ?
<clever> keta_suki: and the error is happening because it finished building everything and was trying to activate nixos
<clever> keta_suki: that error is refering to a client private key, not a host key
<clever> keta_suki: gist supports multiple files
<clever> yeah, 16.09 wont have that warning
<clever> people still ask about changing it :P
<clever> there is a giant warning on config generated in recent versions
<clever> changing it will break the things its meant to fix
<clever> eacameron: that tells nixos what version your state is
<clever> eacameron: and do NOT change the stateVersion in the configuration
<clever> keta_suki: and also the output of the command "nixos-option boot.initrd.network.ssh.hostRSAKey"
<clever> keta_suki: can you gist the entire output of nixos-rebuild and your configuration.nix file?
<clever> eacameron: change the nixos channel as root using nix-channel
<clever> TweyII: i think its just not legal
<clever> ID [a-zA-Z\_][a-zA-Z0-9\_\'\-]*
<clever> TweyII: the parsing for that happens near: https://github.com/NixOS/nix/blob/master/src/libexpr/parser.y#L300-L305
<clever> jluttine: ah, in that region, you want pkgs.stdenv
<clever> jluttine: lib/modules.nix only has access to lib
<clever> euniarte: and `nix-store --query --deriver` will turn an output path back into the .drv path
<clever> euniarte: 2017-03-20 12:45:56 < niksnut> if you urgently need a log, you can find them at URIs like: https://cache.nixos.org/log/l9qmwi2q0dk4ji8pcycc188gank0q5pb-pointedalternative-0.1.0.0.drv
<clever> euniarte: nix-store -l /nix/store/foo
<clever> euniarte: there is a command to read the log
<clever> gchristensen: something i recently threw together: https://github.com/cleverca22/nixos-configs/blob/master/netboot_server.nix

2017-10-17

<clever> simpler to replace the motherboard, if they have time
<clever> dings and dents + stickers are hard to replicate
<clever> so anybody can grab the windows bootloader, pop it into a hdd, and run unsigned code, if secureboot is on
<clever> about the MS certs, there is a debug option in a signed bootloader, that causes it to run unsigned code
<clever> makefu: and if the maid is able to reset the bios (or replace the entire motherboard), secureboot wont do a thing
<clever> makefu: the MS certs are now useless
<clever> makefu: it would need to be secureboot with your own certs
<clever> so thats more of a recovery thing, then a daily use option
<clever> just remember, tha an evil maid could replace the hdd, with oen that asks for a passphrase, and phones-home
<clever> but nothing stops you from also having a normal passphrase on the luks, as a second way in
<clever> my understanding, is that if configured correctly, the TPM will give access to protected key material, which can be used to unlock the rootfs encryption
<clever> catern: you can also read the dwm expression to see if something better has been setup
<clever> catern: by applying .overrideAttrs to the dwm derivation, and adding a postPatch hook
<clever> sphalerite: and apple claims its not a security problem
<clever> sphalerite: the bug only lets you send signals to processes en-mass, usually -9'ing everything as root
<clever> correction, copumpkin
<clever> joepie91: and last i asked, sphalerite cant find the bug that shal not be named in the XNU source, nor reproduce it in a custom build of it
<clever> joepie91: so you could allow google-chrome, but not allow everything else
<clever> joepie91: you can also give nixpkgs a function, that takes a package name and then says yes or no
<clever> dang, it probably needs some changes to use setuid
<clever> Unode: and https://nixos.org/nixos/options.html#services.locate.locate
<clever> Unode: did you enable the service in services and set the .package attribute?
<clever> samueldr: i generally just use cp, i never bothered to learn install, and i think its mostly to manage setting modes (which nix undoes) and auto-creating directories (mkdir -pv)
<clever> that part isnt in the manual
<clever> i'm also not sure why $$ works like that
<clever> nix-repl> "\${abc}"
<clever> "${abc}"
<clever> nix-repl> "$${abc}"
<clever> "$${abc}"
<clever> each has a different way of escaping the contents
<clever> it depends on if its a "string" or ''string''
<clever> bgamari: which is in the section you linked, down 1 page
<clever> Since ${ and '' have special meaning in indented strings, you need a way to quote them. ${ can be escaped by prefixing it with '' (that is, two single quotes), i.e., ''${. '' can be escaped by prefixing it with ', i.e., '''. Finally, linefeed, carriage-return and tab characters can be written as ''\n, ''\r, ''\t.
<clever> nixpkgs or nix manual?
<clever> bgamari: 2 options, depending on what you need
<clever> nix-repl> '' $${abc} ''
<clever> "$${abc} "
<clever> nix-repl> '' ''${abc} ''
<clever> "${abc} "
<clever> using the nix from the first phase (if it passed)
<clever> then it re-evals the config, with the VM options
<clever> nixos-rebuild will first eval your config once, without the VM options, to find the nix with your nixos packageOverrides (this is what fails)
<clever> thats normal, its a bug
<clever> does it still build a result symlink?
<clever> where did you try that?
<clever> which obeys the nixos option i previously linked

2017-10-16

<clever> Guest17: there are mostly 3 parts, nix itself, nixpkgs (a set of packages written in nix), and then nixos (a set of packages that build a linux distro)
<clever> Myrl-saki: then they will land in /etc/ of the dom0
<clever> Myrl-saki: use environment.etc to add files to dom0_config
<clever> which will give you a fully interactive qemu window, so you can manualy do xl create
<clever> so you want to build qemu-script and then manualy run testit outside of the sandbox
<clever> yeah, 64 would try to run it within a nix sandbox
<clever> Myrl-saki: you would want to comment out the shutdown on 31 (already done) and then manually run one of the qemu scripts (either line 46 or 64)
<clever> Myrl-saki: the gist just prooves xen is working, and doesnt spawn a domU
<clever> Myrl-saki: ah, thats missing from the gist, line 29-ish
<clever> Myrl-saki: `xl create` is ran inside the dom0, pointed to a config file that refers to the halvm unikernel
<clever> Myrl-saki: and that spawns a domU
<clever> tilpner: ah, thats a nice idea, provide overlays that can fix security holes, to quickly fix things
<clever> Myrl-saki: the xen hypervisor is fairly dumb, and it needs a lot of help from userland tools in dom0
<clever> xen requires an OS in dom0, and option 1 uses nixos for that
<clever> Myrl-saki: yeah, option 1 runs full nixos under the qemu
<clever> amunier: line 4 fetches from github (you can also use fetchurl), and then 24 copies it over
<clever> amunier: in this case, it was a git sub-module, but the same basics apply
<clever> havent actually done anything with halvm myself, was mostly helping a friend with automated testing of their code
<clever> Myrl-saki: but it could be modified to just open a qemu window and leave it interactive
<clever> Myrl-saki: option 1 is currently setup to do everything under nix-build, including booting the halvm and running a test script against it
<clever> amunier: to ensure things remain pure
<clever> amunier: nix disables all network during the build
<clever> amunier: pkgs.fetchurl and then cp it in the preConfigure phase
<clever> amunier: you will need to pre-download those files to the right spot, and potentially disable the download operation if it doesnt auto-detect the file
<clever> cant find the gist for option 3, but i was patching qemu to directly support the xen hypercalls
<clever> 2 just runs the halvm unikernel under linux userland, but it fails to setup the halvm heap
<clever> this runs halvm, under xen, under qemu
<clever> Myrl-saki: i was mostly working on just making it boot without needing xen on the real host
<clever> Myrl-saki: i have also gotten halvm to work under qemu
<clever> Myrl-saki: ah, then the nixos module already has your answer
<clever> Myrl-saki: you could start by just flipping on virtualisation.xen.enable and see if it still boots
<clever> ixxie: you want to make another derivation in that default.nix, which has the withPackages in its buildInputs
<clever> ixxie: that opens a shell that is suitable for building that wrapper, not for using it
<clever> assuming the generated script remains compatible
<clever> Li[m]1: so you could just do SHELL=${dash}/bin/dash wrapProgram ....
<clever> Li[m]1: line 40 of makeWrapper uses $SHELL in the #!
<clever> already hired, lol
<clever> Li[m]1: this calls wrapProgram, which auto-generates a bash script to do the required things
<clever> Li[m]1: aha
<clever> Li[m]1: are you using vim_configuratable?
<clever> Li[m]1: where are you seeing the wrapper?
<clever> ixxie: you would need to arrange for the default PATH to include the profile of a given user
<clever> ixxie: in nixos, they also read roots profile
<clever> sphalerite: its already been fixed in nixpkgs master
<clever> sphalerite: there was also a security problem with dnsmasq recently
<clever> and dnsmasq, rather then bind + dhcpd + nat
<clever> sphalerite: ah, your using grub over pxe
<clever> sphalerite: and because i did the tftp server setup in a declarative manner this time, you can apply such overrides right here: https://github.com/cleverca22/nixos-configs/blob/master/netboot_server.nix#L18
<clever> ixxie: basically, you unpack a tar to /, do /kexec_nixos, and then ssh back in
<clever> ixxie: this is an older trick, that is designed for networks i lack control over: https://github.com/cleverca22/nix-tests/tree/master/kexec
<clever> though it depends on if its a #define in the header, or a make flag
<clever> sphalerite: i also made this PR, that makes it simpler to configure the ipxe flags
<clever> make bin/ipxe.iso CERT=ca.crt TRUST=ca.crt
<clever> and you can combine both
<clever> the CERT option embeds the whole cert
<clever> make bin/ipxe.iso CERT=cert1.crt,cert2.crt
<clever> either the whole chain, or run a crosscert daemon that can provide certs at runtime
<clever> The full root certificates are generally too large to be embedded into the iPXE binary, and so only the SHA-256 fingerprints will be included by default.
<clever> make bin/ipxe.iso TRUST=/path/to/ca1.crt,/path/to/ca2.crt
<clever> sphalerite: ipxe does support https, but you have to embed the trusted ca's and the cert chain into the binary
<clever> i have used a different form before, to setup servers remotely, without network control
<clever> yeah
<clever> and boom, nixos is on the 2nd machine
<clever> then i just plug a second laptop into it over ethernet, f12 and network boot
<clever> ixxie: i add this to the imports list of the configuration.nix on one laptop
<clever> it also sets up nat
<clever> ixxie: the nixos module i just wrote, will setup the dhcpd, tftpd, ipxe, and nginx, to do everything at once
<clever> ixxie: if you take this derivation, and throw the 3 key files up onto any http server, you can then write an ipxe script with just "chain http://example.com/netboot.ipxe" and it will boot the installer
<clever> oh, and there is no gateway in the dhcp config
<clever> ixxie: only config i was missing, was a line in the ipxe script, and you have to staticly configure the lan interface before dhcpd can run
<clever> ixxie: it boots!
<clever> causing adb to just give root
<clever> for the kindle, there was an exploit in the backup restore process, that allows writing to root-only files, which tricks the OS into thinking its inside an emulator
<clever> and that was able to then root and backup
<clever> for the S3, i was able to install a new recovery without a wipe
<clever> Mic92: the S3 and the kindle both allowed rooting without formatting
<clever> Mic92: i have been able to root some devices without data loss
<clever> i just never got around to it
<clever> i can probably root this one, its just a samsung
<clever> Mic92: and mass-storage emulation needs root
<clever> Mic92: dang!, i havent rooted my phone yet
<clever> ixxie: yeah, i think its about keeping the total number of commits low, when possible
<clever> ixxie: i think that most PR's should be squashed down to one commit if its something simply in the end
<clever> ixxie: and release.nix is hard-coded to only make 64bit images
<clever> ixxie: ok, now the fun part, i only have a spare 32bit machine for testing the netboot
<clever> Mic92: ah
<clever> Mic92: what about the IP changing due to moving to a different network?
<clever> once it does sucessfully start, systemd cant restart it upon disconnection
<clever> but one issue that remains, is suspend/hibernation
<clever> ive had similar problems with toxvpn
<clever> the netboot side of things
<clever> then you just ssh in, and run justdoit
<clever> if added to that ramdisk image, it will be present in the previous setup
<clever> the above module, installs a bash script called justdoit
<clever> ixxie: but thats where justdoit.nix comes into play: https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix
<clever> ixxie: currently, it will just boot nixos in a ramdisk, and you would have to manually do the normal fdisk + mkfs + nixos-install
<clever> doing a nixos-rebuild
<clever> ok, 70 line nixos module written, with minimal testing!
<clever> then it can fetch the rest off a different app
<clever> pop that into drivedroid, with a custom build, and it will have usb ethernet drivers
<clever> iso as well
<clever> -r--r--r-- 1 root root 34816 Dec 31 1969 ipxe.iso
<clever> there is a pre-made ipxe image, that can be flashed directly to a usb stick
<clever> -r--r--r-- 1 root root 1441792 Dec 31 1969 ipxe.usb
<clever> [clever@amd-nixos:~]$ ls /nix/store/i6i48x2r4iggvmzwxh6b7l1dww58lmzv-ipxe-20160831-827dd1b/ -l
<clever> Mic92: yeah, it would also need mass-storage to load a capable ipxe
<clever> yeah, your better off making the phone emulate mass-storage, or a usb ethernet
<clever> but in either case, netboot over wifi needs the initrd to load before wifi comes up
<clever> Mic92: without dhcp, you need a usb stick that contains a copy of ipxe
<clever> Mic92: as long as you can bind to udp port 69 and control dhcp, you can do everything
<clever> the setup in the house involves at least 2 machines, maybe 3
<clever> Mic92: i'm now making it entirely self-contained to a laptop, so i can just plug it into a second laptop and let nixos spread :P
<clever> Mic92: i have that setup on the router in my house
<clever> ok, now i need a tftp root, and a netboot config\
<clever> now i need tftp and bind
<clever> gchristensen: ok, that should give me dhcp
<clever> let it spread!!
<clever> gchristensen: so i can just plug in an ethernet cord, and force nixos onto the nearest machine
<clever> gchristensen: i have a crazy idea i'm planning, setup a dhcp server on eth0 of a laptop, with a complete netboot setup
<clever> fearlessKim[m]: if you play with the string in nix-repl, you can see how the escaping plays out
<clever> mpickering: so you must do [ (nixpkgs.idrisPackages.with-packages [ ]) ]
<clever> i think any set that has a __functor attr, can also be treated as a function
<clever> mpickering: with-packages has 4 attributes on it, __functor, override, overrideDerivation, overrideScope
<clever> nix-repl> "${idrisPackages.with-packages}"
<clever> error: cannot coerce a set to a string, at (string):1:2
<clever> mpickering: that is a list containing a lambda(which is also a set), and a second list
<clever> mpickering: function application isnt as strict as in haskell
<clever> mpickering: yep, it needs ()
<clever> mpickering: can you gist your full nix file?
<clever> that part sucessfully evals
<clever> nix-repl> idrisPackages.with-packages []
<clever> «derivation /nix/store/f51kflc7bd8lph1ncpz2qb2wqich2air-idris-1.1.1.drv»
<clever> mpickering: what command is giving that error?

2017-10-15

<clever> iqubic: systemd does have some sandboxing options, and there are also nixos containers
<clever> Alling: just put in any hash, nix will tell you the right one when it fails
<clever> and you would obviously not want that if you lack systemd headers
<clever> lejonet: some services link into systemd for sd_notify
<clever> symphorien: it is
<clever> Leo`: and the setup hooks in many things can accept more
<clever> Leo`: others are random variables that https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh reads
<clever> Leo`: some are defined in nix, and others in bash scripts
<clever> and also config.nixpkgs.system
<clever> infinisil: so you can set config.nixpkgs.overlays and config.nixpkgs.config
<clever> infinisil: all attributes under config.nixpkgs are passed to nixpkgs
<clever> then it wont be an issue
<clever> yeah, just pkgs.fetchgit
<clever> LnL: ive even seen somebody try to do network there, and it entirely broke the ability to boot
<clever> aminechikhaoui: that implies that something corrupted your GPT tables
<clever> LnL: i dont think GPT has a boot flag
<clever> sounds completely normal
<clever> aminechikhaoui: what partition type did you set in gparted?
<clever> aminechikhaoui: can you gist the entire output of nixos-install?
<clever> Unode: that would have to be patched to restore the library path
<clever> aminechikhaoui: and what if you umount and run fsck.fat over it?
<clever> Unode: the issue, is that every single gui app in nix would have to be re-compiled, either with a thin patchelf wrapper, or fully rebuilt, to point to the right GPU drivers
<clever> aminechikhaoui: what if you umount and then re-mount the boot partition?
<clever> aminechikhaoui: what does blkid say about sda?
<clever> Unode: such changes have to occur when the package is being built
<clever> Unode: and also the secondary issue, that hydra would have to build 3 copies of everything
<clever> Unode: the main use of that variable, is to avoid re-compiling 90% of gui apps when you switch from nvidia to ati
<clever> aminechikhaoui: what does "blkid /dev/sda1" say?
<clever> aminechikhaoui: what partition number is /boot on?
<clever> aminechikhaoui: what did you set the grub device to in the configuration.nix?
<clever> aminechikhaoui: does dmesg say anything interesting?
<clever> rosa_: all of them
<clever> it needs to be changed to #!/usr/bin/env bash
<clever> Mic92: the problem is more about generating the initrd content in a secure manner, because the pure nix side of things leaks secrets in the store
<clever> Mic92: i think thats something to do with the bootloader, when generating the /boot files, it will read that path
<clever> Mic92: nope
<clever> Mic92: bootloader?
<clever> Mic92: which bootloader are you using, and what is the sandbox set to?
<clever> gchristensen: his other client
<clever> 2017-10-15 08:55:08 -!- Code [~Code@2405:7f00:8a01:5a00:c55e:e986:919a:c092] has quit [Ping timeout: 246 seconds]
<clever> rosa_: the irc server sends you pings at regular intervals, the irc client must respond with pongs
<clever> rosa_: is the client responding to pings?
<clever> bgamari: ive used it to compile some things, and not everything builds right away
<clever> bgamari: ive found that the cross-compile stuff is still a bit spotty and cant do an entire OS
<clever> bgamari: so an arm build would require an arm build slave
<clever> bgamari: correct, not-os is purely based on native compiles
<clever> rosa_: try with ifconfig -a instead
<clever> rosa_: try with ifconfig -a instead
<clever> rosa_: why |& instead of just | ?
<clever> rosa_: what does "ifconfig" say?
<clever> bgamari: it has automated x86 testing, and i have previously ran it on a raspberry pi
<clever> bgamari: the main goal of not-os, was to create a heavily stripped down OS that could still be built with nix, and reuse some nixos logic
<clever> TimePath: nix keeps a history of everything and you can undo with nix-env --rollback
<clever> TimePath: remove everything
<clever> rosa_: only root can connect to the gui
<clever> ebzzry: where exactly is it installed?
<clever> rosa_: middle click in xorg will paste the selection buffer
<clever> rosa_: "which bash"
<clever> sphalerite: ctrl+f for lc and youll find a batch of similar function calls in the 50s
<clever> sphalerite: half of line 127 belongs in a different function, 100 lines away from it
<clever> sphalerite: yep, thats invalid c
<clever> where did you download it from?