2017-05-30

2017-05-29

<clever> you can also do with stdenv.lib; near the top, and then just omit lib. everywhere
<clever> lib is an attribute of stdenv
<clever> nix-repl> lib.length (lib.intersectLists [ 1 2 3 4 ] [ 3 4 5 6 ])
<clever> boomshroom: yep
<clever> nix-repl> lib.intersectLists [ 1 2 3 4 ] [ 3 4 5 6 ]
<clever> [ 3 4 ]
<clever> spinus: yeah, that will wrap the bash with more bash
<clever> boomshroom: lib.intersectLists i believe
<clever> and nixpkgs.config in configuration.nix can take the exact same values, and is used for any package that configuration.nix refers to (like systemPackages or services)
<clever> config.nix is uses for nix-env/nix-shell/nix-build
<clever> { packageOverrides = pkgs: { fooWithBar = pkgs.foo.override { bar = true; }; }; }
<clever> boomshroom: you can also use an override in ~/.config/nixpkgs/config.nix
<clever> boomshroom: usualy with .override
<clever> atemerev: a: you forgot the " at the end, b, you can just do rev = version;
<clever> rev = "${version};
<clever> atemerev: doesnt need pkgs. on each refernece
<clever> spinus: this is a script i wrote a while back, where the whole bash script is inline'd into nix, and i'm inserting absolute paths to packages
<clever> spinus: you need to modify the $PATH inside the bash script to include references to the things your running, or embed absolute paths into the bash scripts
<clever> spinus: and propagatedBuildInputs are only present at build-time for things depending on your package
<clever> spinus: buildInputs are only present at build time
<clever> boomshroom: fetchurl doesnt patchelf on its own, ever
<clever> ah, then you need to use standard patchelf stuff, which is all in the nixpkgs docs
<clever> atemerev: oh, did this problem happen when installing nix, or installing dcos?
<clever> boomshroom: which file did you find that interpreter on?
<clever> *looks*
<clever> atemerev: the install script will also detect 32bit vs 64bit, and get the right tar
<clever> the binaries provided by nix should expect it to be in /nix/store/
<clever> atemerev: do you have noexec set on any of your filesystems
<clever> atemerev: try just curl without |sh, then read the script
<clever> and lib.elem is just an alias of builtins.elem
<clever> yeah, the docs need work
<clever> boomshroom: found it
<clever> nix-repl> lib.elem 5 [ 1 2 3 4 ]
<clever> olejorgenb: can you gist your configuration.nix file?
<clever> ah
<clever> olejorgenb: can you gist that nvidia.nix?
<clever> nn
<clever> sphalerite: and yeah, i should get to bed, its now 4:48 am :P
<clever> and i normally keep things at a third of that
<clever> sphalerite: for example, if i set everything to 100%, the 30 second mark in here can be felt vibrating the desk, lol
<clever> and thats still with a 53% level in pavu
<clever> yeah, i think 100% for extended perioids would wake the neighbors...
<clever> and let me do a quick experiment...
<clever> at 0% its just gone
<clever> at 5% its too loud
<clever> one tick lower, and its on mute
<clever> the volume in the website only moves in 5% increments
<clever> the volume controller in the browser is at 5%, chrome in pulse is at 53%, the master is at 94%, and the external volume on the speakers is at 21
<clever> as an example, i am playing a song on a website right now
<clever> yeah, so i can just type in an absolute number
<clever> so i get 4 times the resolution on the sliders
<clever> under pulse, i can use the master sliders to cut the total volume by 1/4th
<clever> that window isnt resizable
<clever> nope
<clever> and the mouse just isnt sensitive enough to set that well :P
<clever> i had to keep it like 3 or 4 pixels from 0 at all times
<clever> the problem, is that my headset is too loud, by default
<clever> so if you turn the master down to 5%, then you can only use 0% to 5% on the applications
<clever> the master volume slider in its mixer, doesnt scale the applications, it sets a max
<clever> i recently had the "pleasure" of running windows again, lol
<clever> oh, and speaking of audio problems
<clever> in a pure manner
<clever> it would let you sed the libc or openssl path, recursively, on an entire nixos build
<clever> yeah
<clever> one of the security patch things can already do that, recursively, to all of nixos
<clever> ah, thats where i put it
<clever> 4 src = /home/clever/x/pulseaudio-7.1-modified;
<clever> sphalerite: its part of this motherboard
<clever> 00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
<clever> and where did i even leave that patch? ... lol
<clever> so i had to patch pulseaudio to even get that working
<clever> and pulseaudio doesnt support using an index in the profile config
<clever> but every mux has the same name
<clever> the card has a mux for every port, so you can switch them between the internal pipelines
<clever> and also, pulse doesnt support a critical feature i needed
<clever> the profiles are stored in the pulseaudio derivation
<clever> and nix requires all of pulseaudio to be recompiled to change those config files
<clever> my card is missing a lot of profiles
<clever> yeah, as viewed by pulseaudio
<clever> i have played with that area of pulse before, because my card happens to have 3 pipeliness, and can potentialy drive the front, rear, and digital all at once, with different content
<clever> which mutates all of the routing config within pulseaudio
<clever> ah, because the profile on the configuration tab changed
<clever> and i even loose the option to send the audio back to the digital output
<clever> sphalerite: the instant i plug headphones into the front jack, it says headphones
<clever> sphalerite: heh, i opened pavucontrol, went to the "output devices" tab, and the built-in audio was on digital output (the optical jack on the back)
<clever> add in headphones, and you have an instant heart-attack and deafness :P
<clever> on the other hand, i have other laptops, where the console beep is ear-splittingly loud, at the lowest setting
<clever> so console beeps would leak whatever you where trying to listen to privately, to the whole room
<clever> so you would get a mix of beep + music, on the case speaker
<clever> but it only had 1 dac
<clever> i had one card, that would switch back to the laptop speaker for pc-beeps
<clever> with some cards, you can manualy switch between the speaker and headphone in alsamixer
<clever> sounds similiar to what ive noticed, the state in software was out of sync with the state in hardware
<clever> ah
<clever> sphalerite: try restarting pulseaudio after resuming, and see if that fixes it?
<clever> and then youll be the one finding all of those bugs
<clever> you would have to manualy clone nixpkgs master and set nixos-rebuild to use that
<clever> to prevent broken stuff from reaching users
<clever> it builds pretty often, but all tests must pass before nixos-unstable will update
<clever> sophiag: it looks like the virtualbox images failed to build, so the nixos-unstable channel is being held back
<clever> sophiag: nixos-unstable is 4 days old, and doesnt include the spotify fix
<clever> one min
<clever> nixos-unstable was listed by the sudo nix-channel --list?
<clever> nix-env -iA will use the channel you name
<clever> nixos-rebuild will always use the channel called "nixos"
<clever> and what if you do nix-env -iA nixos.spotify
<clever> sophiag: can you gist the output of "nix-channel --list ; sudo nix-channel --list" ?
<clever> cfdisk doesnt format things
<clever> you also need to format it with mkswap
<clever> and you can also re-run nixos-generate-config from inside the machine, to update the current config
<clever> it will only detect it if you swapon first
<clever> double-check the contents of hardware-configuration.nix
<clever> nixos-generate-config will also auto-detect your swap,and add it to hardware-configuration.nix for you
<clever> swapDevices = [ { device = "/dev/disk/by-uuid/d3b24b26-4386-4ff6-89d3-0bb5f8601ff0"; priority = 5; } ];
<clever> anything else, or a list
<clever> some programs have a checkbox for ctrl and alt, so you can "hold" them in software
<clever> dont remember, youll need to check the menu's
<clever> try logging in as root?
<clever> id try rebooting now and trying to login
<clever> sounds a bit weird, did you leave the old install there when you re-mounted things and redid nixos-install?
<clever> < clever> just initialPassword = "hunter2";, not babs.initialPassword
<clever> you still have a babs inside the babs attribute
<clever> imgur
<clever> can you screenshot the console?
<clever> just initialPassword = "hunter2";, not babs.initialPassword
<clever> so nixos-install --chroot and passwd should now work
<clever> that setting only has an effect when first creating a user
<clever> and also, because you booted the install, the babs user now exists, so initial no longer applies
<clever> Nobabs27: just initialPassword = "hunter2";
<clever> Nobabs27: which means you can remove users.extraUsers.babs from everything inside it
<clever> Nobabs27: line 75 is a block that says users.extraUsers.babs = {
<clever> but you can also gist --login
<clever> by default, it will be annonymous
<clever> Nobabs27: nix-env -iA nixos.gist ; gist -p /mnt/etc/nixos/configuration.nix
<clever> Nobabs27: can you gist your configuration.nix file?
<clever> joepie91: ah, i could probably find a use for one of those
<clever> Nobabs27: users.users.babs.initialPassword = "hunter2";
<clever> what exact command gave the error, and what exact error did it give?, nixos-install shouldnt be able to say that a user doesnt exist
<clever> strange, what other commands did you run?, it should definitely have existed after booting
<clever> users.extraUsers is an alias of users.users
<clever> and was nixos-install re-ran after the change?
<clever> was it inside the users.users.foo block for your user?
<clever> and nixos will set that when creating it on bootup
<clever> yeah, you can add .initialPassword = "hunter2";
<clever> it has to boot at least once, then its simpler to just login as root and passwd
<clever> that doesnt run the activation scripts, so the /etc/passwd isnt updated yet
<clever> *looks*
<clever> normal chroot or nixos chroot?
<clever> so if you add that setting and reboot, it wont change the pw
<clever> and the initial options only apply when nixos initialy makes the user
<clever> Nobabs27: nixos-install will only ask for the root password, you have to either run passwd to set all others, or set something like .initialPassword or.initialHashedPassword
<clever> causing the opensource driver to re-crash every time i login
<clever> xfce also tries to help too much, and restores the dual-monitor config on login
<clever> the unfree amd driver crashes xorg if i unplug the 2nd monitor while its active
<clever> the opensource amd drivers crash xorg if i turn on 2 monitors
<clever> i rely on too much unfree garbage
<clever> ive heard of it but havent really looked into it
<clever> you could then do "exec /nix/var/nix/profiles/system/init" when done, to resume the boot
<clever> so the shell entirely replaces your init system
<clever> it runs that shell as pid 1 uid 0
<clever> there are many things you can set init to
<clever> but for nixos, init=/bin/sh only works if it has booted once, oh, and /run/current-system might not work right
<clever> for any normal linux system, you can do something like init=/bin/bash
<clever> so if somebody have physical access, and your not using luks, all passwords are pointless
<clever> and then f10 to make grub run the modified config without saving
<clever> from grub, you can hit e to edit any boot entry, add init=/run/current-system/sw/bin/bash
<clever> you can force root even without a cd, if you have physical access
<clever> so you dont want to block root entirely
<clever> in some cases, like running sshd in single-user mode, you can only use root and no other account
<clever> but still allow root with a keypair
<clever> i generaly set this once the install is done (or sooner)
<clever> 85 openssh.passwordAuthentication = false;
<clever> at a tty or ssh?
<clever> user, group, file permissions, timestamps
<clever> more that it just removes anything thats not strictly nessesary or an impurity
<clever> but nix also requires that every file in /nix/store be world-readable
<clever> and if your using remote build slaves, nix knows it needs that file, and can copy it to the remote worker
<clever> and if you change the file, everything that depended on its contents gets recompiled
<clever> any unquoted path will be hashed, and stored at /nix/store/<hash>-name, so it becomes immutable
<clever> but you must also ensure the file still exists at every boot
<clever> but passwordFile = "/etc/nixos/foo.txt"; wont, and you can make it root-only
<clever> passwordFile = ./foo.txt; will automaticaly copy it into the store and make it world readable
<clever> and if it is quoted, it has to be an absolute path
<clever> if the path isnt quoted
<clever> mellowmaroon: also, keep in mind that the passwordFile gets embeded into /nix/store/ and is world-readable
<clever> ah
<clever> mellowmaroon: also, is mutableUsers set to true(the default)?
<clever> mellowmaroon: does the passwordfile contain a \n?, read it again with "hexdump -C"

2017-05-28

<clever> not sure where i put the other more recent examples
<clever> https://gist.github.com/cleverca22/9f35e7ae8f5030bfec332efd178eb1ef an arm example i made ~8 months ago
<clever> hydraz: if you import <nixpkgs> and set crossSystem correctly, it will enable the use of cross-compilers
<clever> but replugging it resends the state change and fixes it
<clever> and in some of my systems, pulseaudio must actively initiate the switch, and it doesnt work if the headphones are plugged in while pulse is off
<clever> dash: headphone jacks in modern hardware have a switch to detect the presence and switch over actively
<clever> sphalerite: double-check pavucontrol while plugging it in
<clever> not sure then
<clever> pbogdan`: are those things in the buildInputs already?
<clever> ircuser5678: you can also 'man configuration.nix'
<clever> it will always come back at boot or switch
<clever> oh, and i often delete the /etc/nix/machines symlink to temporarily turn remote builds off
<clever> it might be that some env variables like NIX_BUILD_HOOK had been cleared accidentaly
<clever> strange
<clever> freusque2: --option binary-caches ""
<clever> what error does it fail with?
<clever> and you dont have any import <nixpkgs>{}'s anywhere in your expresions?
<clever> LnL: are you using your own default.nix or the nixpkgs/default.nix?
<clever> its the only service that does that
<clever> the ssh service automaticaly opens the port you set it to
<clever> now it will read the config from the other service, and always be right
<clever> networking.firewall.allowedTCPPorts = [ config.services.nix-serve.port ];
<clever> oh, you can also do this
<clever> networking.firewall.allowedTCPPorts = [ 1234 ];
<clever> nixos has a firewall enabled by default
<clever> so it will check the binary caches for a linux version
<clever> which will force nix-build to do a linux build, even on a mac
<clever> you can also do `nix-build '<nixpkgs>' -A hello --argstr system x86_64-linux`
<clever> heh
<clever> only the 2 involving binary-cache are needed for what you wanted
<clever> you can use the one on nixos as an example
<clever> so youll need to create your own in /etc/nix/nix.conf
<clever> on a mac, it wont exist by default
<clever> you will also need to generate a keypair (the nix-store manpage explains that), give nix-serve the secret, and put the public in nix.conf
<clever> boomshroom: you can run nix-serve on the desktop, and then set it up as a binary cache in nix.conf
<clever> you would need to manualy add /Users/foo/.nix-profile/bin/bash to /etc/shells
<clever> that also works, but requires them to know the path
<clever> mbrock: if the channel is named "foo" in nix-channel --list, then you can just nix-env -iA foo.firefox
<clever> so you can just read $NIX_PATH to see the priority
<clever> for nix-build/nix-shell it will obey $NIX_PATH
<clever> when using nix-env -iA, you directly give it a channel name
<clever> it normally just works
<clever> cant think of anything else to check
<clever> try it without the config.fish temporarily
<clever> ive got an idea as to whats going on
<clever> ah, try commenting that out, then ssh in and try tmux
<clever> oh, does your .fishrc or similiar do things like mess with $PATH?
<clever> what does /etc/passwd say the shell is?
<clever> try fixing just line 80
<clever> ah, then shells is probably fine
<clever> which is from line 80
<clever> check passwd though, you should see that the shell in there isnt set right
<clever> 38 might also be a problem
<clever> that needs to be "${pkgs.fish}/bin/fish";
<clever> line 80 is wrong
<clever> boomshroom: can you gist the configuration.nix?
<clever> ive run into similiar problems when trying to package gradle stuff in nix
<clever> yeah, i would keep a git repo with nix+cargo.lock pairs, you could just overwrite them, and let git history keep the history
<clever> about all i can think of is to run "cargo generate-lockfile" inside a nix-shell against a copy of $src
<clever> but once upstream changs things, generate-lockfile will make something differnt, and fetch just fails
<clever> i was thinking a fixed-output derivation can generate the cargo.lock
<clever> ah wait, what i was thinking wont work right
<clever> boomshroom: what is the command you run to generate a cargo.lock?
<clever> and nix uses a slightly different algo for hashing $out, so you cant reuse hashes upstream gives
<clever> boomshroom: so your free to do pretty much whatever you want in there, as long as its reproducable, and you declare the final hash (nix-build will tell you the right one)
<clever> boomshroom: any derivation that defines these 3 attributes is fixed-output, it will get network access, and the hash of $out must match what it declared
<clever> boomshroom: though if you flag it as fixed-output, you can get network, but youll need to run that generate step twice
<clever> boomshroom: nix does a good deal to ensure all builds are pure, so a normal nix build cant get network access to query things and make the cargo.lock
<clever> yep
<clever> nixpkgs.config.packageOverrides = pkgs: { dosbox = pkgs.dosbox.overrideAttrs (oldAttrs: ...); }
<clever> yeah
<clever> it works the same way
<clever> that applies the overrides before all the renaming happens
<clever> overrideAttrs was recently added to simplify things
<clever> which is why the above didnt work
<clever> overrideDerivation happens after stdenv does messy things like renaming buildInputs to nativeBuildInputs
<clever> ToxicFrog: did you use overrideAttrs?

2017-05-27

<clever> gchristensen: pong
<clever> its 3am here
<clever> "2017-05-27 02:53:19 bedroom temp: 23.00c(73.40f), kitchen: 22.44c(72.39f), living room: 21.75c(71.15f), outdoor: 8.38c(47.08f), server: 23.69c(74.64f) VCC: over 4.5 volts portb: 00000000"
<clever> it was snowing like 2 weeks ago, lol
<clever> i'm way up in canada
<clever> yeah
<clever> so you can try it out on any cmake project
<clever> cmake is also able to generate ninja files
<clever> tywkeene: its like make
<clever> i'm also a vim user
<clever> dont recreate the graph in #1445 above
<clever> and while it has no persistant storage, i do have nix-daemon working, and it can be a build slave
<clever> custom stage-1 script in the initrd, runit for an init system, squashfs rootfs
<clever> i have also made a custom distro based on nix/nixos, that is about 47mb installed