2018-06-04

<clever> $src will always point to a read-only copy of the src
<clever> thats one option
<clever> sorixelle: cat $src | sed > newfile.txt
<clever> Myrl-saki: this looks like a pentium 1
<clever> lustrate will just rename everything in / except /nix itself, to basically wipe the previous OS out
<clever> ramses_: the only thing you need to worry about is if the network comes online at bootup i think
<clever> if everything worked correctly
<clever> ramses_: the lustrate option should rename everything in / so it should just boot up nixos
<clever> it tells you how many errors it had at the end
<clever> fix all of the things
<clever> run it under valgrind on the machine that built it
<clever> strace?
<clever> run gdb on it
<clever> and even then, the JS has to parse every packet, and extract the payload
<clever> it could only do tcp/udp when under electron
<clever> and network would be difficult, you cant do tcp or udp from JS
<clever> no pci support
<clever> i think not-os has more then that, lol
<clever> only 3 processes running!
<clever> :O
<clever> more modern then your router? :P
<clever> 2.6 kernel, lol
<clever> 59mb hda
<clever> 14mb of ram!!!
<clever> it claims to be an old pentium
<clever> ignored the entire domain on that
<clever> ok, i cant even type cat into it, vimium opened a new tab
<clever> Myrl-saki: id also be interested in a custom distro for this, lol
<clever> but if i enable adblock, it boots
<clever> it doesnt even boot with my adblock missing
<clever> lol
<clever> got a link to JS Linux?
<clever> Myrl-saki: this provides you with 32bit and 64bit windows binaries
<clever> nix-repl> :b (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.mingwW64; }).hello
<clever> nix-repl> :b (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.mingw32; }).hello
<clever> clang is just a compiler
<clever> lol
<clever> so you can pre-test
<clever> nuke references makes it never find it, even on nixos
<clever> if its only the locales
<clever> yeah
<clever> Myrl-saki: yeah
<clever> SagnikS_: keep waiting, it should finish on its own
<clever> nuke references just runs sed over it, to make it never find that file
<clever> i think you have to modify glibc to remove it
<clever> Myrl-saki: nix level, after the derivation finishes, nix will abort it
<clever> elvishjerricco: nice
<clever> the 2nd part will cause any dependency to be a compile-time error
<clever> you may also want allowedReferences = [];
<clever> ${nukeReferences}/bin/nuke-refs $out/share/daedalus/main/index.js.map
<clever> you want to run nuke references on it
<clever> Myrl-saki: it needs glibc to translate things like "file not found" to the correct language
<clever> now check nix why-depends /nix/store/35l1g66nc4j8r992ygv02inhr8xj5dsy-ssss-0.5 /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131
<clever> google the error and see what comes up
<clever> but the .h files may remap things based on -D flags
<clever> Myrl-saki: actually, i think -static is link only
<clever> Myrl-saki: probably
<clever> Myrl-saki: _LINK only applies at link time, _COMPILE only applies at compile time
<clever> SagnikS: use the UUID
<clever> ah
<clever> so add (gmp.override { withStatic = true; }) to the buildInputs
<clever> it just adds static libs to .out
<clever> but it still doesnt have a .static
<clever> oh, lol
<clever> yeah, its part of libtool
<clever> Myrl-saki: something to do with dynamic linking i believe
<clever> SagnikS: and did you nixos-rebuild switch?
<clever> SagnikS: did you add it to configuration.nix?
<clever> so you need to override gmp first
<clever> id say gmp is broken, it lacks static libs
<clever> .out does not contain a .a file
<clever> gmp doesnt have a .static, so gmp.static is pointless
<clever> [ "out" "dev" "info" ]
<clever> nix-repl> gmp.outputs
<clever> also, try building gmp.static first, and look at it
<clever> oh, not _LINK
<clever> nix-build --no-out-link -E 'with (import <nixpkgs> {}); (ssss.override { gmp = null; }).overrideAttrs (super: { buildInputs=[glibc.static gmp.static gmp.static.dev]; NIX_CFLAGS_LINK = "-static"; })'
<clever> which can be done at the nix level
<clever> try NIX_CFLAGS_LINK
<clever> pkgs/stdenv/adapters.nix: makeStaticLibraries = stdenv: stdenv //
<clever> dont change CC, one sec
<clever> oh
<clever> gmp.static == gmp.out
<clever> 19 passthru.static = self.out;
<clever> Myrl-saki: and zlib/glibc already have .static's so they dont need that
<clever> in this example, glib accepts that
<clever> then you .override something else to use that new stdenv
<clever> Myrl-saki: makeStaticLibraries is a function that takes a stdenv, and modifies it to be status
<clever> colemickens: i believe its a cronjob on nixos.org
<clever> yes
<clever> or treated as a string
<clever> it only copies to the store when passed to certain functions
<clever> unquoted just makes it a path type
<clever> what you do with the string matters though
<clever> that just returns the file as a regular string
<clever> nope
<clever> the source of the nix expressions is not normally copied
<clever> which will exclude anything in .gitignore and related
<clever> one option is: src = builtins.fetchGit ./.;
<clever> then you need to correct that
<clever> grep them to confirm
<clever> if you do things right, the secrets wont be in the .drv files
<clever> then the build is ran by nix-daemon, and all inputs are now world-readable
<clever> it copies everything to /nix/store when needed
<clever> the nix eval is ran as the user requesting it, and needs read on all files
<clever> correct, they cant read that file
<clever> yeah
<clever> Myrl-saki: any user can build any .drv in the store
<clever> Myrl-saki: yes
<clever> there is also `nix-store --query --roots` to find all roots
<clever> yeah
<clever> and dont try --force, it can break the machine
<clever> and to clean up the secrets, `nix-store --delete /nix/store/foo`
<clever> that will do it
<clever> then grep the modified things for the secret
<clever> and change your secret file to trigger a rebuild
<clever> you can also try to `ls -l /nix/store/ > a` then deploy, and `> b` and diff a/b
<clever> i think its keyFile
<clever> there is also a .path variant that just copies the file for you
<clever> those arent derivations
<clever> nixops secrets are special
<clever> ah
<clever> the rules are a bit complex
<clever> i'll need a full example to explain what it will do
<clever> just evaluating the expression can copy it to the store
<clever> but if you do mkDerivation { name = "foo"; bar = builtins.readFile ./secret.txt; } then the .drv for foo contains the secret, in the store
<clever> but if you pass a path to readFile, it reads it without copying
<clever> if you pass a path to a derivation, it copies it to the store
<clever> but then whatever you pass that value to, will probably put it into the store in a .drv file
<clever> it just reads them
<clever> readFile wont copy things to the store
<clever> Myrl-saki: are you quoting the relative paths?
<clever> v0id72[m]: this configures everything in vim, i just add imports = [ ./vim.nix ]; to my configuration.nix file
<clever> mpickering: it usually needs more then 1 file, but you could do: nix-build -E 'import (builtins.fetchurl "...")'
<clever> i dont think so
<clever> mpickering: i think you can just give it the URL to a tarball that contains a default.nix
<clever> there is also `nix-instantiate --find-file nixpkgs` for simpler testing
<clever> change NIX_PATH and mess with -I while using nix repl
<clever> and you can just eval <nixpkgs> in `nix repl` to experiment
<clever> so nixpkgs=/path will check for /path/foo.nix
<clever> if you do <nixpkgs/foo.nix> it will search for a dir that contains the foo.nix
<clever> also of note
<clever> if you have nixpkgs=/does/not/exist, then it warns you, and moves to the next element in the search path
<clever> nixpkgs=/path will directly map to that path, while /path without an = maps to /path/nixpkgs
<clever> -I can be used to prepend things to the path
<clever> imalison: <nixpkgs> tells nix to find nixpkgs in $NIX_PATH

