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

nixos/activation: add fisrt-start activation script support #77607

Open
danbst opened this issue Jan 13, 2020 · 4 comments
Open

nixos/activation: add fisrt-start activation script support #77607

danbst opened this issue Jan 13, 2020 · 4 comments
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos

Comments

@danbst
Copy link
Contributor

danbst commented Jan 13, 2020

The problem: I had a RPi 3, and had no keyboard, no ethernet plug and no monitor. The only two ways to talk to it were via sdcard and WiFi.

Ideally it should be possible to:

  • write nixos image to sdcard
  • add /etc/nixos/configuration.nix to sdcard root's filesystem
  • add startup script somewhere (which should setup WiFi, start sshd and run nixos-rebuild boot)
  • let nixos run this script on first boot

It's impossible to build a custom image for RPi without having aarch64 machine, so there should be a standard way to customize sdcard system. I think something similar is already done for Amazon images.

@symphorien
Copy link
Member

Maybe you can put your startup script in a systemd unit: from man systemd.unit:

           ConditionFirstBoot= takes a boolean argument. This condition may be used to
           conditionalize units on whether the system is booting up with an unpopulated /etc
           directory (specifically: an /etc with no /etc/machine-id). This may be used to
           populate /etc on the first boot after factory reset, or when a new system
           instance boots up for the first time.

@stale
Copy link

stale bot commented Jul 11, 2020

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 11, 2020
@dfrankland
Copy link
Contributor

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 27, 2020
@stale
Copy link

stale bot commented Jun 26, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos
Projects
None yet
Development

No branches or pull requests

3 participants