2020-07-23
03:11
<
clever >
and unzip adds an unpack hook, to enable zip support
03:10
<
clever >
CMCDragonkai_: the trick, is that fetchzip just adds unzip to the nativeBuildInputs, and runs the normal unpackPhase function
03:09
<
clever >
CMCDragonkai_: pkgs.fetchzip can fetch tar files
00:43
<
clever >
your welcome
00:42
<
clever >
yeah, it was added relatively recently
00:39
<
clever >
ilios: you need to comment it out for nixos-option to parse it fully
00:36
<
clever >
ilios: and does the option exist in 19.09?
00:35
<
clever >
ilios: what version of nixpkgs are you using?
00:16
<
clever >
colemickens: another sign, the append-secrets path you verified, was not the one that failed
00:14
<
clever >
colemickens: yeah, it has to run the append-initrd secrets, for every generation, to copy the secrets from not /nix/store to /boot
00:13
<
clever >
colemickens: that will do it!
00:04
<
clever >
colemickens: what does uname -a return? and `ls -l result` vs `ls -l /nix/var/nix/profiles/system` ?
00:01
<
clever >
duairc: id keep them as seperate functions, defining each sub-tree
00:00
<
clever >
fresheyeball: yeah
00:00
<
clever >
fresheyeball: pass them to nixpkgs when you imported it, as normal
2020-07-22
23:58
<
clever >
duairc: why is it having to set options in so many places for each thing in the list?
23:57
<
clever >
you must clearly return something that doesnt contain .foo or .bar
23:56
<
clever >
duairc: that is where your recursion comes from
23:56
<
clever >
duairc: and it cant know what config.foos is, until it knows that doFoo cant return { foos = ...; }
23:56
<
clever >
duairc: to figure out what attributes `doFoo` and `doBar` return, it must first know what config.foos and config.bars are
23:54
<
clever >
colemickens: what command did you run?
23:54
<
clever >
fresheyeball: you need to use pkgsMusl for everything, replace every instance of pkgs with it
23:40
<
clever >
and if your expr is written the wrong way, it has to eval it fully to find the answer
23:39
<
clever >
duairc: nix needs to know which side returns .a and which returns .b, to be able to avoid infinite recursion
23:39
<
clever >
duairc: and that is possibly your problem
23:38
<
clever >
duairc: why do you even need the mkMerge? why not just put everything as simply config = { a = {}; b = {}; }; ?
23:32
<
clever >
duairc: can you pastebin the module?
23:31
<
clever >
colemickens: then having aarch64 binaries is weird, what command did you run?
23:28
<
clever >
fresheyeball: now we have an error, but its not obvious what it means
23:28
<
clever >
colemickens: if you dont force the cpu type, it defaults to whatever cpu the nix-build binary was built for
23:26
<
clever >
fresheyeball: and with `-j 1 --option cores 1` ?
23:24
<
clever >
fresheyeball: it was building 2 things in parallel and the errors are jumbled together, try again with `-j 1`
23:06
<
clever >
pkgsCross.musl64.pkgsStatic may also help
23:05
<
clever >
it contains the entire pkgs tree, cross-compiled to various targets
23:05
<
clever >
> pkgsCross
23:05
<
clever >
fresheyeball: pkgsCross.musl64
23:04
<
clever >
fresheyeball: it sounds like the musl target may work better
23:03
<
clever >
fresheyeball: and if you paste that error into google?
23:01
<
clever >
fresheyeball: seen nh2's guide?
22:44
<
clever >
colemickens: try doing `nix-store --verify --check-contents` ?
22:42
<
clever >
colemickens: are you doing any cross compiling?
22:33
<
clever >
fresheyeball: you probably want to delete that script
22:33
<
clever >
fresheyeball: then its in the $out, as the #! of a script
22:32
<
clever >
fresheyeball: what did why-depends say?
22:32
<
clever >
colemickens: and are you on an aarch64 machine?
22:32
<
clever >
fresheyeball: either use sed to modify it, or delete that file in postInstall
22:31
<
clever >
fresheyeball: dont include the path to nodejs in your $out
22:30
<
clever >
colemickens: run file on that bash, what does it say?
22:30
<
clever >
fresheyeball: see also, nix why-depends
22:28
<
clever >
colemickens: and the #! is pointing to a normal bash?
22:27
<
clever >
colemickens: what are the contents of that file?
22:21
<
clever >
now its closer to the number given by `nix path-info -Ss`
22:21
<
clever >
8.8G total
22:21
<
clever >
542M /nix/store/v8yd6i0jly06xl0lly90i9jfc1bqdlv1-firmware-linux-nonfree-2020-05-19
22:21
<
clever >
413M /nix/store/fsyxzww54jn4zslflfslc19r61hz97aw-mesa-20.0.7-drivers
22:21
<
clever >
[clever@amd-nixos:~/apps/nixpkgs]$ du --apparent-size -hc --max=0 $(nix-store -qR /run/current-system) | sort -h | tail
22:20
<
clever >
and du is showing on-disk usage, which is upset by the zfs compression i have
22:20
<
clever >
6.0G total
22:20
<
clever >
253M /nix/store/mfy3sn7vjdnb17y5ry6hcnsjbr8gwf6j-paper-icon-theme-2018-06-24
22:20
<
clever >
318M /nix/store/v8yd6i0jly06xl0lly90i9jfc1bqdlv1-firmware-linux-nonfree-2020-05-19
22:20
<
clever >
du -hc --max=0 $(nix-store -qR /run/current-system) | sort -h | tail
22:20
<
clever >
you need to use the right flags with path-info
22:19
<
clever >
$ nix path-info -Ss /run/current-system
22:19
<
clever >
/nix/store/974fn8h449qmy8z7v24lqgvvq98bph5n-nixos-system-amd-nixos-20.09pre230335.9480bae3370 45424 9456416728
22:19
<
clever >
its like running `cat foo | cat | cat`
22:19
<
clever >
those tools both do the same thing
22:18
<
clever >
it only shows build-time when ran on a .drv file
22:15
<
clever >
fresheyeball: nix path-info and nix-store -qR
22:11
<
clever >
nilsirl[m]: boot.kernelPackages = pkgs.linuxPackagesFor pkgs.custom-kernel;
22:10
<
clever >
nilsirl[m]: nothing will actually use custom-kernel until you change boot.kernelPackages
21:29
<
clever >
nilsirl[m]: nixpkgs.config.packageOverrides = super: { .... }
21:19
<
clever >
nilsirl[m]: the first codeblock there is showing you exactly what to set it to
21:09
<
clever >
so if multiple devices share a pw, it only asks once
21:08
<
clever >
sreybastien[m]: stage-1 will retry the same pw on every other device
21:08
<
clever >
sreybastien[m]: if your mounting things in the initrd (like the rootfs), then it only has to ask once, in stage-1
20:17
<
clever >
manveru: `tcpdump -i lo -A port 8200` may still reveal more info, what text is it sending?
20:15
<
clever >
ah, yeah, for that you would want iptables
20:15
<
clever >
manveru: tcpdump -i lo
02:36
<
clever >
that may work?, but might re-eval a lot...
02:36
<
clever >
infinisil: what happens if you use .extend to mutate the config entry, like pkgs.config ....
02:25
<
clever >
and build a nixos around it
02:25
<
clever >
that will reuse the pkgs tree, with whatever overlays it already has
02:24
<
clever >
eval = import (pkgs.path + "/nixos") { configuration = { imports = [ userconfig ]; nixpkgs.pkgs = pkgs; }; }
02:23
<
clever >
and the fix-point and lazyless never eval the 2nd instance
02:23
<
clever >
it wont eval the pkgs tree, because nixpkgs.pkgs overrides the default
02:22
<
clever >
infinisil: you would need to import (pkgs.path + "/nixos") to eval nixos, and then within that, set nixpkgs.pkgs = pkgs;
02:20
<
clever >
so you just need pkgs.path to get the modules
02:19
<
clever >
infinisil: you could also set the nixos option nixpkgs.pkgs to force it to use a pre-overlaid tree
02:16
<
clever >
lovesegfault: yeah, that cant really accept a pre-overlaid nixpkgs without major changes
02:14
<
clever >
lovesegfault: nope, but you can use myPkgs.extend second_overlay
01:46
<
clever >
you may need to include the full network config in configuration.nix
01:46
<
clever >
check the docs for linode
01:45
<
clever >
diegosaa: do you know if linode does dhcp, or needs a static ip?
01:44
<
clever >
,paste diegosaa
01:43
<
clever >
what about `ifconfig -a` ?
01:42
<
clever >
the network is totally dead
01:41
<
clever >
ah, so the last link in the chain is the serial console
01:41
<
clever >
ah, what does `tty` return?
01:40
<
clever >
then how did you ssh into it?
01:39
<
clever >
did you ssh with v4 or v6?
01:39
<
clever >
what does `ip route` report?
01:39
<
clever >
sounds like the gateway and dns are both down
01:38
<
clever >
diegosaa: can you ping 8.8.8.8?
01:37
<
clever >
diegosaa: can you ping google.com?
01:14
<
clever >
you can do that short-term, to make nixos-rebuild work again
01:13
<
clever >
it usually looks like this
01:13
<
clever >
[clever@amd-nixos:~]$ echo $NIX_PATH
01:13
<
clever >
/home/clever/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
01:13
<
clever >
is your .bashrc or .bash_profile setting it?
01:12
<
clever >
what does `echo $NIX_PATH` say?
01:11
<
clever >
then complain that nixpkgs=.... isnt a valid variable
01:11
<
clever >
it will insert the value of the variable
01:10
<
clever >
jgart[m]: also, `unset $NIX_PATH` wont work, the $ causes it to unset something else
01:10
<
clever >
jgart[m]: are you using screen or tmux?
01:08
<
clever >
simplest is to just relaunch the shell
2020-07-21
21:38
<
clever >
{^_^}: lol
21:31
<
clever >
numkem: i also use nixops for some machines, look at deployments/house.nix
21:30
<
clever >
so anything using secrets gets rebuilt
21:29
<
clever >
then when i build the same expr locally, outside of hydra, i have a secrets.nix in my local dir
21:29
<
clever >
so load-secrets.nix supplies dummy defaults, enough to make it build
21:29
<
clever >
hydra never gets a secrets.nix
21:29
<
clever >
nope, the reverse
21:27
<
clever >
look at load-secrets.nix in my nixos-configs
21:26
<
clever >
and rebuild a few configs with secrets
21:26
<
clever >
and its pre-built, so the switch goes faster
21:26
<
clever >
then i can check hydra, to see if updating will even work, or if the build will fail
21:25
<
clever >
(import <nixpkgs/nixos> { configuration = ./configuration.nix; }).config.system.build.virtualBoxOVA
21:23
<
clever >
check the nixos-configs example i linked above
21:23
<
clever >
it can take a raw path
21:22
<
clever >
you can override that with { configuration = something; }
21:22
<
clever >
numkem: <nixpkgs/nixos/default.nix> will expect your configuration.nix to be at <nixos-config> by default
21:19
<
clever >
numkem: open up `nix repl -I nixpkgs=/home/numkem/src/nixpkgs/nixos` and then try to just eval `<nixpkgs/nixos/modules/virtualisation/virtualbox-image.nix>`
21:17
<
clever >
yeah, that should work
21:13
<
clever >
2020-07-21 17:51:11 < clever> the nixos is missing
21:13
<
clever >
2020-07-21 17:51:02 < clever> numkem: nixpkgs/nixos/modules
21:11
<
clever >
numkem: and what path did you use for it?
21:10
<
clever >
numkem: its possible that virtualbox-demo.nix has a different name in your version, check what the nixos/release.nix is doing
21:06
<
clever >
numkem: ls -l /home/numkem/src/nixpkgs/nixos/nixos/modules ?
21:05
<
clever >
numkem: that doesnt look like the root of nixpkgs
21:05
<
clever >
numkem: why is there a nixos at the end of that -I?
20:58
<
clever >
numkem: this configures hydra to map <nixpkgs> to the latest nixos-20.03
20:55
<
clever >
you can also use this, if you already have nixpkgs imported somehow
20:55
<
clever >
> pkgs.path
20:55
<
clever >
that returns a path
20:55
<
clever >
but you can also do `nixpkgs + "/nixos/modules/installer/virtualbox-demo.nix"` and then set nixpkgs to an expr
20:54
<
clever >
numkem: if you make an input named nixpkgs in hydra, then <nixpkgs> maps to it
20:54
<
clever >
numkem: you need to somehow give it the path to a full nixpkgs, either with a derivation or a searchpath
20:53
<
clever >
numkem: and is -I nixpkgs= pointing to the root of nixpkgs?
20:52
<
clever >
numkem: can you paste your expr?
20:52
<
clever >
numkem: no, that shouldnt make any diff
20:51
<
clever >
the nixos is missing
20:51
<
clever >
numkem: nixpkgs/nixos/modules
20:45
<
clever >
numkem: until it is fixed, you must do: (import <nixpkgs/nixos> { configuration = { imports = [ <nixpkgs/nixos/modules/installer/virtualbox-demo.nix> ./configuration.nix ]; }; }).config.system.build.virtualBoxOVA
20:44
<
clever >
id say thats a bug in the release.nix, and it should be fixed
20:44
<
clever >
numkem: but ova ignores it!
20:44
<
clever >
195 modules = [ versionModule ./modules/installer/virtualbox-demo.nix ];
20:44
<
clever >
189 ova = forMatchingSystems [ "x86_64-linux" ] (system:
20:43
<
clever >
netboot stuff, will include configuration into the list
20:43
<
clever >
39 makeModules = module: rest: [ configuration versionModule module rest ];
20:43
<
clever >
105 modules = makeModules module {};
20:43
<
clever >
101 makeNetboot = { module, system, ... }:
20:43
<
clever >
numkem: ah, release.nix doesnt respect that for ova
20:40
<
clever >
numkem: what expr are you using? what is the error? what is it not doing?
20:20
<
clever >
na, this one is more to do with how --arg is implemented
20:20
<
clever >
so you can easily miss mistakes when they are named wrong
20:20
<
clever >
numkem: yep, also any unused --arg's are silently discarded
20:16
<
clever >
numkem: but it can do a few more complex things too...
20:15
<
clever >
numkem: nix-build will basically import the given path, then run it with an attrset containing every --arg, then use -A to select an attr
20:15
<
clever >
(import <nixpkgs/nixos/release.nix> { configuration = ./configuration.nix; }).ova.x86_64-linux
20:15
<
clever >
(import <nixpkgs/nixos/release.nix> { configuration = ./configuration.nix; }).ova
20:14
<
clever >
the release.nix does some of that for you
20:12
<
clever >
nix-build '<nixpkgs/nixos/release.nix>' -A ova.x86_64-linux --arg configuration ./configuration.nix
20:11
<
clever >
ah, that config.system is a nixos option, that any attr can be shoved into
20:11
<
clever >
hydra is basically just a way to automate nix-build against release.nix files
20:11
<
clever >
config.system is the cpu to build for
20:09
<
clever >
numkem: hydraJob just strips un-needed attributes off a thing, to reduce memory usage of hydra
19:12
<
clever >
Guest60204: because 19.09 is a snapshot of what nixpkgs was like on sept of 2019
17:22
<
clever >
virus_dave: ldd forces it to use the right ld-linux, you need to use patchelf to fix it
15:36
<
clever >
eacameron: its been called buildInputs since before the cross stuff got added
15:36
<
clever >
eacameron: yeah
15:35
<
clever >
immae: nativeBuildInputs is for build-time tools like pkg-config
15:34
<
clever >
immae: the buildInputs are meant for libraries for the target, and in some configs are omited from $PATH
15:01
<
clever >
xwvvvvwx: you need to edit $out, not the real /usr/bin of the host
13:53
<
clever >
alexfmpe: do you have a shell.nix?
13:53
<
clever >
alexfmpe: then its directly in $PATH, what args did you run nix-shell with?
13:52
<
clever >
alexfmpe: what does `type git` return?
13:51
<
clever >
freezeboy: i'm also using this to build it without launching the shell
13:50
<
clever >
[clever@amd-nixos:~/apps/nixpkgs-hasura]$ nix-build -E 'with import ./. {}; python3.withPackages (ps: with ps; [ pyrealsense2 ])'
13:50
<
clever >
freezeboy: -I nixpkgs=/path/to/nixpkgs
13:45
<
clever >
ah, in your fork?
13:45
<
clever >
was it added to things recently?
13:45
<
clever >
error: undefined variable 'pyrealsense2' at (string):1:64
13:44
<
clever >
freezeboy: what value did you give to withPackages?
01:32
<
clever >
my personal hydra is stuck on a version that randomly segfaults when serving http requests, lol
01:32
<
clever >
ivan: ive also run into that and it doesnt look easy without diving head-first into flakes
00:23
<
clever >
$ nix-instantiate --eval -E '{ a=42; }' --json
2020-07-20
22:47
<
clever >
M0-[m]: and i dont think the wrapGAppsHook is going to really work at all in the fhs env
22:46
<
clever >
M0-[m]: what happens if you try buildInputs ?
22:45
<
clever >
M0-[m]: first problem i see is that your not using extraPkgs right, it must do `pkgs.gmp` not just `gmp`, that will break 32bit stuff
22:41
<
clever >
M0-[m]: it might be buildInputs
22:19
<
clever >
Graypup_: pkgs.path is one option
22:18
<
clever >
Graypup_: use `path_to_pkgs + "/pkgs/build-support/docker"`
22:11
<
clever >
M0-[m]: extraPkgs is part of the top level function, so you can only change it with .override
22:11
<
clever >
1 { appimageTools, buildFHSUserEnv, extraPkgs ? pkgs: [] }:
22:10
<
clever >
i dont think anything overrideAttrs acts on, can be a function
22:06
<
clever >
M0-[m]: matrix will pastebin it automatically, and only send a link to irc
20:49
<
clever >
yurb: that wont delete anything from the store, at least on its own
20:44
<
clever >
yurb: if you use nix-diff, you should be able to identify the root cause
20:43
<
clever >
Rian[m]: yeah
20:37
<
clever >
Rian[m]: yeah
20:34
<
clever >
Rian[m]: it would be better to fix the service definition, so it restarts correctly
20:28
<
clever >
zanc: ah, seems to be missing, its basically the same as mkForce, just at a different priority
20:16
<
clever >
zanc: it should be in the nixos manual
20:06
<
clever >
zanc: it sets the value at the default priority, so it wont conflict when you set it in another module without any priority
19:18
<
clever >
energizer: nix-bundle also relies on linux namespacing, so it wouldnt work on a mac
17:04
<
clever >
with quotes, oops
17:03
<
clever >
stateDir = ../../path/to/real/state/
17:03
<
clever >
what if you use the old .. exploit? lol
17:03
<
clever >
8 workingDir = "/var/lib/" + cfg.stateDir;
17:03
<
clever >
46 "--storage.tsdb.path=${workingDir}/data/"
17:02
<
clever >
ah, not exactly the right option...
17:02
<
clever >
services.prometheus.pushgateway.stateDir
17:02
<
clever >
Directory below /var/lib to store metrics.
17:01
<
clever >
hexa-: and why is it a bind mount?
16:59
<
clever >
just set mountpoint=legacy on the dataset, and fileSystems to mount it as usual
16:59
<
clever >
you can still do it with fileSystems
16:58
<
clever >
hexa-: and then you just need to ensure the filesystem is defined in fileSystems
16:58
<
clever >
nixpkgs/nixos/modules/services/databases/mysql.nix: unitConfig.RequiresMountsFor = "${cfg.dataDir}";
16:57
<
clever >
Example: { RequiresMountsFor = "/data"; }
16:57
<
clever >
systemd.services.<name>.unitConfig
16:57
<
clever >
finding an example...
16:56
<
clever >
hexa-: sounds like you want requires mounts for, not after
16:56
<
clever >
hexa-: just define the after in configuration.nix
02:54
<
clever >
adyatlov: you can also `nix-shell -A pkgsCross.avr.avrlibc` then `unpackPhase` to get an unpacked copy
02:54
<
clever >
and then you can just edit it directly
02:54
<
clever >
adyatlov: and vim can edit tarballs easily, just adjust it to `-o avr-libc.tar.gz` so vim knows what type to expect
02:51
<
clever >
adyatlov: ah, if you want the src, add .src to the path
02:42
<
clever >
samueldr: the bash-completion thing might be fixed, but now hydra is failing to eval due to segfaults! lol
02:41
<
clever >
adyatlov: pkgsCross.avr.avrlibc i believe
02:40
<
clever >
adyatlov: just run nix-build on the right attr path, and the result symlink will keep things alive
01:57
<
clever >
unclechu: you could also pull in a sources.nix, if your willing to accept the script being a combination of 3 files
01:54
<
clever >
unclechu: you can also use builtins.fetchTarball with a sha256
01:19
<
clever >
and it would still get pretty ugly, having to put the entire nix expr on one line
01:19
<
clever >
it would only work if it accepts -E
01:15
<
clever >
it tends to have worse performance, because it has to download the deps when you try to run it
01:14
<
clever >
yeah, those ones cant easily use niv, i tend to avoid them
01:14
<
clever >
thats exactly what shell.nix is for
01:13
<
clever >
unclechu: that goes into your shell.nix file
01:13
<
clever >
unclechu: then you can just do `(import ./nix/sources.nix).nixpkgs` to get the path to nixpkgs
01:12
<
clever >
unclechu: basically, you just `nix-env -iA nixos.niv` then `niv init` and `niv add nixos/nixpkgs`
01:10
<
clever >
> pkgs.niv.meta.description
01:10
<
clever >
> pkgs.niv
01:09
<
clever >
unclechu: using something like niv, you can easily specify sha256's and then be protected from that
01:08
<
clever >
unclechu: yeah, the attacker would need to control a CA or be within github's CDN
01:06
<
clever >
unclechu: when used with -I, the https in the url will be respected, so the attacker will need to break https first
00:36
<
clever >
i'll bump to master and see what happens...
00:36
<
clever >
samueldr: bash-completion fails to cross-compile due to errors in its python based tests
00:36
<
clever >
samueldr: has the bash completion thing been fixed yet?
00:35
<
clever >
yeah, it does have a musl target as well
00:35
<
clever >
currently, it fails due to bash completion not building
00:35
<
clever >
hanetzer: the build from a month ago, is using a nixpkgs that did sucessfully cross-compile
00:33
<
clever >
yeah, recent master fails for me
00:28
<
clever >
hanetzer: i have had some success in cross-compiling nixos to my rpi3, but a surprising number of #!'s reference the x86 bash, yet somehow still work
2020-07-19
22:02
<
clever >
hexa-: you can also use this syntax to provide a default when the attr is missing
22:02
<
clever >
> ({}).foo or "fallback"
21:46
<
clever >
superbaloo: ah yeah, i think its a fixup hook that makes nix-support
21:40
<
clever >
immae: one sec
21:30
<
clever >
ive also done experimenting, i made an initrd with a single static elf and nothing else
21:29
<
clever >
have you seen the existing nixos initrd stuff? using ldd to copy just whats used
21:29
<
clever >
it will only be available in other derivations, at build time
21:28
<
clever >
so you wont have cryptsetup available at runtime
21:28
<
clever >
also, propagated inputs dont survive at runtime
21:28
<
clever >
and knowing with storepath each maps to
21:28
<
clever >
making the automatic stuff smarter, would involve recursively discovering the libraries needed by every static lib
21:27
<
clever >
or overwrite it with just 1 path
21:27
<
clever >
ah, then you can just delete the file in $out/nix-support, in a postInstall hook
21:26
<
clever >
but if the derivation is providing a static lib, it needs to propagate everything the static lib depends on
21:25
<
clever >
superbaloo: only the final step in the build, the executable does linking, and that needs curl to be propagated
21:24
<
clever >
superbaloo: usually, static libraries arent linked at all, its just an ar archive containing every .o you just built, but not your dependencies
21:24
<
clever >
superbaloo: double-check with objdump, did it actually embed curl into its output library?
21:23
<
clever >
why does it need curl to build, but shouldnt propagate curl further?
21:21
<
clever >
superbaloo: so you would need to remove curl from the normal buildInputs
21:19
<
clever >
superbaloo: youll notice in the show-derivation, that buildInputs is entirely empty
21:19
<
clever >
superbaloo: i think something is detecting that your doing static builds, and it moves all of the buildInputs to propagatedBuildInputs