NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.58k stars 13.73k forks source link

Error while creating a DigitalOcean image file #322588

Closed bratfizyk closed 2 months ago

bratfizyk commented 3 months ago

Describe the bug

I've been trying to run a deploy to Digital Ocean so I followed this article but it failed for me while generating a DigitalOcean NixOS image.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create the file image.nix as described in the article.
  2. Run nix-build ./image.nix from the folder containing the file created in step (1).

Expected behavior

nix-build ./image.nix executes without any errors and produces an image file.

Screenshots

image

Additional context

My personal NixOS configuration: https://github.com/bratfizyk/dotFiles

Notify maintainers

I was asked to report this issue by @aanderse

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.94, NixOS, 24.11 (Vicuna), 24.11.20240620.d603719`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/xfpiyfgf6y30fxk5ngv0cjn474qfr3sj-source`

Add a :+1: reaction to issues you find important.

nixos-discourse commented 3 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/colmena-deployment-extremely-slow/47546/15

eclairevoyant commented 3 months ago

What's the exact command you ran to build?

bratfizyk commented 3 months ago

What's the exact command you ran to build?

Hi, sorry for a delayed response. I had a problem with my computer. The exact command is nix-build ./image.nix. I've already updated the issue description.

aanderse commented 2 months ago

tried on 4c547b66635455ad061d4beecaf1805810dc0428 and could not reproduce via nix repl -f ~/nixpkgs:

nix-repl> config = { imports = [ ./nixos/modules/virtualisation/digital-ocean-image.nix ]; }

nix-repl> :b (pkgs.nixos config).digitalOceanImage
trace: warning: system.stateVersion is not set, defaulting to 24.11. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.

This derivation produced the following outputs:
  out -> /nix/store/m9gi9w2ss7g5k3jl3bwcgzcfmvwf7saf-digital-ocean-image

@bratfizyk what commit of nixpkgs are you trying this on?

bratfizyk commented 2 months ago

Hi @aanderse, thanks for replying to this. I've updated my system flake and I confirm I can now successfully execute nix-build ./image.nix. Regarding specific commit - I think this is the line we're searching for, right?

image

So assuming I read this correctly, now I'm on 2741b4b489b55df32afac57bc4bfd220e8bf617e, while previously I was on a71e967ef3694799d0c418c98332f7ff4cc5f6af.

aanderse commented 2 months ago

great to hear that everything is working now

presumably there was some commit that broke this but then eventually it got fixed

are we good to close this issue now?

bratfizyk commented 2 months ago

are we good to close this issue now?

Sure. Once again, thanks for looking into this.