Skip to content

Conversation

@phaer
Copy link
Member

@phaer phaer commented Apr 14, 2025

Don't quote imageName in nixos-rebuild build-image. It's just a string, not actual json. This mixup - which I authored - leads to extra quoting when printing the image name, e.g.:

Done.  The disk image can be found in /nix/store/rynka0dxk4n6c29mggijf8cmbqzf47zh-nixos-image-amazon-25.0
5pre-git-x86_64-linux/"nixos-image-amazon-25.05pre-git-x86_64-linux.vpc"

The rest is just documentation updates

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation labels Apr 14, 2025
@phaer phaer requested a review from thiagokokada April 14, 2025 09:51
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 14, 2025
@phaer phaer force-pushed the nixos-rebuild-fixes2 branch 2 times, most recently from 1a533a2 to 942b9e6 Compare April 14, 2025 10:45
phaer added 2 commits April 14, 2025 13:30
* correct option type for `image.modules`
* fix grammar
* show actual output of the command to
it's just a string, not actual json. This lead to extra quoting when
printing the image name, i.e.:

Done.  The disk image can be found in /nix/store/rynka0dxk4n6c29mggijf8cmbqzf47zh-nixos-image-amazon-25.0
5pre-git-x86_64-linux/"nixos-image-amazon-25.05pre-git-x86_64-linux.vpc"
@phaer phaer force-pushed the nixos-rebuild-fixes2 branch from 942b9e6 to 58913b1 Compare April 14, 2025 11:30
@phaer
Copy link
Member Author

phaer commented Apr 23, 2025

I hope to have addressed all outstanding feedback, so I think this might be good to merge?

@thiagokokada thiagokokada merged commit 28e6522 into NixOS:master Apr 23, 2025
35 checks passed
@spiage
Copy link

spiage commented Apr 23, 2025

broken nixos-rebuild, line 868, " | jq -r . "

        if [[ -z $buildingAttribute ]]; then
            imageName="$(
                runCmd nix-instantiate --eval --strict --json --expr \
                "let
                    value = import \"$(realpath $buildFile)\";
                    set = if builtins.isFunction value then value {} else value;
                in set.${attr:+$attr.}config.system.build.images.$imageVariant.v.passthru.filePath" \
                "${extraBuildFlags[@]}"
        | jq -r .
            )"
❯ nixos-rebuild -v -L switch --flake .
$ cat /proc/sys/kernel/hostname
$ nix --extra-experimental-features nix-command flakes build --out-link /tmp/nixos-rebuild.FQN5AJ/nixos-rebuild .#nixosConfigurations."a7".config.system.build.nixos-rebuild -v -L
$ exec /nix/store/f2zrxs682q0ql7d3llbkgp16580mzac7-nixos-rebuild/bin/nixos-rebuild -v -L switch --flake .
$ cat /proc/sys/kernel/hostname
/nix/store/f2zrxs682q0ql7d3llbkgp16580mzac7-nixos-rebuild/bin/nixos-rebuild: line 868: syntax error near unexpected token `|'

@spiage
Copy link

spiage commented Apr 23, 2025

@spiage spiage mentioned this pull request Apr 23, 2025
3 tasks
@fricklerhandwerk fricklerhandwerk mentioned this pull request Apr 23, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants