2018-12-20
15:09
<
clever >
also hand, `/run/current-system/bin/switch-to-configuration test` will "repair" /etc/
15:08
<
clever >
behind the scenes, nixos-rebuild just calls nix-env for you, to update the profile, and then run switch-to-configuration on that new build
15:08
<
clever >
that will take the current version of the profile, and either make it the boot default, apply it to the running system, or both
15:07
<
clever >
/nix/var/nix/profiles/system/bin/switch-to-configuration {boot|test|switch}
15:07
<
clever >
that will switch the profile to the given generation, but not apply it to the running os
15:07
<
clever >
jtojnar: nix-env --profile /nix/var/nix/profiles/system --switch-generation 123
15:06
<
clever >
jtojnar: aha, --switch-generation
15:06
<
clever >
jtojnar: hmmm, that one also lacks the right flag
15:05
<
clever >
jtojnar: i think you want nix-env --rollback
15:05
<
clever >
i didnt need containers in my case
15:04
<
clever >
while less locked down, it was far simpler to make 10 systemd units on each machine
15:03
<
clever >
which turned into 110 evals of nixos
15:03
<
clever >
j_r0m: i ran into similar problems with i had a nixops deployment with 10 machines, each having 10 containers
15:02
<
clever >
j_r0m: each container shares the host store, but adding 10 containers to nixos, will make nixos-rebuild require 11 times as much ram to eval
14:54
<
clever >
and i only used it on a machine i didnt care about bricking
14:54
<
clever >
only 3 systems i have support read, and only 1 of those supports erase&write
14:53
<
clever >
samrose: but it also heavily depends on flashrom supporting your motherboard
14:53
<
clever >
samrose: yep
14:43
<
clever >
samrose: but i only flashed it with a copy i had previously read, and was just confirming erase&write works, no actual version change occured
14:43
<
clever >
samrose: i was able to use flashrom on a random server, to erase and then re-flash the bios
2018-12-19
01:21
<
clever >
so it doesnt need to be in LD_LIBRARY_PATH
01:20
<
clever >
lucus16: there are also flags to add it to the rpath of the binaries it generates
01:15
<
clever >
lucus16: there is a setup hook to add it to something like NIX_LDFLAGS, check `env | grep LDFL`
00:57
<
clever >
that lets you load a given nix file, and install a given attr inside it
00:57
<
clever >
pie__: nix-env -f foo.nix -iA bar
2018-12-18
23:55
<
clever >
pie____: thats generally where i start
23:55
<
clever >
strace -ff -o logfiles foobar
23:53
<
clever >
pie____: i happened to use this, but nix repl is good to tab-complete things
23:52
<
clever >
$ nix-build '<nixpkgs>' -A libxml2.out --no-out-link
23:52
<
clever >
/nix/store/72mxkk74cv266snkjpz1kwl1i2rg8rpc-libxml2-2.9.8
23:51
<
clever >
split outputs, the default is .bin, which lacks libraries
23:50
<
clever >
jomik: try adding libxml2.out to the array where zlib is
23:50
<
clever >
pie____: nix-locate
23:49
<
clever >
jomik: its a dep of python
23:49
<
clever >
,locate libxml2.so
23:42
<
clever >
thats also why i avoid installing any dev tools at all
23:41
<
clever >
jomik: youll want ${patchelf}/bin/patchelf then
23:41
<
clever >
jomik: i think patchelf was installed by default on nixos for ages
23:41
<
clever >
jomik: oops!
23:38
<
clever >
steam uses an fhsenv, because there are just too many things to patch, that update on their own, and may get upset if you try to patch them
23:37
<
clever >
jomik: thats about the only good reason to use steam-run and/or the build fhsenv stuff
23:36
<
clever >
jomik: and nix isnt aware that the ELF file needs those libs, so it will fail too
23:36
<
clever >
jomik: yeah
23:36
<
clever >
and that stops the gc from eating the bash
23:35
<
clever >
the nix-build command always creates an indirect root in the current dir, called result, by default
23:35
<
clever >
and it will then embed that zlib and glibc path into the ELF you ran it on
23:35
<
clever >
jomik: that bash script depends on zlib and glibc
23:34
<
clever >
jomik: when you nix-build the nix file, it creates a gc root pointing to the built bash script
23:33
<
clever >
the result symlink produced by nix-build, will also root all libraries, so a GC wont delete them on you
23:33
<
clever >
if you then run that bash script on a random ELF, it will patch it for you
23:33
<
clever >
jomik, pie: if you nix-build the file in that gist, it will generate a bash script
23:22
<
clever >
the above command will create a result symlink that behaves exactly the same as the result nix-build makes
23:22
<
clever >
iqubic: nix-store -r /nix/store/foo --add-root result --indirect
23:22
<
clever >
iqubic: it will
23:19
<
clever >
iqubic: run the chromium binary on the path to the file
23:09
<
clever >
ah, thats odd then
23:08
<
clever >
2018-12-18 19:07:31 < iqubic> pie____: Nope. No controller support on the demo on firefox.
23:08
<
clever >
iqubic: did you try the html5 gamepad test in firefox and chrome?
23:02
<
clever >
iqubic: what happens when you run /nix/store/cjnkqww1pd5ak02369wqaqdr1s5i0jay-chromium-70.0.3538.77/libexec/chromium/chromium ?
22:59
<
clever >
it will not be added to any profiles
22:58
<
clever >
iqubic: nix-store -r /nix/store/foo will just download /nix/store/foo, and its deps
22:58
<
clever >
iqubic: /nix/store/cjnkqww1pd5ak02369wqaqdr1s5i0jay-chromium-70.0.3538.77/libexec/chromium/chromium
22:56
<
clever >
iqubic: try browsing this page
22:52
<
clever >
iqubic: run this command to download the same chrome i have, then run the chrome binary in its /bin dir, to start it
22:52
<
clever >
2018-12-18 18:37:29 < clever> nix-store -r /nix/store/cjnkqww1pd5ak02369wqaqdr1s5i0jay-chromium-70.0.3538.77
22:47
<
clever >
pick a random one from a month or 2 ago
22:46
<
clever >
ldlework: if you boot an older generation of nixos, does it come back?
22:46
<
clever >
lspci wouldnt show a mic
22:45
<
clever >
ldlework: pavucontrol?
22:37
<
clever >
to get the exact version of chrome i use
22:37
<
clever >
nix-store -r /nix/store/cjnkqww1pd5ak02369wqaqdr1s5i0jay-chromium-70.0.3538.77
22:37
<
clever >
works perfectly
22:36
<
clever >
there was some demo url that let you just play it in a browser
22:36
<
clever >
pie____: for the game
22:35
<
clever >
pie____: what was the URL?
22:35
<
clever >
pie____: i'm using the open source chromium, not the google blob
22:34
<
clever >
and .xsession
22:33
<
clever >
Judson: that script is responsible for starting your session of choice, and dealing with .xinit and .xprofile
22:32
<
clever >
Judson: one sec
22:32
<
clever >
pie____: probably, but i just have it installed noramlly
22:32
<
clever >
pie____: gamepad just worked with zero config in chrome
22:31
<
clever >
pie____: ive only gotten it to work in chrome so far, havent tried under steam
22:29
<
clever >
Judson: xterm can sometimes wind up being the default
22:29
<
clever >
Judson: did you select a desktop manager at the login screen?
22:28
<
clever >
the error tells you where
22:28
<
clever >
then you need to make one
22:27
<
clever >
2018-12-18 18:15:14 < clever> you must use config.nix for nix-shell
22:27
<
clever >
2018-12-18 18:15:10 < clever> pie____: nix-shell never uses configuration.nix
22:26
<
clever >
iqubic: config.nix still needs an allowUnfree = true;
22:24
<
clever >
nix-shell -p "steamPackages.steam-chrootenv.override { extraPkgs = [ gtk3 ]; }" for ex should work
22:24
<
clever >
pie____: shouldnt need the import at all
22:19
<
clever >
which allows testing it without any secrets present
22:19
<
clever >
kandinski: `optionalAttrs (builtins.pathExists ./clever_router.ovpn)` is optional, it just makes the rest of that code silently do nothing if the config is missing
22:15
<
clever >
you must use config.nix for nix-shell
22:15
<
clever >
pie____: nix-shell never uses configuration.nix
22:11
<
clever >
so the nixos options dont understand it
22:11
<
clever >
pie____: nixpkgs.config is just a free-form attrset, containing the same thing as the normal config.nix for nixpkgs
22:11
<
clever >
pie____: oops wait, its nixpkgs.config.allowUnfree
22:11
<
clever >
pie____: steam-run is to run steam like games, in the same sandbox, without the steam ui
22:10
<
clever >
pie____: nixpkgs.allowUnfree
21:58
<
clever >
yeah, thats the tricky part, the steam stuff is a bit of a maze
21:57
<
clever >
nix-shell -p 'hello.override {}'
21:53
<
clever >
pie____: oh, then you could likely do it via .override
21:41
<
clever >
and then build and use the steam from that nixpkgs clone
21:41
<
clever >
iqubic: try editing the nix file like in the above commit, to add gtk to steam
20:54
<
clever >
i would just patch the steam expression to include gtk
20:47
<
clever >
so even if i plug in the receiver, the usb gamepad doesnt exist, until i turn on the controller itself
20:47
<
clever >
and the adapter dynamically creates/destroys usb devices, as they connect wirelessly
20:46
<
clever >
and for extra fun, i'm using an xbox controller, with a usb<->rf adapter
20:46
<
clever >
but the html5 gamepad api doesnt care
20:46
<
clever >
so i must plug it in, before loading the game
20:46
<
clever >
mostly, the game only checks for a gamepad at startup
20:45
<
clever >
i had more gamepad problems in proper native games, lol
20:45
<
clever >
pie____: i cant remember the link, but ive just opened it directly in chrome before, and the gamepad just worked
20:34
<
clever >
how did you try to paste?
20:33
<
clever >
just select text with the mouse, thats it
20:33
<
clever >
iqubic: you dont have to ctrl+c, ever
20:32
<
clever >
iqubic: middle click to paste it
20:32
<
clever >
iqubic: the selection buffer, any text you select, in any app, is in the selection buffer
20:32
<
clever >
iqubic: that would explain how well it works in the browser
20:31
<
clever >
shapr: probably the default for nixos
20:30
<
clever >
iqubic: i dont know how they did it, but crosscode works in the browser, and even supports gamepads, in javascript
15:44
<
clever >
,profile djahandarie
04:40
<
clever >
should have just worked
04:37
<
clever >
nornagon: how did you image the livecd?
2018-12-17
22:53
<
clever >
rycee: ./. is going to have the identical effect, without any runCommand (if bin is the only thing in . )
15:27
<
clever >
pietranera: put both into buildInputs?
15:13
<
clever >
if you want to refer to a package, you need to get the pkgs set somehow
15:13
<
clever >
--arg myList '[ { a=1;} {b=2;} ]'
15:12
<
clever >
you can only pass it a list that fully defines all values
15:12
<
clever >
and then call the function and pass it all pkgs
15:11
<
clever >
you want `--arg extraPkgs 'pkgs: [ pkgs.git ]'
15:11
<
clever >
pkgs isnt in scope when parsing `--arg`
15:10
<
clever >
pietranera's
15:10
<
clever >
pietranera: just note, that only works if `shell.nix` begins with { myList ? [] }:
15:09
<
clever >
tilpner: that should work perfectly
2018-12-15
22:19
<
clever >
root will fail to do anything
22:19
<
clever >
but when non-root, it can also use the root channels
22:18
<
clever >
it doesnt know which nixos is nixos
22:18
<
clever >
thats why its giving an error
22:16
<
clever >
do `nix-channel --list` as root, and not-root, and youll see that
22:16
<
clever >
you have 2 channels called nixos
22:13
<
clever >
fyuuri: can you pastebin the output of this?
22:13
<
clever >
ls -l ~/.nix-defexpr/*/*
22:10
<
clever >
`which --all foo` will show if duplicates do exist
22:10
<
clever >
the first one in PATH
22:09
<
clever >
and its just a matter of having all 3 in $PATH, echo $PATH to see that
22:09
<
clever >
nix-env as root, controls the default profile
22:09
<
clever >
and when you use nix-env -i/-e/-u, it will mutate a copy of that manifest.nix, and then build a new version of the profile based on it
22:08
<
clever >
nix-env will use <nix/buildenv.nix> to merge all packages in ~/.nix-profile/manifest.nix into a single derivation
22:07
<
clever >
which (by default) goes into the channels profile
22:06
<
clever >
and nix-env -iA foo.bar will use ~/.nix-defexpr/ to find foo
22:06
<
clever >
lrwxrwxrwx 1 clever users 46 Aug 24 18:15 .nix-defexpr/channels -> /nix/var/nix/profiles/per-user/clever/channels
22:06
<
clever >
the channels profile is managed by nix-channel
22:06
<
clever >
lrwxrwxrwx 1 clever users 15 Aug 24 18:15 /nix/var/nix/profiles/per-user/clever/channels -> channels-2-link
22:06
<
clever >
if its in $HOME, then problems will happen at GC
22:06
<
clever >
the profile should always be in /nix/var/nix/profiles/per-user/$USER/profile
22:03
<
clever >
fyuuri: profile is from nix-env, channel is from nix-channel
22:03
<
clever >
fyuuri: depends on if root has actually installed anything with nix-env
21:59
<
clever >
--update will sync the channels profile to that
21:58
<
clever >
--add and --remove just adjust ~/.nix-channels , a plain text file
21:57
<
clever >
etu: did you nix-channel --update ?
21:55
<
clever >
think of it like #include <dbus/dbus.h> in c/c++
21:55
<
clever >
oh, but you want <home-manager/nixos>
21:50
<
clever >
and default is also in everybody else's PATH
21:50
<
clever >
fyuuri: default is just nix-env from root
2018-12-13
19:47
<
clever >
runCommand "name" { buildInputs = []; } "cat ${./foo.txt} | bar > $out"
19:47
<
clever >
ToxicFrog: then you just want runCommand
19:46
<
clever >
pkgs.substituteAll
19:45
<
clever >
ToxicFrog: one sec
19:44
<
clever >
i dont think so
19:41
<
clever >
cbarrett: nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz -p hello
08:59
<
clever >
dermetfan: ive not used it yet
08:56
<
clever >
dermetfan: i believe so
2018-12-12
22:52
<
clever >
i need to head off to bed now, goodnight
22:50
<
clever >
yeah, far simpler then the other project i had started and linked above
22:49
<
clever >
those 3 options will just run qconf, gconf, or mconf
22:49
<
clever >
programs also have embedded help text. Be sure to check that for
22:49
<
clever >
The xconfig ('qconf'), menuconfig ('mconf'), and nconfig ('nconf')
22:45
<
clever >
elvishjerricco: there is already a graphical config option in the kernel
22:42
<
clever >
no point in having ESP options when uefi isnt selected
22:42
<
clever >
and options can dynamically hide themselves, based on others
22:42
<
clever >
elvishjerricco: menuconfig just lets you browse things, and choose what you want
22:42
<
clever >
elvishjerricco: thats the difference between menuconfig and i think oldconfig
22:39
<
clever >
and it will spit out a bash script
22:39
<
clever >
what if i just make a Kconfig format menu, to let you configure most of the nixos install
22:38
<
clever >
busybox, and others, have "stolen" that ui, for their own config
22:38
<
clever >
the linux kernel config, and `make menuconfig`
22:38
<
clever >
oh, i just had an idea
22:37
<
clever >
Mic92: that might cause more confusion, when users try to run grub-install manually
22:36
<
clever >
elvishjerricco: i have started such things before
22:36
<
clever >
or have a program that can quiz you, and do it right
22:36
<
clever >
you either need to have an install guide that shows the "right" way to do it, or just info-dump how everything works and hope they can fit the puzzle pieces together
22:35
<
clever >
Mic92: the tricky part, is that there are so many different choices, you basically need to run the user thru a whole quiz, and then generate a list of steps to make it happen
22:34
<
clever >
if you make a bios boot partition, then you can still do legacy booting on gpt disks
22:33
<
clever >
and uefi is not required when using gpt
21:51
<
clever >
growpotkin: it has to be manually enabled, with things like nix-serve or hydra
21:48
<
clever >
jomik: you can use the imports list on any module, to give paths to more modules
21:44
<
clever >
dgarzon: something like this
21:44
<
clever >
writeScriptBin "foo" (lib.concatMapStringsSep "\n" (x: "nix-store -r ${x}") (builtins.fromJSON (builtins.readFile (fetchurl ...)))
21:43
<
clever >
> lib.concatMapStringsSep "\n" (x: "nix-store -r ${x}") [ "a" "b" "c" ]
21:40
<
clever >
dgarzon: what exactly do you want to do with that json?
21:38
<
clever >
an object cant be unpacked
21:38
<
clever >
dgarzon: thats no longer a file, but an object
18:01
<
clever >
but you would need to fix every "misbehaving" program in the system...
18:00
<
clever >
Jomik: prefix PATH correctly when running something, and then let PATH do its thing
17:58
<
clever >
and there is hnix
17:56
<
clever >
gchristensen: taktoa was looking into that a year or 2 ago
15:08
<
clever >
typetetris: nix-build '<nixpkgs>' -A hello.src
15:08
<
clever >
typetetris: nix-store --query --binding src /nix/store/foo.drv
15:04
<
clever >
but to create the file that nix var was going to go into
15:04
<
clever >
yeah, you would have to restructure it, to not need the answer in a nix var
15:03
<
clever >
its just a normal build of a file
15:03
<
clever >
your not importing the result back to nix, so its not expensive like IFD
15:02
<
clever >
mkaito: the ip-magic above doesnt use IFD, but relies on a custom cpp program to generate the file in question
2018-12-11
23:26
<
clever >
and then just wait for a root pw
23:26
<
clever >
the idea behind that one, is to hit it before you login at a console, because anybody could sign in, and then just run a program that prints `login:`
23:25
<
clever >
iqubic: sysrq+k will kill everything on the current tty
23:25
<
clever >
iqubic: alt+printscreen == sysrq
23:23
<
clever >
there is both ctrl+alt+backspace, and the sysrq sak key
23:16
<
clever >
gchristensen: ctrl+alt+backspace, it should be in the xorg man page
21:53
<
clever >
nix-env will merge everything together as it scans .nix-defexpr, and doesnt really care if something "non-standard" like test/foo/default.nix turns up
21:52
<
clever >
and the channels symlink for non-root users, points to the channels profile of that user
21:52
<
clever >
channels_root on non-root users also points there, so you inherit roots channels
21:52
<
clever >
lrwxrwxrwx 1 root root 44 Nov 26 09:52 /root/.nix-defexpr/channels -> /nix/var/nix/profiles/per-user/root/channels
21:52
<
clever >
Jomik: [root@amd-nixos:~]# nix-env --profile /nix/var/nix/profiles/per-user/root/channels --list-generations
21:51
<
clever >
Jomik: into a secondary nix-env profile, that channels and channels_root point to
21:51
<
clever >
since you can just use whatever nix you want to define it, and it could just be a fetchTarball call
21:50
<
clever >
Jomik: i prefer that over adding file:/// urls as a channel
21:50
<
clever >
akavel: i dont think you can browse, you need to eval your own nixpkgs, to know what hashes to expect
21:50
<
clever >
Jomik: channels vs channels_root is already doing that
21:50
<
clever >
Jomik: any parent directories that it recurses thru, are basically ignored, so the `test` dir is just a way to group channels, and use normal linux permissions to restrict who can modify them
21:49
<
clever >
Jomik: nix-env will recursively search for either a foo.nix, or a foo/default.nix, and then create a channel called foo
21:48
<
clever >
akavel: cache.nixos.org is the URI
21:44
<
clever >
Jomik: that creates a "channel" called foo, so you can just nix-env -iA foo.hello
21:44
<
clever >
import /home/clever/apps/nixpkgs
21:44
<
clever >
[clever@amd-nixos:~]$ cat .nix-defexpr/test/foo/default.nix
21:44
<
clever >
Jomik: there is a much simpler way for custom channels
17:00
<
clever >
jonaswouters: i believe all fonts must be in the fonts.fonts option in configuration.nix
01:32
<
clever >
ottidmes: you can trivially add more args to all modules
01:21
<
clever >
> pkgs.path + "/pkgs/top-level/all-packages.nix"
01:21
<
clever >
ottidmes: pkgs.path + "/pkgs/top-level/all-packages.nix"
01:16
<
clever >
ottidmes: like so?
01:16
<
clever >
> let __nixPath = [ { path = ./.; prefix = "bar"; } ]; in <bar>
01:08
<
clever >
there is an example of that in the nixops source
01:08
<
clever >
but, you can use it to overwrite the import function, to force the files you import, into using a wrapper, that calls scopedImport again
01:08
<
clever >
and it cant leak backwards up the call stack
01:07
<
clever >
it will only impact the exact files loaded with scopedImport, and nothing else
01:03
<
clever >
ottidmes: but note, scopedImport breaks the import cache, so the performance will suffer
01:03
<
clever >
ottidmes: scopedImport also lets you overwrite the import function, to make its effects recursive
00:23
<
clever >
and scopedImport allows you to inject things into the "global scope" of another file, as you import it (non-recursive)
00:23
<
clever >
and then it does normal var lookup on __findFile and __nixPath
00:23
<
clever >
> __findFile __nixPath "nixpkgs"
00:23
<
clever >
ottidmes: behind the scenes, <nixpkgs> gets translated into (__findFile __nixPath "nixpkgs")
00:20
<
clever >
ottidmes: you can use scopedImport to mess with __nixPath
2018-12-10
20:33
<
clever >
techieAgno2tic: i gave an example above
20:24
<
clever >
arianvp: it could be that it failed to build on hydra, and thats why its not in the cache
20:21
<
clever >
> pkgs.runCommand "name" { buildInputs = [ imagemagick ]; } "mkdir $out ; convert ${./input.png} $out/output.jpg"
20:21
<
clever >
then the nix sandbox can fully enforce purity
20:20
<
clever >
techieAgno2tic: try using pkgs.runCommand, and nix-build