Comments (7)
I managed to get around it with:
# Uses the flake registry for Nix repo
# Requires building Nix HEAD from source (but can prob specify a different branch)
# HEAD is not guaranteed to work properly
alias nix='nix run nix --'
nix build /etc/nixos#nixosConfigurations."ryosuke".config.system.build.nixos-rebuild
sudo ./result/bin/nixos-rebuild boot
[Edited from my original comment for accuracy]
from std.
This is probably relevant data when discussing dynamic vs static linking of libnix
in https://github.com/water-sucks/nixos — thanks for bringing this up!
from std.
I managed to get around it by running nix build /etc/nixos#nixosConfigurations."ryosuke".config.system.build.nixos-rebuild and then using the resulting binary via ./result/bin/nixos-rebuild boot. Writing now from the new system.
Correction: it is not so simple. I am also updating another machine and running into the same issue, even when running that nix build
command. Somehow I need to install the most recent version of Nix (hence the catch-22). I think I left something out of my comment -- I will edit to include the additional steps.
Considering this seems to me like a blocker without an obvious solution, can the error message provide some further advice about how to proceed? I am guessing that anyone who is using Standard for their system flake configuration would run into this trap if they had an outdated system.
Update: This other system (called boschic
, not ryosuke
as in the above console output) might be even more out of date. Its nixpkgs
seems to have no compatible Nix version:
✖1 nix profile install nixpkgs#nix_2_13
error: flake 'flake:nixpkgs' does not provide attribute 'packages.x86_64-linux.nix_2_13', 'legacyPackages.x86_64-linux.nix_2_13' or 'nix_2_13'
Did you mean one of nix_2_3, nix_2_4, nix_2_5 or nix_2_6?
from std.
I updated the original example to include my current workaround using nix run nix
from std.
There's no way to tell nixos-*
which Nix binary it should use? I'm not familiar with the nixos-*
family and its design seems rather scattered and somewhat occasional to me (e.g. some are bash, some are c++, etc).
from std.
@blaggacao From what I can tell, there's nothing so obvious or direct, which certainly supports your description of nixos-*
as scattered. Like many things Nix, I suspect that there might be some "happy" path out there to provide a workaround, but such happy paths seem impossible to find when I'm actually looking for them 🙃
Regardless, even if I could specify a nix
binary to use, the issue is that until the system is rebuilt with updated flake inputs, nix
and all of its related commands have absolutely no idea that there is any version past v2.11. That's why I've resorted to building nixos-rebuild
from the system's flake output with a shimmed nix
version via nix run 'github:NixOS/nix?ref=2.19.2' -- build <...>.build.nixos-rebuild
(updated from my previous comments to make use of a pinned version for its cached binary).
Since this is feeling more like a log of my journey (and I'm done with updating old systems now), I could close this issue, though I still feel as though there is something strange in the way that Standard blocks nixos-rebuild
. Like, I don't even understand why that is happening.
In the end, it effectively leads me towards thinking I should avoid Standard for anything but the most up-to-date use cases with extensive CI updates automation etc. (it's hard to keep up sometimes) and not so much for personal NixOS machines that could sit in a closet for a while, subject to decay (this one laptop I'm working on had its clock stuck back in October 2022 cos of some WIP system generation breaking DNS...)). I guess that's kinda the point of Hive but in the end I just want the project structure to work reliably even if it's not updated in a long time (and, really, I don't think a year is that long of a time).
from std.
If understanding is accurate, there are two failure modes:
nixos-rebuild
using a past unsuitable version of nix for the current evaluation- the current evaluation of a configuration failing to provide a suitable version of Nix (e.g. because no channel-update is desired)
Maybe both problems could be tackled by ignoring system-available nixos-*
and instead fetch newer ones (nix shell github:nixos/nixpkgs#nixos-*
). These then also come with a newer version of Nix.
Wouldn't that bring in the right version of nixos-build
, and thus Nix, in both cases?
The system, by pinning the Nix version to reproduce itself, effectively forbids language innovation. I think Nixlang should be mentally considered exogenous to the system. Thus, it might have even been a better design choice for nixos-rebuild
to not pin it's Nixlang version, i.e. the Nix binary.
from std.
Related Issues (20)
- docs: provide an expanded example of generating a Justfile HOT 1
- runtime error: invalid memory address or nil pointer dereference HOT 3
- Unclear comment in rust project template HOT 1
- How do you integrate a `README.md` with the TUI? HOT 6
- Handle raw config for devshell & nixago HOT 6
- Straightforward example implementing operables/containers? HOT 8
- error: attribute 'grow' missing HOT 1
- input overloading warning console output seems misformatted HOT 4
- Std `ops.mkStandardOCI` compatibility problem with `ops.mkOperable` to wrap HOT 3
- cannot write modified lock file of flake 'flake:std' HOT 1
- `inputs.std.lib.cfg.editorconfig`: attempt to call something which is not a function but a set HOT 5
- rust template unusable on aarch64-darwin HOT 1
- mkDevOCI doesn't work
- pick, harvest and winnow functions exported from std should respect available systems HOT 4
- Make the warning copy-paste friendly
- std depends on "nix2container" being called "n2c" HOT 3
- The upgrade command from std TUI fails on the example flake for the `hello` package HOT 2
- STD Overriding PRJ_ROOT HOT 1
- access source code outside of cells HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from std.