2021-01-07
22:24
<
clever >
eacameron: there is a replacement in nixpkgs itself now, let me see...
2021-01-06
23:37
<
clever >
and (nearly) everything under builtins, is written in c++, and part of the nix binary itself
23:36
<
clever >
oh, but lib.filter, is just an alias to builtins.filter
23:36
<
clever >
> builtins.filter (x: x<5) [ 1 3 6 7 ]
23:36
<
clever >
fuzzypixelz: it also has a lot of util funtions
23:36
<
clever >
> builtins.foldl' (a: b: "${a}, ${b}") "first" ["second" "third"]
23:35
<
clever >
`nix repl <nixpkgs>`
23:35
<
clever >
its within nixpkgs
23:35
<
clever >
> lib.filter (x: x<5) [ 1 3 6 7 ]
23:28
<
clever >
but its also lazy, and will only parse if something tries to eval the `import ./foo.nix`
23:28
<
clever >
so each time you run `nix-build`, it has to parse every file once
23:27
<
clever >
the cache isnt saved to disk, so once the process doing the parsing exits, the cache is list
23:26
<
clever >
so if you import it again, you get the exact same value, and it doesnt re-parse it
23:26
<
clever >
import also assumes the file wont be changing, and will store that top-level value in a hashmap, keyed on the filename
23:22
<
clever >
which is invalid
23:22
<
clever >
so `let x = import ./bad.nix;` is basically saying `let x = (foo = 0; bar = 42;);`
23:22
<
clever >
the import function just returns whatever value you had in the file
23:22
<
clever >
correct, it must be a valid value, it has to parse it firt
23:20
<
clever >
key = value; is either part of a let block or a set
23:20
<
clever >
fuzzypixelz: it must be a valid value
22:55
<
clever >
this would be why
22:54
<
clever >
fuzzypixelz: if you forget a space when defining a function, it turns into a string!
22:51
<
clever >
and then its just normal function application
22:51
<
clever >
> let or = "boo!"; f = a: b: a+b; in f or "bar"
22:50
<
clever >
when it follows anything else, it looks for the `or` variable in the current scope
22:50
<
clever >
`or` is only special if it follows something in the form of `set.key`
05:26
<
clever >
it sets a global var, that causes exceptions to also print a stack trace
05:25
<
clever >
KarlJoad: you can still `nix repl --show-trace`
05:24
<
clever >
KarlJoad: does --show-trace show anything?
2021-01-04
04:14
<
clever >
for that part, i'm not sure
04:12
<
clever >
it doesnt exist by default, you need to create it
04:10
<
clever >
typo, its config.nix
04:09
<
clever >
getting a link to the docs...
04:07
<
clever >
donofrio: there is no need to reinstall or remove anything, just define the changes you want in config.txt, and nix will rebuild anything that it affects
2021-01-03
08:48
<
clever >
HenryCH: #nixos-aarch64 is where all of the arm guys gather
02:58
<
clever >
ghasshee: try running the repl with `-L` ?
2021-01-02
04:46
<
clever >
clime: `nix-store --generate-binary-cache-key` violates that
04:43
<
clever >
clime: just an extra \n at the start
04:43
<
clever >
[clever@amd-nixos:~]$ echo "$PS1"
04:43
<
clever >
\n\[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\]
04:43
<
clever >
clime: i mostly get it when i run cat on files that have just a single string and no newline
04:41
<
clever >
clime: without that, your prompt gets appended to the last line of output sometimes
04:41
<
clever >
clime: yes, its to deal with programs that dont have a \n at the end
01:59
<
clever >
the nix sandbox automatically restricts everything to the required deps, and disables network
01:58
<
clever >
energizer: this runs a chunk of bash, which itself is running some haskell binaries compiled earlier, and puts all results in $out
01:57
<
clever >
energizer: it can be simpler to just have nix do the sandbox for you
01:56
<
clever >
energizer: -qR will show the runtime deps, but not the buildtime deps
01:55
<
clever >
enless you run nix-store --delete or GC, it wont delete any of the deps
01:45
<
clever >
abathur: symlinks to every result link, sorted in the order they got made
01:45
<
clever >
abathur: ls -ltrh /nix/var/nix/gcroots/auto/
2020-12-31
16:28
<
clever >
nh2: the same default.nix you would have `nix-shell -A env`'d against
16:24
<
clever >
nh2: the shell.nix can just (import ./.).env
03:12
<
clever >
and dont use --force
2020-12-28
23:48
<
clever >
DanC: the docs could maybe do with some more work
23:46
<
clever >
DanC: further down in the file you linked, where it says `nixops create`
23:45
<
clever >
pushqrdx: niv can only update a sources.json file, so you need to write some nix to override the .src from sources.nix
23:45
<
clever >
DanC: the config you deploy must have the bootloader/filesystem/network stuff setup right, or the machine wont boot
23:44
<
clever >
DanC: `nixops create -d name trivial-nixos.nix` and then `nixops deploy -d name`
23:43
<
clever >
pushqrdx: run `niv init` and then `niv add owner/repo`, and then you can `sources = import ./nix/sources.nix` and `sources.repo`
23:40
<
clever >
probably niv, and run `niv update foo` to update it
23:39
<
clever >
pushqrdx: and if you set rev = "master"; it will randomly break next time master is pushed, but only if you dont have old master cached
23:39
<
clever >
pushqrdx: the hash is required or nix wont give git network access
18:43
<
clever >
Gaelan: does --dirty change things?
17:35
<
clever >
cole-h: it worked when i used it a few days ago
17:35
<
clever >
Heffalump: that will create a result in the current dir, and then another symlink under auto, that points to result
17:35
<
clever >
Heffalump: nix-store -r foo --add-root result --indirect
15:12
<
clever >
gobject-introspection is the .name, but you must refer to it as gobjectIntrospection in a nix expr
15:11
<
clever >
> gobjectIntrospection.name
15:11
<
clever >
,locate libgirepository
14:50
<
clever >
nlyy: boot.kernelPackages = pkgs.linuxPackages_latest;
14:49
<
clever >
nlyy: unstable is still 5.4 by default
14:48
<
clever >
nixos-unstable is the unstable channel
14:48
<
clever >
but 20.09 is the newest stable channel
14:48
<
clever >
you want to use nix-channel to change channels
14:47
<
clever >
nlyy: did you read the comment beside it?
14:46
<
clever >
nlyy: dont change stateVersion
2020-12-27
23:42
<
clever >
veleiro: that bash is optional
23:40
<
clever >
veleiro: you could just do `NIX_PATH= nix-shell ...drv`, to skip building that bash
23:39
<
clever >
veleiro: and `nix-instantiate --find-file nixpkgs` ?
23:39
<
clever >
veleiro: you need to either wipe $NIX_PATH so it cant, or provide it a <nixpkgs> that can build successfully
23:38
<
clever >
veleiro: i think nix-shell is trying to grab bash from <nixpkgs> to add to $PATH
23:34
<
clever >
veleiro: can you pastebin the full output from nix-shell?
23:27
<
clever >
nasirhm: check the default.nix in github.com/cleverca22/thermostat_firmware
23:23
<
clever >
stu_[m]: check this in the nixos docs
23:23
<
clever >
99 security = {
23:23
<
clever >
100 pam = {
23:23
<
clever >
101 loginLimits = [
23:19
<
clever >
veleiro: and what error does it print when you run nix-shell on that?
23:16
<
clever >
veleiro: which .drv did you run nix-shell on?
23:06
<
clever >
veleiro: you can just run nix-shell on a .drv
2020-12-23
23:07
<
clever >
but that wouldnt be pure!!
22:57
<
clever >
pushqrdx: once nix-build completes, and your happy with it, you can always nix-env -i ./result
22:53
<
clever >
pushqrdx: it wont properly track the dependencies when you do that
22:52
<
clever >
pushqrdx: lorri adds gc roots for each dir, so you cant gc the things, even when the nix-shell is closed
22:51
<
clever >
pushqrdx: direnv is basically just automatic nix-shell
22:44
<
clever >
pushqrdx: correct
22:38
<
clever >
esotericnonsense: what about this one?
22:38
<
clever >
esotericnonsense: NIXOS_INSTALL_BOOTLOADER=1 /nix/var/nix/profiles/system/bin/switch-to-configuration boot
22:37
<
clever >
esotericnonsense: and thats when it was ran with --install-bootloader?
22:32
<
clever >
esotericnonsense: what did nixos-rebuild output?
22:31
<
clever >
esotericnonsense: is efi enabled in configuration.nix?
22:30
<
clever >
pushqrdx: 2020-12-23 18:27:28 < clever> some also lack a .dev
22:28
<
clever >
pushqrdx: yeah
22:28
<
clever >
esotericnonsense: nixos-rebuild --install-bootloader
22:27
<
clever >
stdenv.mkDerivation automates thatf for you, but overrideDerivation happens too late
22:27
<
clever >
some also lack a .dev
22:26
<
clever >
pushqrdx: just .out and .dev, no need for the one without a suffix, i think
22:24
<
clever >
add both .out and .dev to buildInputs, and then see what happens
22:24
<
clever >
this is why overrideDerivation is deprecated
22:24
<
clever >
and self.wayland.out as well
22:24
<
clever >
you want self.wayland.dev i believe
22:24
<
clever >
i also just realized, overrideDerivation breaks split output stuff
22:23
<
clever >
pushqrdx: self.pkgs is redundant, try self.pkgs.pkgs.pkgs.wayland! :D
22:16
<
clever >
pushqrdx: read the readme on the link i gave
22:15
<
clever >
pushqrdx: 2020-12-23 17:53:46 < clever> pushqrdx: nix-build creates a result symlink, so you can result/bin/wine foo.exe, and it overwrites result each time, so GC will only keep the last build around
22:14
<
clever >
infinisil: except when its wine-wow, that abomination breaks all the rules, lol
22:13
<
clever >
pushqrdx: nix-build '<nixpkgs>' -A nix-du ; result/bin/nix-du ...
22:13
<
clever >
pushqrdx: you can use nix-build instead
22:12
<
clever >
pushqrdx: which lock file?
22:10
<
clever >
pushqrdx: or just run `ncdu -x /nix`, what is the fattest path?
22:10
<
clever >
pushqrdx: nix-du
22:09
<
clever >
pushqrdx: if it has root, then it can also delete GC roots for nixos and root's nix-env
22:09
<
clever >
pushqrdx: permissions only matter if you use -d (delete all generations) or ----delete-older-than
22:08
<
clever >
pushqrdx: without args, permissions for gc dont matter
22:07
<
clever >
> 2020 / 5
22:03
<
clever >
pushqrdx: having a nix-shell open on the project also counts
22:03
<
clever >
2020-12-23 18:01:36 < clever> pushqrdx: if you gc while building, you cant delete things the build needs
22:01
<
clever >
pushqrdx: also, `nix-collect-garbage --max-freed 10g` will only delete 10g of stuff
22:01
<
clever >
pushqrdx: if you gc while building, you cant delete things the build needs
22:00
<
clever >
pushqrdx: nix-end --delete-generation 42, if you want to remove a single root
21:59
<
clever >
a single non-wow build is 258mb
21:59
<
clever >
some of them may be in multiple, if you installed other things
21:58
<
clever >
pushqrdx: this will show the storepath for wine, in each generation
21:58
<
clever >
ls -l /nix/var/nix/profiles/per-user/clever/profile*/bin/wine
21:57
<
clever >
nix-channel is also a wrapper around nix-env!
21:57
<
clever >
nixos-rebuild is a wrapper around nix-env!
21:57
<
clever >
rollbacks ONLY apply to nix-env
21:57
<
clever >
nix-env --list-generations
21:56
<
clever >
thats how rollbacks work
21:56
<
clever >
but it keeps the old version as well, incase you decide to nix-env --rollback
21:56
<
clever >
its creating a new copy of your profile, where foo has been replaced
21:55
<
clever >
pushqrdx: when nix-env successfully builds it, a gc root is added, so that build cant be deleted
21:53
<
clever >
pushqrdx: nix-build creates a result symlink, so you can result/bin/wine foo.exe, and it overwrites result each time, so GC will only keep the last build around
21:53
<
clever >
pushqrdx: nix-env will install whatever it built into ~/.nix-profile, and add gc roots, so youll eventually wind up with 20 copies of wine that you cant gc with the default flags
21:52
<
clever >
pushqrdx: nix-shell, nix-env, and nix-build will all load your overlays.nix by default
21:51
<
clever >
pushqrdx: nix-build '<nixpkgs>' -A wine
21:47
<
clever >
pushqrdx: also, if your testing, build with nix-build, not nix-env
21:41
<
clever >
pushqrdx: that could just be the dependencies within the makefile
21:40
<
clever >
pushqrdx: it looks pretty ugly, it runs 2 full builds (each with its own configure, build, install), in the same derivation
21:33
<
clever >
pushqrdx: `nix show-config | grep cores` ?
21:29
<
clever >
pushqrdx: its passing you the old value of every attr, so you can do old.buildInputs ++ []
21:29
<
clever >
pushqrdx: thats what the old: is for
21:28
<
clever >
pushqrdx: append to buildInputs like normal
21:26
<
clever >
pushqrdx: because it didnt have a #!
21:24
<
clever >
the builder is already set to bash
21:24
<
clever >
pushqrdx: args = [ "-e" ./my-local-copy.sh ];
21:23
<
clever >
pushqrdx: overrideDerivation happens later, this is why its deprecated :P
21:23
<
clever >
pushqrdx: stdenv.mkDerivation mangles the builder, and turns it into args!!
21:23
<
clever >
pushqrdx: oh, no, you want args!
21:22
<
clever >
pushqrdx: you need to +x the file
21:20
<
clever >
pushqrdx: yeah
21:19
<
clever >
pushqrdx: you can just set builder, since your already using overrideDerivation
21:18
<
clever >
pushqrdx: the overrides must be done in the right order, the result of overrideDerivation lacks a .override
21:17
<
clever >
pushqrdx: either .override buildScript, or .overrideDerivation builder
21:17
<
clever >
but overrideDerivation happens after that, so you have to override builder instead
21:17
<
clever >
pushqrdx: base.nix puts it into builder
21:17
<
clever >
15 stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
21:17
<
clever >
16 builder = buildScript;
21:16
<
clever >
pushqrdx: it would create a $buildScript env var, that does nothing
21:14
<
clever >
veleiro: `programs.*` is just a collection of nixos options, some of them may create config in /etc or add a package to systemPackages for you
21:10
<
clever >
pushqrdx: youll need to edit a copy of builder-wow.sh, and then override the buildScript attr, with .override i think
21:10
<
clever >
pkgs/misc/emulators/wine/packages.nix: buildScript = ./builder-wow.sh;
21:09
<
clever >
pushqrdx: yeah, this derivation is just nasty
21:09
<
clever >
thats why you never use builder, lol
21:08
<
clever >
pushqrdx: the builder script overrides the flags, right before it runs configurePhase, so you can never change them
21:08
<
clever >
15 configurePhase
21:08
<
clever >
14 configureFlags="--enable-win64"
21:08
<
clever >
[clever@amd-nixos:~/apps/nixpkgs-hasura]$ vi pkgs/misc/emulators/wine/builder-wow.sh
21:08
<
clever >
pushqrdx: and theres your problem
21:07
<
clever >
then check if the configureFlags are what you expected
21:07
<
clever >
pushqrdx: run that on your final .drv file, after the override, `nix-instantiate '<nixpkgs>' -A wine`
21:07
<
clever >
[clever@amd-nixos:~/apps/nixpkgs-hasura]$ nix show-derivation /nix/store/93q3f3mgm1rjmn0iy802lcb0x33cfkaz-wine-wow-5.22-staging.drv
20:55
<
clever >
,callPackage matthewcroughan
20:36
<
clever >
hodapp: i think it will use pam and your main login pw, to try to unlock gnome keyrings
20:35
<
clever >
hodapp: `security.pam.services.gdm.enableGnomeKeyring` just messes with pam config files, but doesnt add things to dbus
20:31
<
clever >
hodapp: i think an app that provides that service, must be listed in services.dbus.packages
20:04
<
clever >
pushqrdx: copy/paste from a terminal window
20:03
<
clever >
pushqrdx: so you must override postPatch = "";
20:02
<
clever >
pushqrdx: staging ignores the patches array, and starts adding its own patches using postPatch!
20:02
<
clever >
17 cp -r ${patch}/patches .
20:02
<
clever >
15 postPatch = self.postPatch or "" + ''
20:02
<
clever >
[clever@amd-nixos:~/apps/nixpkgs-hasura]$ vi pkgs/misc/emulators/wine/staging.nix
19:59
<
clever >
pushqrdx: can you pastebin the entire output?
19:58
<
clever >
2020-12-23 15:51:08 < clever> pushqrdx: staging uses the older overrideDerivation, which deletes the newer overrideAttrs
19:57
<
clever >
pushqrdx: so you must instead set the old name attr
19:57
<
clever >
pushqrdx: overrideDerivation happens later, and doesnt support pname/version
19:56
<
clever >
pushqrdx: thats to be expected
19:55
<
clever >
so you still have access to the original wine
19:55
<
clever >
but you could name it wine-staging-wayland
19:54
<
clever >
you named it wine, so nix-env -iA nixos.wine
19:54
<
clever >
pushqrdx: the name on the left of the = is what you install
19:53
<
clever >
you also dont need rec on that
19:51
<
clever >
pushqrdx: try just wineWowPackages.staging.overrideDerivation (old: { src = ...; });
19:51
<
clever >
pushqrdx: staging uses the older overrideDerivation, which deletes the newer overrideAttrs
19:50
<
clever >
10 (stdenv.lib.overrideDerivation wineUnstable (self: {
19:50
<
clever >
[clever@amd-nixos:~/apps/nixpkgs-hasura]$ vi pkgs/misc/emulators/wine/staging.nix
19:50
<
clever >
pushqrdx: aha, found the problem
19:49
<
clever >
pushqrdx: try using this one, without .override
19:49
<
clever >
nix-repl> wineWowPackages.staging.overrideDerivation
19:49
<
clever >
«lambda @ /home/clever/apps/nixpkgs-hasura/lib/customisation.nix:84:32»
19:48
<
clever >
28544 wineWowPackages = recurseIntoAttrs (winePackagesFor "wineWow");
19:48
<
clever >
28546 wine = winePackages.full;
19:48
<
clever >
28534 winePackagesFor = wineBuild: lib.makeExtensible (self: with self; {
19:47
<
clever >
it fails when i set those attrs...
19:47
<
clever >
oh, interesting
19:45
<
clever >
pushqrdx: can you pastebin the entire overlays.nix?
19:43
<
clever >
pushqrdx: do you have other overlays, that are also changing wine? how is this overlay loaded? what is the exact error?
19:43
<
clever >
joko: nope
19:43
<
clever >
nix-repl> (wine.overrideAttrs (old: {})).overrideAttrs (old: {})
19:43
<
clever >
«derivation /nix/store/gppp531i6xk1pfsq5890nz144v0w45q2-wine-5.0.drv»
19:40
<
clever >
> (wine.override {}).overrideAttrs (old: {})
19:40
<
clever >
pushqrdx: you need to swap .override and overrideAttrs
19:13
<
clever >
in this case, its vc4/vpu assembly
19:13
<
clever >
it gets ran thru binutils as, to turn it into binary
19:13
<
clever >
.S is just assembly
19:12
<
clever >
.S files are raw assembly code
19:11
<
clever >
matthewcroughan: this is the first opcode to run, that i can control, so all execution of the open firmware starts there
19:10
<
clever >
and some low level arm config registers, to allow floating point and mutexes
19:10
<
clever >
then fix a gpio bug involving the reset pin of the usb hub
19:10
<
clever >
i had to add initrd support to the bootloader, and then replace the missing device-tree files
19:09
<
clever >
matthewcroughan: and thats what i'm doing, it already boots on pi2 and pi3
19:09
<
clever >
matthewcroughan: because the whole point is to get rid of the closed-source blobs :P
19:09
<
clever >
matthewcroughan: the blobs are not involved at any stage in the boot
19:08
<
clever >
matthewcroughan: the firmware i'm using doesnt even support config.txt
19:08
<
clever >
matthewcroughan: this thread shows the commands to build most of it, and links to the github
19:07
<
clever >
its not even reaching /init in the initrd
19:07
<
clever >
its failing during boot, it cant have used more then 20mb of ram
19:06
<
clever >
i have never gotten it to work on a pi1 with the open firmware
19:05
<
clever >
matthewcroughan: already using that fork, but with a custom .config file
19:05
<
clever >
matthewcroughan: ive got it working on pi2 and pi3 without too much trouble, but pi1 is still giving troubles
19:04
<
clever >
matthewcroughan: rpi1, with custom firmware and kernel
19:03
<
clever >
program counter
19:03
<
clever >
[ 2.498077] PC is at bpf_prog_alloc+0x94/0xdc
19:03
<
clever >
[ 2.465971] Unable to handle kernel NULL pointer dereference at virtual address 0000003c
19:02
<
clever >
matthewcroughan: got any clue about this error? heh
19:02
<
clever >
[ 0.210464] pagealloc: memory corruption
19:02
<
clever >
[ 0.214480] (ptrval): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
19:02
<
clever >
youll need to either patchelf or buildfhsenv
19:02
<
clever >
matthewcroughan: and /lib64/ld-linux-x86-64.so.2 doesnt exist, so attempting to run parsecd will report "file not found"
19:00
<
clever >
matthewcroughan: what does `file` say when ran on it?
19:00
<
clever >
matthewcroughan: because /lib doesnt even exist
18:59
<
clever >
matthewcroughan: some of those are in the wayland package, just pop wayland into the buildInputs
18:58
<
clever >
,locate libwayland-cursor
18:58
<
clever >
,locate libGLES_CM.so
18:54
<
clever >
lordcirth: and the default is 2.7 still...
18:52
<
clever >
sphalerite: toss it into a let block and accept that youll need a ? or an if?
18:52
<
clever >
v0|d: i find `iptables-save` to be a lot more readable
18:51
<
clever >
i dont think there are any closer constants
18:51
<
clever >
ehhh, half there
18:51
<
clever >
> python.pythonVersion
18:49
<
clever >
v0|d: but if the service is dynamically mutating chains at runtime, thats a more complex issue...
18:47
<
clever >
> python3.isPy2
18:47
<
clever >
sphalerite: is that good enough?
18:47
<
clever >
> python3.isPy3
17:40
<
clever >
you can abuse `nix-store --dump foo > foo.nar` and `nix-store --restore foo < foo.nar` as a tar replacement
17:39
<
clever >
qyliss: nix uses nar instead of tar, which just lacks timestamp support
17:38
<
clever >
qyliss: it will also have last-mod timestamps on all the files, ruining the reproducability
17:32
<
clever >
j4m3s__: it will serialize the entire directory (nix-store --dump /var/empty/ | hexdump -C) and then hash the serialized form
15:17
<
clever >
there are settings in steam itself, to allow using proton with games that arent in the whitelist of "known working"
15:16
<
clever >
for me, i just run steam, and proton is fully automatic
2020-12-21
22:28
<
clever >
and it will only work with <nixpkgs/nixos>
20:23
<
clever >
and foo isnt a valid root key, only config/imports/options are valid root keys
20:23
<
clever >
once you set config.bar, config isnt missing
20:23
<
clever >
2020-12-21 16:21:52 < clever> if both options and config are missing, your module gets wrapped in config automatically
20:22
<
clever >
and everything blows up :P
20:22
<
clever >
so you set { foo = 42; config.bar = 24; }
20:22
<
clever >
then you see some places refering to config.bar
20:22
<
clever >
that also tripped me up, because when you do { foo = 42; } it works
20:22
<
clever >
so if a module returns { foo = 42; }, the module system will behave as-if you had done { config = { foo = 42; }; }
20:21
<
clever >
if both options and config are missing, your module gets wrapped in config automatically