Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flk install broken since 3 days worth of nix update #204

Closed
blaggacao opened this issue Mar 19, 2021 · 9 comments
Closed

flk install broken since 3 days worth of nix update #204

blaggacao opened this issue Mar 19, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@blaggacao
Copy link
Contributor

blaggacao commented Mar 19, 2021

NixOS/nix#4613 (comment)

https://github.com/NixOS/nixpkgs/blob/e30d87f22237fe25618136eb9f818ecefaeb02a9/nixos/modules/installer/tools/nixos-install.sh#L128

nix flake info -> nix flake metadata

Until upstream implements an anti corruption layer, it seems we are left with the task to do so.

Upstream Issue: NixOS/nix#4613

EDIT: just changing flake info -> flake metadata works. I tested it super-manually on my local setup, but have no idea how to properly wire this up in here (as an overlay?).


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@blaggacao blaggacao added the bug Something isn't working label Mar 19, 2021
@blaggacao
Copy link
Contributor Author

blaggacao commented Mar 19, 2021

Was closed upstream by NixOS/nixpkgs#116807

@nrdxp
Copy link
Collaborator

nrdxp commented Mar 19, 2021

So can we close this issue then?

@blaggacao
Copy link
Contributor Author

blaggacao commented Mar 19, 2021

I think, by an nixpkgs update to the flake.lock file, yes (nixpkgs-unstable, that will be shortly 😕 ), so essentially via #192

bors bot added a commit that referenced this issue Mar 22, 2021
202: iso: avoid systemd service startup r=nrdxp a=blaggacao

fixes #194
alternative to #197

# Manual Tests


<details>
<summary>was unrelated</summary>

- [ ] `flk install NixOS --impure` correctly onto `/mnt` ❎ (looks like no profile is present)

Issue: #204
Upstream Issue: NixOS/nixpkgs#116938

</details>

- [x] acceptable build time / closure size ca 850MB (for a simple base OS) ✔️ 
- [x] local profile with `cage` service is disabled, that is: boots into terminal ✔️ 
- [x] success: air gapped / offline devshell enter ✔️ 
- [ ] failure: aire gapped target install: &larr; non blocking bonus item ❎ 
```console
$ flk install POS
warning: you don't have internet access; disabling some network-dependent features
building the flake in path:/iso/devos?narHash=sha265-...
warning: you don't have internet access; disabling some network-dependent features
error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/df8e3...': Couldn't resolve host name (6)
```

&rarr; detailed rationale in the commit messages

:heart: @Pacman99 for the excellent and detailed discussions in #197 and the may ideas, suggestions and code.

Co-authored-by: David Arnold <dar@xoe.solutions>
@codygman
Copy link
Contributor

codygman commented Mar 26, 2021

I think my issue is related.

How can one manually update? For instance I'm getting:

[devshell]$ flk razer switch
[sudo] password for cody: 
error: 'info' is not a recognised command
Try 'nix --help' for more information.

I see that flk switch is just:

sudo nixos-rebuild --flake "$DEVSHELL_ROOT#$1" "${@:2}"
[devshell] shell $ echo $DEVSHELL_ROOT
/home/cody/devos

So that gives:

sudo nixos-rebuild --flake "/home/cody/devos#razer" "${@:2}"

I think this:

[devshell]$ sudo nixos-rebuild --flake "/home/cody/devos#razer" switch
error: 'info' is not a recognised command
Try 'nix --help' for more information.

So... nixos-rebuild is broken for me? I think I can do a build and then switch to it in this case maybe? I'm not totally sure how to get out of this state.

@Pacman99
Copy link
Member

Pacman99 commented Mar 26, 2021

Yeah I think there was a PR merged to update nixUnstable which now has a deprecated alias for nix flake info. As a workaround I believe you can do nix build /home/cody/devos#nixosConfigurations.razer.config.system.build.toplevel then ./result/bin/switch-to-configuration switch.

@nrdxp
Copy link
Collaborator

nrdxp commented Mar 26, 2021

If the update broke nixos-rebuild for everyone, perhaps we should reprogram flk.sh to run nix shell ".#nixosConfigurations.${name}.config.system.build.toplevel" -c switch-to-configuration OPTION

@blaggacao
Copy link
Contributor Author

Looks like it pays out well to have a flk wrapper. 👍

@ymarkus
Copy link
Contributor

ymarkus commented Mar 30, 2021

If someone is looking for a workaround for nixos-install, you can run the following cmd to patch it:
cp $(which nixos-install) . && sed -i 's@flake info@flake metadata@' ./nixos-install

@blaggacao
Copy link
Contributor Author

This was a temporary issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants