!9IQChSjwSHXPPWTa:lix.systems

Lix

737 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms225 Servers

Load older messages


SenderMessageTime
15 Dec 2024
@n0emis:noemis.meember * I'm running lix 2.91.1 on darwin16:23:55
@n0emis:noemis.meember * I'm running lix 2.91.1 on darwin (and also tested this on x86_64-linux with the latest lix-master)16:25:28
@n0emis:noemis.meember * I'm running lix 2.91.1 on darwin (and also tested this on x86_64-linux with the latest lix-main) 16:25:34
@n0emis:noemis.meemberAnd of course the copying is done every time the command is run (or something is evaluated)16:30:55
@mel:rnrd.euMel changed their profile picture.21:46:29
16 Dec 2024
@dawnofmidnight:matrix.orgdawn joined the room.04:50:13
@merlindawizard:matrix.orgmerlindawizard joined the room.09:15:47
@tammi:greyseal.euTammi (ey/em) joined the room.12:59:18
@dxmh:matrix.orgdom joined the room.15:11:08
@dxmh:matrix.orgdom

hi. i've been trying to update a flake-based nixos system on a machine with no internet access. for the last week i've been successfully doing it like so:

laptop$ # this host has internet connection
laptop$ nix copy --to /path/to/usb/drive/ \
  .#nixosConfigurations.offlineHost.config.system.build.toplevel
offlineHost$ # this host has no network connection
offlineHost$ nix copy --all --from /path/to/usb/drive/
offlineHost$ nixos-rebuild switch --flake /path/to/flake

this worked well until today, as now the nixos-rebuild command fails because it wants to fetch archives from github :(

i've tried all the tricks from the various threads about this, but i've had no luck. i'm now surprised it even worked at all. now i have a system that i can no longer update

then i saw this lix issue and now i have some hope:
https://git.lix.systems/lix-project/lix/issues/116

i'm currently checking out lix to see if it might be more suited for use on an offline machine.

does anyone here have any experience or advice for me? :)

15:28:53
@k900:0upti.meK900 Why nixos-rebuild at all? 15:29:25
@k900:0upti.meK900 Just switch-to-configuration to your new system 15:29:33
@k900:0upti.meK900Presumably you don't need deployment history on an airgapped machine 15:29:46
@k900:0upti.meK900 And if you do you can just call nix-env yourself 15:30:02
@dxmh:matrix.orgdom

thank you K900! i will try this. how would i find the correct switch-to-configuration script on the airgapped machine? assuming i follow the steps above (except nixos-rebuild), i have several switch-to-configuration files and i'm not sure which is the one i want to run:

$ ls /nix/store/*nixos-system-offlineHost*/bin/switch-to-configuration
/nix/store/8f7m0wgws72gichxrmmvy9fbz5zpxhsb-nixos-system-offlineHost-24.11.20241213.314e12b/bin/switch-to-configuration
/nix/store/8zg49xpy4jiqspby1bwl7l5d9m6xrf5s-nixos-system-offlineHost-24.11.20241213.314e12b/bin/switch-to-configuration
/nix/store/ip9qcm6jv85d370jqhycd5lbivfcyddy-nixos-system-offlineHost-24.11.20241130.62c435d/bin/switch-to-configuration
/nix/store/kqag8sacazr1sww6b1xwdl7kawj9dmsh-nixos-system-offlineHost-24.11.20241213.314e12b/bin/switch-to-configuration
15:48:10
@dxmh:matrix.orgdom

aha, it tells me on the nix copy command:

copying path '/nix/store/lwl9s80fm08r4ma8m3lkssx75bv9qq3a-nixos-system-thebox-24.11.20241213.314e12b' to 'local'...

i can then run /nix/store/lwl9s80fm08r4ma8m3lkssx75bv9qq3a-nixos-system-thebox-24.11.20241213.314e12b/bin/switch-to-configuration switch

16:01:48
@dxmh:matrix.orgdom *

aha, it tells me on the nix copy command:

copying path '/nix/store/lwl9s80fm08r4ma8m3lkssx75bv9qq3a-nixos-system-thebox-24.11.20241213.314e12b' to 'local'...

i can then run /nix/store/lwl9s80fm08r4ma8m3lkssx75bv9qq3a-nixos-system-thebox-24.11.20241213.314e12b/bin/switch-to-configuration switch

16:01:56
@dxmh:matrix.orgdom K900: this seems to works perfectly, thank you so much 16:06:36
@dxmh:matrix.orgdom oh, interesting, it seems switch-to-configuration does not persist a reboot 😕
https://github.com/NixOS/nixpkgs/issues/82851
16:44:32
@k900:0upti.meK900 You want switch-to-configuration switch 16:44:46
@k900:0upti.meK900That should update the bootloader config16:44:51
@dxmh:matrix.orgdomit doesn't appear to do that for me (same for the people in that issue)16:45:38
@k900:0upti.meK900That sounds wrong16:46:03
@k900:0upti.meK900What bootloader setup are you using?16:46:07
@dxmh:matrix.orgdom
    boot.loader = {
      timeout = 0;
      efi.canTouchEfiVariables = true;
      systemd-boot = {
        enable = true;
        configurationLimit = 5; # Prevent infinite generations filling up /boot
      };
    };
16:49:58
@puck:puck.moepuck
In reply to @k900:0upti.me
That should update the bootloader config
also, add the closure to the system profile
16:50:37
@dxmh:matrix.orgdom the discussion in the link above (from 2020-2024) does suggest that switch-to-configuration switch doesn't work as it suggests. is there another way to update the bootloader config? 17:00:26
@dxmh:matrix.orgdomsorry i realise this is lix and i'm now discussing general nix stuff, happy to go elsewhere if this is not appropriate 17:01:25
@puck:puck.moepuck
In reply to @dxmh:matrix.org
the discussion in the link above (from 2020-2024) does suggest that switch-to-configuration switch doesn't work as it suggests. is there another way to update the bootloader config?
you need to run nix-env -p /nix/var/nix/profiles/system --set {system closure} first before the switch; the profiles are what make it into the configuration
17:11:10
@puck:puck.moepuck * you need to run nix-env -p /nix/var/nix/profiles/system --set {system closure} first before the switch; the profiles are what make it into the bootloader config 17:11:16

Show newer messages


Back to Room ListRoom Version: 10