2018-06-03

<clever> there is no off switch that i can find
<clever> skype isnt even running...
<clever> also, my windows 10 VM is now getting telemarketer calls over my skype land#
<clever> they wanted the name, not the product
<clever> jD91mZM2: and people still think "skype is good" so they use it
<clever> jD91mZM2: from what ive heard, msn sucked and skype was good, then M$ just bought skype, and turned it into msn, without changing the name
<clever> the new `nix repl` has history, so you can re-run things after closing and opening, but it also has trouble tab-completing things with -'s
<clever> yeah
<clever> rotaerk: nix-repl links to nix1, which cant auto-detect NIX_REMOTE
<clever> rotaerk: you need to either run `nix repl` now, or `NIX_REMOTE=daemon nix-repl`

2018-06-02

<clever> pie__: check xev
<clever> the output it made while building, and any log files it generated in its /tmp/nix-build dir
<clever> samueldr: id say youll need to inspect the script to see what its doing, and then analyze the logs to see why its not doing that
<clever> samueldr: is the nix sandbox enabled?
<clever> Guest51395: unstable only updates when the testing passes
<clever> Guest51395: http://howoldis.herokuapp.com/
<clever> Guest51395: you need to first wait until the unstable channel has updated
<clever> sfultong: its possible that you need to run `nix-channel --update` as root
<clever> sfultong: what are you expecting to file, and what does the other 2 things i mentioned contain?
<clever> sfultong: you can also find them in /root/.nix-channels and `nix-channel --list` when ran as root
<clever> sfultong: yeah
<clever> papika: or under /etc/nixos/
<clever> papika: thats a tempfs, its lost on reboot
<clever> ramfs on /run/keys type ramfs (rw,nosuid,nodev,relatime,mode=750)
<clever> papika: what file appears to be getting deleted?
<clever> generate a new hostkey that works in both?
<clever> colemickens: and to configure that AMI at build time to just work from the first boot
<clever> colemickens: my general idea, is to create an AMI image of your machine using just plain nix, then upload it and configure aws to auto-scale the AMI
<clever> codygman_: ssh also works if enabled
<clever> codygman_: try changing the init= to init=/bin/sh in the grub menu
<clever> and it will probably switch again immediately after you ctrl+alt+f1
<clever> codygman_: its constantly switching between the console and gfx modes
<clever> dont think it has an option for that
<clever> if you know the numbers, you can delete them like this
<clever> removing generation 404
<clever> [root@amd-nixos:~]# nix-env -p /nix/var/nix/profiles/system --delete-generations 404
<clever> and if you garbage collect the wrong generation, or dont know how far back to check...
<clever> after a power outage, it no longer booted, because the network isnt up yet when the activation scripts run
<clever> and then he went 2 months without rebooting
<clever> and it worked fine during nixos-rebuild
<clever> i have seen somebody before put some network stuff into an activation script

