<Henson>
in a NixOS container, how can I specify the version of nixpkgs that I want to use for building the packages and modules of the virtual container? Do I set "nixpkgs.pkgs = import foo {};" in the container's configuration declaration, where foo points to some fetchFromGitHub download of a particular commit?
slack1256 has quit [Remote host closed the connection]
slack1256 has joined #nixos
jackm has joined #nixos
jackm is now known as jackattack
jackattack has quit [Client Quit]
<Henson>
I figured it out. I needed to use the containers.<name>.pkgs variable instead of trying to put that into the nixpkgs.pkgs variable of the container's config set.
ahmed_elgabri has quit [Ping timeout: 272 seconds]
<i1l>
Hi. I think i found a bug: root on ZFS, /nix/store is mounted rw in `nix-shell -p neovim`. inside nix-shell i can `echo hi > /nix/store/a`, and the file is accessible outside the shell. it is really mounted rw inside the shell. Thanks.
<i1l>
outside the shell it is ro, as it should.
Jd007 has joined #nixos
<i1l>
i may be wrong, didn't tested with any other fs.
<edrex>
Is anybody aware of an existing config for maintaining uPnP port mappings with upnpc? I have a few arm boxes where I don't have admin on the gateway routers but they have upnp portmapping enabled.
<edrex>
i can do them manually but i want to trigger them whenever the network interface comes up (after the router power cycles and forgets everything)
<redmp_>
eg. would i assign back to the original package set like this? `self: super: { haskell.packages.ghc8101 = super.haskell.packages.ghc8101.override (old: { overrides = selfH: superH: { ... }; }); }`
<i1l>
Shados: i am root. if i am user, i also has no this issue
<redmp_>
the answer to my question seems to be "no"
<redmp_>
i guess to override haskell.packages.ghc8101 i need to call something on haskell.packages to override the ghc8101 attribute and then call ghc8101.override within that
cfinch has joined #nixos
cfinch has quit [Read error: Connection reset by peer]
hiro98 has quit [Remote host closed the connection]
cfinch has quit [Read error: Connection reset by peer]
nomeata has joined #nixos
hiro98 has joined #nixos
simba1 has quit [Ping timeout: 260 seconds]
cfinch has joined #nixos
cfinch has quit [Read error: Connection reset by peer]
simba1 has joined #nixos
<DavHau[m]>
Inside a flake.nix is there any way to read the current git tag? If I access ${./.} there is no .git directory anymore. It seems like this information is lost.
cfinch has joined #nixos
<DavHau[m]>
I use git tags to assign versions to revisions. I'd like to prevent having multiple sources of truth
cfinch has quit [Read error: Connection reset by peer]
<adisbladis>
DavHau[m]: ./. doesn't refer to the git tree but the flake store path
<adisbladis>
You cannot get the git tree reference from a flake afaik
<adisbladis>
That would break flakes idea of what purity is
<aiowej>
Hi! I am getting started with free software music engraver Lilypond, and want to use the emacs lisp code bundled with it. It's not available in MELPA, but in the source tree of Lilypond, so I assume it's somewhere on my filesystem when I do `nix-shell -p lilypond`. My question is how can you find the actual path on disk where packages are located, so that one can point emacs to load the code bundled with the nix package?
<mpickering>
Anyone familiar with this build error when trying to install dwarffs? dwarffs.cc:7:10: fatal error: filetransfer.hh: No such file or directory
supercoven has quit [Ping timeout: 245 seconds]
<niksnut>
mpickering: yes, you need to compile against a more recent version of nix
<niksnut>
I think the current master should work
<mpickering>
niksnut: Thanks, that is the part about "you may need an unstable version of nix"?
<yorick>
eyJhb: same question, did you get android gradle stuff working?
<niksnut>
mpickering: probably nixpkgs is too new, I think utillinuxMinimal got removed/renamed in nixpkgs master
jboy has left #nixos ["WeeChat 3.0"]
cfinch has quit [Ping timeout: 264 seconds]
<damjan>
so, I'm passing a list of derivations (single files) to a function, which then calls stdenv.mkDerivation … how do I operate on the list, the files, in buildCommand?
<damjan>
(I bet I'm missing something easy/obvious)
<l-as>
Is it just me or is nix evaluation with flakes noticeably slower than without? I feel like rebuilding my system configuration before using flakes was much faster.
cfinch has quit [Read error: Connection reset by peer]
dev_mohe has quit [Quit: dev_mohe]
eyenx has quit [Remote host closed the connection]
<nixnewbie>
Hello! I have some issues figuring out how to get a nix-shell that will allow me to cross-compile a helloworld.c from x64 Linux to x64 Mac OS X. I can't find an example, only a lot of slightly different ones for other platforms (and I don't understand the manual). Is a `shell.nix` with `crossSystem = { config = "x86_64-darwin"; };` even the correct
<nixnewbie>
approach here?
NeoCron has joined #nixos
<Miyu-saki>
Nope
<Miyu-saki>
That should be an argument to your nixpkgs.
<clever>
nixnewbie: using something like pkgsCross.aarch64-multiplatform.stdenv should give you an env where $CC and $LD target aarch64 for example
<clever>
but ive not seen linux->darwin cross working before
<Miyu-saki>
Hmm.
<Miyu-saki>
Now that I think about it.
<Miyu-saki>
`pkgs.pkgsCross.foo.mkShell` should work, right?
<nixnewbie>
Miyu-saki: It is an argument to my nixpkgs, but I didn't not want to spam the full file into the chat here.
eyenx has joined #nixos
<nixnewbie>
clever: I am mainly trying to ultimately get a Rust program to check (not compile, but that'd be a bonus). Out of the box, rustup can install targets and compile simple programs, but some have external dependencies that need to be built (like OpenSSL) and/or require some C headers apparently.
<Miyu-saki>
Oh, my bad. I kinda misread that. Gist it and show us?
<Miyu-saki>
FWIW, I do think that's correct
<Miyu-saki>
Maybe your triple's incorrect though
<Miyu-saki>
Try "x86_64-apple-darwin"
<nixnewbie>
Tried. I'll try to put up a Gist, give me a second.
<mpickering>
Latest flake error "access to path '/home/matt/config/overlay.nix' is forbidden in restricted mode", how can I turn this off..?
cfinch has quit [Read error: Connection reset by peer]
<nixnewbie>
So, clone `nixpkgs`, checkout `release-20.09`, edit the hash to say `ra3rsnd6v7izjrz7rdmk8ps7nr6zx53f` for 20.03 and then make nix-shell use my local checkout how?
<Miyu-saki>
Pretty much
<Miyu-saki>
You'll also have to redefine what your `<nixpkgs>` means.
Qwerky has joined #nixos
<Miyu-saki>
Hm, seems like this isn't documented?
<Miyu-saki>
You'll want to add this to your configuration.nix. `nix.nixPath = [ "nixos-config=/etc/nixos/configuration.nix" "nixpkgs=/etc/nixos/nixpkgs" ];`
<Miyu-saki>
I think only `"nixpkgs=..."` is only required there though.
<Miyu-saki>
And also, obviously, adjust the path.
<Miyu-saki>
Then rebuild and relogin.
eyenx has quit [Quit: Bridge terminating on SIGTERM]
<nixnewbie>
Hmm, I'd usually just replace `<nixpkgs>` with a `fetchTarball` thing (or a local path), to just use that for a shell. Is it really necessary to patch the whole s ystem?
cosimone has joined #nixos
<Miyu-saki>
Nope, I was actually going to continue to say that.
<Miyu-saki>
So
<Miyu-saki>
The (subjectively) proper way to replace nixpkgs is to use `-I nixpkgs=...`
<Miyu-saki>
That ensures that if you have anything using `<nixpkgs>` it points to the proper nixpkgs.
<Miyu-saki>
(Alternatively, you could do the environment way.)
<Miyu-saki>
NIX_PATH=nixpkgs=... cmd
shibboleth has joined #nixos
<Miyu-saki>
Also, I'd take note of what clever said a while ago. > but ive not seen linux->darwin cross working before
<nixnewbie>
I'll try that. However, I am wondering, can this ever work? I just tried it using a Docker container someone supplied, which has toolchains installed. The packages I am using require proprietary extensions to `gcc` though (support for the `-arch` flag), which I assume is why XCode is required. However, I do not expect my Nix toolchain to run actual
<nixnewbie>
XCode gcc binaries after this
<Miyu-saki>
If it works in Docker on Linux somewhere, then I don't see why Nix can't do it.
<Miyu-saki>
s/Docker on Linux/Docker "running" Linux/
eyenx has joined #nixos
<nixnewbie>
But it doesn't run in Docker Linux, unfortunately. There are, from what I can tell, three difficulty levels here. First is just compiling a Rust program with no non-Rust dependencies; this I assume works without any shenanigans since Rust provides this out of the box, except that it does link (but that's fine for me, since I only need to check).
<nixnewbie>
Second is having dependencies that require a working C compiler, but are set up correctly that they only use standard flags for the compiler. Third, I guess, is having packages whose build scripts use Apple-only compiler flags, meaning I would have to compile the Apple CC fork first.
eyenx has quit [Client Quit]
mayhew has quit [Quit: Konversation terminated!]
avaq_ has quit [Ping timeout: 245 seconds]
eyenx has joined #nixos
eyenx has quit [Remote host closed the connection]
<nixnewbie>
Miyu-saki This helped clear up a lot of things. Thank you very much :)
aminechikhaoui has quit [Ping timeout: 256 seconds]
AmandaC_ has quit [Ping timeout: 256 seconds]
zaeph has quit [Ping timeout: 256 seconds]
jperras has quit [Ping timeout: 256 seconds]
dupon1 has quit [Ping timeout: 256 seconds]
CMCDragonkai has quit [Ping timeout: 256 seconds]
cyris212 has quit [Ping timeout: 256 seconds]
_cyril_ has quit [Ping timeout: 256 seconds]
Ultrasauce has quit [Ping timeout: 256 seconds]
kaychaks has quit [Ping timeout: 256 seconds]
Ankhers has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 256 seconds]
janneke has quit [Ping timeout: 256 seconds]
orion has quit [Ping timeout: 256 seconds]
BlessJah has quit [Ping timeout: 256 seconds]
ronthecookie has quit [Ping timeout: 256 seconds]
spudly has quit [Ping timeout: 256 seconds]
kosmikus_ has quit [Ping timeout: 256 seconds]
Willi_Butz has quit [Ping timeout: 256 seconds]
migy has quit [Ping timeout: 256 seconds]
neobit_ has quit [Ping timeout: 256 seconds]
abrar has quit [Ping timeout: 256 seconds]
Philonous_ has quit [Ping timeout: 256 seconds]
yagoham_ has quit [Ping timeout: 256 seconds]
zalaare has quit [Ping timeout: 256 seconds]
monokrome has quit [Ping timeout: 256 seconds]
omnipotententity has quit [Ping timeout: 256 seconds]
nek0 has quit [Ping timeout: 256 seconds]
m1cr0man has quit [Ping timeout: 256 seconds]
hyperfekt has quit [Ping timeout: 256 seconds]
Sigma has quit [Ping timeout: 256 seconds]
Reiser has quit [Ping timeout: 256 seconds]
sknebel has quit [Ping timeout: 256 seconds]
ross` has quit [Ping timeout: 256 seconds]
rprospero has quit [Ping timeout: 256 seconds]
jawr has quit [Ping timeout: 256 seconds]
xqsl has quit [Ping timeout: 256 seconds]
ivan has quit [Ping timeout: 256 seconds]
kandinsk1 has quit [Ping timeout: 256 seconds]
octe has quit [Ping timeout: 256 seconds]
matthewcroughan has quit [Ping timeout: 256 seconds]
pepesza has quit [Ping timeout: 256 seconds]
judson has quit [Ping timeout: 256 seconds]
LambdaDuck has quit [Ping timeout: 256 seconds]
kaptin has quit [Ping timeout: 256 seconds]
yagoham has joined #nixos
kosmikus has joined #nixos
jawr has joined #nixos
aml has joined #nixos
monokrome has joined #nixos
pepesza has joined #nixos
kosmikus has joined #nixos
kosmikus has quit [Changing host]
Gohla_ is now known as Gohla
Reiser7 is now known as Reiser
CMCDragonkai1 is now known as CMCDragonkai
dupon10 is now known as dupon1
aminechikhaoui8 is now known as aminechikhaoui
mog- is now known as mog
hyperfekt_ has joined #nixos
kaychaks_ is now known as kaychaks
Ankhers_ is now known as Ankhers
nek06 is now known as nek0
judson has joined #nixos
Sigma has joined #nixos
ahmed_elgabri has joined #nixos
xqsl has joined #nixos
<nh2[m]>
can anyone remind me, was there a feature in `mkDerivation` or otherwise that scanned my binaries for nix store paths and puts them as nix dependencies?
zupo has quit [Ping timeout: 264 seconds]
runciter_ has quit [Ping timeout: 264 seconds]
hyperfekt_ has quit [Max SendQ exceeded]
anders^ has joined #nixos
jperras has joined #nixos
hyperfekt has joined #nixos
meh` has joined #nixos
meck has joined #nixos
kaptin has joined #nixos
<viric>
nh2[m]: yes
<nh2[m]>
viric: what was the feature called?
<viric>
nh2[m]: but it looks only among build dependencies, which of them become runtime dependencies
<viric>
I guess it's in nix code, not stdenv nix implementation
<nh2[m]>
viric: so we'd expect that even `nix-store --add` does it?
runciter has joined #nixos
<viric>
ah no, it should be a build step
zupo has joined #nixos
ronthecookie_ is now known as ronthecookie
ahmed_elgabri has quit [Ping timeout: 264 seconds]
janneke` is now known as janneke
cfinch has quit [Read error: Connection reset by peer]
<nh2[m]>
Is it possible to manually craft a `.drv`? I would like to package a binary, which was built in nix-shell, so all its `ldd` output points into the store path, and I want to `nix-store --add` this binary, but ensure that all the dependencies in `ldd` are registered as nix dependencies of the store path.
eyenx has joined #nixos
Qwerky has quit [Remote host closed the connection]
<Miyu-saki>
nh2[m]: IIRC, nix-store --adding that is exactly what it will do.
<nh2[m]>
Miyu-saki: if I just `nix-store --add` a file, it will have no dependencies in `nix-store -qR`
<Miyu-saki>
Oh
<Miyu-saki>
Hmm. Now I'm actually curious if that's possible. I guess `nix-store --add` and fixed-hash outputs are assumed to not have dependencies.
<nh2[m]>
right
hiro98 has joined #nixos
<nh2[m]>
I believe that all the dependencies must already be there at the time the `.drv` is added to the store, not later when the drv is realised. (Because `nix show-derivation` always has dependencies on `.drv`s and their associated outputs, never on realised store paths.) That's what led me to believe thta being able to manually craft `.drv`s might be the way.
<exarkun>
I guess what it normally wants to do is download them from the internet, but I suspect the nixos packaging discourages it from doing that?
<exarkun>
my environment works fine w/ terraform 0.12 (ie, I managed to provide the plugins using nix packages). wondering what's different with 0.13...
<exarkun>
There's one entry, /nix/store/fam6azhh0wlpaxa27rbxkjyqzrla50xn-tf-plugin-env/bin/terraform-provider-aws_v2.65.0
<exarkun>
I tried some `terraform state replace-provider ...` commands on my real state (after I backed it up) and couldn't find any combination of values that made anything better
<exarkun>
That's when I switched to trying to make a minimal reproducer, which I can't even get past `terraform init`
<gchristensen>
exarkun: when I use your gist, but : nix-shell -I nixpkgs=channel:nixos-unstable-small and delete the `version` spec for the AWS provider it works, but I get the same error you do on stable
frostbytten has joined #nixos
<exarkun>
hmhm
<gchristensen>
note I had to delete `.terraform` for it to work first
<exarkun>
"before upgrading to Terraform v0.14 you must have successfully run terraform apply at least once with Terraform v0.13" guess there is not really a shortcut here
ahmed_elgabri has joined #nixos
jonringer has joined #nixos
bitmapper has joined #nixos
cfinch has joined #nixos
jonringer has quit [Remote host closed the connection]
<frostbytten>
Using the new nix-commands and was wondering if there is an equivalent to the --keep-failed? I am trying to figure out why R-4.0.4 fails to build.
<exarkun>
gchristensen: thanks. so far this looks like it's working. still waiting for some deps to finish downloading before I can apply it to my real config though.
<l-as>
nh2: I'm not sure if this will work but you can maybe make a .drv the normal way, figure out what the output path will be, then set up a binary cache in some folder, construct the correct folder structure, plop in your built binary, and then have nix fetch the "result" of the derivation from the binary cache you made
<l-as>
Check `nix copy --help`, but I haven't actually tried this
<nh2[m]>
Las: but to "make a .drv the normal way", I need to already know the inputs, not as `.drv` (those are easy to get from `ldd`) but as nix expressions.
<l-as>
yeah
<l-as>
can't you just use builtins.storePath nh2 ?
cfinch has quit [Read error: Connection reset by peer]
<nh2[m]>
Las: this seems to work in combination with `autoPatchelfHook`! It seems I can parse the `ldd` output, run `builtins.storePath` on each store path (stripping off filenames/subdirs), and feed that into `buildInputs`, e.g. `buildInputs = [autoPatchelfHook] + map builtins.storePath [ list of store path generated by ldd output here ]`. `autoPatchelfHook` will then run `ldd` again on my binary, and find the `.so`s in the
<nh2[m]>
`buildInputs`, creating the link.
<nh2[m]>
Las: Actually, it seems `autoPatchelfHook` isn't necessary, just `buildInputs = map builtins.storePath [ list of store path generated by ldd output here ];` seems to work already
<dddddd57>
Hey, I wonder what's the best workflow/channel to get latest security patched packages, for example git `2.30.2` was merged into staging 2 days ago, https://github.com/NixOS/nixpkgs/pull/115597, but it hasn't been merged yet into any of the channels in https://search.nixos.org/packages (20.03, 20.09, unstable).
<dddddd57>
How do you keep your system uptodate with security patches?
<duck_>
really, really, really stupid question: if nixpkgs defines environment.etc."blah".source = nixInstantiationOfDirectory;, can I override that to make it not create a symlink there?
<duck_>
i.e I want /etc/blah to be NotADirectory
<duck_>
(I have an external service that expects to write there)
<{^_^}>
[nixpkgs] @WilliButz merged pull request #115185 → prometheus-knot-exporter: init at 2021-01-30; minor module improvements → https://github.com/NixOS/nixpkgs/pull/115185
<redmp_>
nix-shell gives "requires a single derivation" when i try to use the `defaultPackage`'s `.env` property. I think this is correct, can somebody take a look at this repro?
cfinch has quit [Read error: Connection reset by peer]
cfinch has joined #nixos
cfinch has quit [Read error: Connection reset by peer]
<figgyc_>
If you have nix.registry.nixpkgs.flake = nixpkgs in your flake based system config then how do you update nixpkgs? flake.lock just locks the version in the nix store even if i do nix flake update --update-input nixos. currently my nixos-version --hash 9816b99e71c3504b0b4c1f8b2e004148460029d4 (I'm on nixos-unstable) which I don't think is the latest one (could be wrong)
<redmp_>
i think the mix of system namespaced and un-namespaced attrs on flakes is pretty difficult to work with.. if you're in a language like C that might take advantage of different defaultPackage per ${system} it's maybe useful, but for other languages like say python or haskell it really gets in the way
<redmp_>
there are a bunch of issues on flake-utils about how overlays do/don't work nicely with simpleFlake and eachSystem .. so there's no real workaround yet it seems
<redmp_>
well, i guess you can use flake-utils for namespaced outputs properties and then // on the un-namespaced outputs properties afterward ..
<matthewcroughan_>
Really wanting to get it cached in hydra so I can start getting people using it in a nix-shell.
disasm has joined #nixos
jpo has joined #nixos
<simpson>
Looks fine. I'm not sure that your logic follows, though; folks only need the expression, not a central build server, in order to use the package.
<trashdefault>
hello, I'm trying to setup a small nix dev shell that overrides a version of package by pinning a past commit of nixpkgs and overrides several attributes of qemu. Can someone check why it's failing to do either of those things? I can't find easy answers online. https://pastebin.com/raw/V4C1Gmcf
Boomerang has joined #nixos
<trashdefault>
I'm guessing the pinning is wrong because I'm reimporting pkgs (I don't know how to remedy that) and the overrides might be working (there's a compilation error I'm trying to fix with the pinning to a past version)
cfinch has quit [Remote host closed the connection]
nhs has quit [Ping timeout: 246 seconds]
werner292 has joined #nixos
<drozdziak1>
How to set up a PDF printing target in CUPS on NixOS?
cfinch has joined #nixos
werner291 has quit [Ping timeout: 265 seconds]
werner292 is now known as werner291
<drozdziak1>
i.e. Everything using CUPS thinks it's a printer but really it just prints to a file or does nothing at all
<redmp>
if i have an overlay in a flake "B" which is dependent on the overlays in another flake "A", should i define B's overlays as `overlays = a.overlays ++ [ ... ];`? this would export A's overlays from B. I'm not sure if that's the best practice
Boomerang has quit [Ping timeout: 272 seconds]
<supersandro2000>
domenkozar[m]: it happened for 5 downloads in quick succession
fuiltilt has joined #nixos
inkbottle has quit [Quit: Konversation terminated!]
<{^_^}>
[nixpkgs] @SuperSandro2000 opened pull request #115998 → lilypond-unstable: drop because lilypond is newer and it does not build → https://github.com/NixOS/nixpkgs/pull/115998
kfiz has quit [Client Quit]
kfiz has joined #nixos
inkbottle has quit [Quit: Konversation terminated!]
<supersandro2000>
grahamc[m]: ofborg got the same hash mismatch as I got https://logs.nix.ci/?key=nixos/nixpkgs.114943&attempt_id=fb5bc76e-8d97-4a0c-bdd8-a9396faa12ed