2018-06-01

<clever> i prefer to do it manually, so i can undo things when i need to
<clever> yeah
<clever> the --older-than flag
<clever> check the man page for nix-collect-garbage
<clever> lrwxrwxrwx 1 root root 93 May 24 17:08 system-405-link -> /nix/store/6rbfxvn7mmqmb4ilghzgk2n3l8iswp09-nixos-system-amd-nixos-18.09pre135256.6c064e6b1f3
<clever> ls -l /nix/var/nix/profiles/
<clever> so only the stuff from nix-shell and old nix-build's
<clever> by default, it can only delete things not in any generation
<clever> by default, it will only clean up things not in generations
<clever> tenten8401: so you can undo the change even if it stops booting
<clever> tenten8401: nope, and every time you nixos-rebuild, it adds a new option to your bootloader
<clever> tenten8401: there are other options if you want it to run something on login
<clever> tenten8401: the above will build it every time you nixos-rebuild, and put it into $PATH via /run/current-system/sw/bin/
<clever> environment.systemPackages = [ (import /path/to/default.nix) ];
<clever> nix-build for building and testing, nix-env for long-term use
<clever> or youll wind up with 100's of copies of the binary that cant easily be deleted
<clever> so use nix-build and ./result/bin when testing
<clever> and keep in mind, that nix will not let you garbage collect any version installed with nix-env
<clever> if you want it in PATH, nix-env -f default.nix -i i think
<clever> try doing ./result/bin/foo
<clever> how did you try running it?
<clever> but it can still help to have a makefile, so you can run make in nix-shell and do incremental builds while testing and developing
<clever> nope
<clever> tenten8401: you can also just use an installPhase and skip adding an install rule to the makefile
<clever> tenten8401: put that into a default.nix file and then run nix-build
<clever> with import <nixpkgs> {}; clangStdenv.mkDerivation { name = "name"; src = ./.; }
<clever> tenten8401: its generally identical to the nix-shell file, and often you can use the same file for both
<clever> tenten8401: nix-build will create a symlink pointing to the output for you
<clever> tenten8401: i would use nix-build if you want to keep it for any length of time
<clever> tenten8401: yep
<clever> ah
<clever> tenten8401: replace stdenv.mkDerivation with clangStdenv.mkDerivation, nothing scarry about it
<clever> Myrl-saki: there is also the whatis database and makewhatis
<clever> tenten8401: if you want to use clang, then use clangStdenv.mkDerivation, dont add clang to the buildInputs
<clever> tenten8401: what does it depend on?
<clever> tenten8401: use nix-shell to open a shell with those build tools in it
<clever> tenten8401: you should always use nix-shell when you want to build something
<clever> tenten8401: your not really supposed to install anything like build-essential when using nix
<clever> that will bypass the --list
<clever> adelbertc: check the ~/.nix-channels file for both your user and root
<clever> adelbertc: and in that root shell, `nix-channel --update`
<clever> adelbertc: `sudo -i` then `nix-channel --list`
<clever> adelbertc: apple sets the wrong $HOME when you `sudo nix-channel --list` so its not roots channels
<clever> adelbertc: OSX?
<clever> a random man page begins with this line
<clever> .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35.
<clever> Myrl-saki: maybe troff, i never looked into it much
<clever> adelbertc: run nix-channel --list as both your user and root, do they collide?
<clever> Myrl-saki: or just run the man program on the absolute path to it
<clever> Myrl-saki: cat foo.1.gz | gunzip | less
<clever> Myrl-saki: or rather, its a markup language using plaintext, think of it like markdown
<clever> nope
<clever> Myrl-saki: usually under /run/current-system/sw/share/man and ~/.nix-profile/share/man
<clever> adelbertc: yeah
<clever> thats what it should look like in a multi-user install
<clever> lrwxrwxrwx 1 clever users 44 Oct 11 2015 channels_root -> /nix/var/nix/profiles/per-user/root/channels
<clever> lrwxrwxrwx 1 clever users 46 Mar 7 2016 channels -> /nix/var/nix/profiles/per-user/clever/channels
<clever> the channels link shouldnt be pointing to roots channels
<clever> adelbertc: and is this a single-user install?
<clever> adelbertc: which is or isnt root?
<clever> adelbertc: which user is that the home for?
<clever> that usually throws an error, lol
<clever> > { foo = { bar = 1; }; foo.baz = 2; }
<clever> cransom: how many people here have mixed up { foo = { bar = 1; }; foo.baz = 2; } and gotten confused?
<clever> matthewbauer: sounds like its just forcing a 32bit x86 build within the wrong attrset
<clever> and it just returns a naked set
<clever> so your imports section could refer to a yaml.nix, which contains: builtins.fromYAML ./config.yaml
<clever> of note, nixos modules dont have to be functions
<clever> libraries already exist to parse and then re-encode yaml
<clever> ixxie: that would also make it much simpler to edit the yaml file from a gui
<clever> and then i would define options and config in a module elsewhere
<clever> so the yaml would be more along the lines of { custom.fatvim = true; custom.xorg = true; }
<clever> ah
<clever> ixxie: and a list of strings, boot.kernelParams = [ "boot.allow_shell" ];
<clever> ixxie: but how would you encode the difference between a list of references: environment.systemPackages = with pkgs; [ git hello firefox ];
<clever> ixxie: and builtins.fromJSON
<clever> ixxie: there is a yaml2json binary in the yaml package
<clever> matthewbauer: run nix-diff on those 2 drv files, if you have them locally
<clever> matthewbauer: the only time ive seen something being built once in a truely cross-platform way, was when the derivation was simply to unpack and rename some font files, it was flagged as fixed-output, so the build on 1 platform can be used by all others, and nix enforces it building "properly"
<clever> ThatPako: how are you using pkgconfig?
<clever> truthadjustr: it will create the other one automatically every time you boot
<clever> truthadjustr: try running wpa-gui or wpa_gui
<clever> truthadjustr: you may need to tell wpa_cli to use wlp3s0
<clever> truthadjustr: pkgs.wpa_supplicant_gui
<clever> truthadjustr: are you able to install wpa-gui?
<clever> truthadjustr: what happens if you select a different network?
<clever> truthadjustr: and youve done the select from the > prompt inside wpa_cli?
<clever> truthadjustr: run wpa_cli without args, then run scan and scan_results
<clever> truthadjustr: it can only connect to networks that are in scan_results
<clever> truthadjustr: does scan_results show the network?
<clever> truthadjustr: are you sure the ssid and password are correct?
<clever> truthadjustr: are you able to run wpa-gui?
<clever> truthadjustr: what does status say?
<clever> truthadjustr: what does it print when you run select_network 2?
<clever> truthadjustr: does it print anything to the wpa_cli repl?, what does status say?
<clever> truthadjustr: then you should see some events and what its doing
<clever> truthadjustr: try running wpa_cli without args, and use the repl to run select_network and status
<clever> truthadjustr: what does the journal for wpa_supplicant say?
<clever> what files refer to the name?
<clever> find that file somewhere in the nix store of the sdcard, and copy it to the right path in /boot
<clever> yeah
<clever> jophish: its trying to network boot when it continues
<clever> acowley: ah
<clever> codygman: does ctrl+alt+f1 do anything?
<clever> acowley: in general, gcc and llvm shouldnt be in the runtime closure, use nix why-depends to track that down
<clever> acowley: the |sort -h should also tell you what the biggest paths are, so yu can try and trim the fat
<clever> and | sort -h makes sure the total is last
<clever> jophish: the -c in du tells it to output a total for you