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/amazon-init: add ec2.userData option to copy config only once (closes #41826) #52945

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hyperfekt
Copy link
Contributor

@hyperfekt hyperfekt commented Dec 26, 2018

Motivation for this change

see #41826.
This is also important when the contents are not a valid NixOS configuration and cannot be controlled, as is the case on, for example, Amazon Lightsail.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
    Nope, test seems to be broken already??
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@memberbetty memberbetty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nonce file location should be below some nix hierarchy. I.e. a descendant of /nix or /etc/nixos to reduce clashing with third party software that would also use /root/.initialized.

Additionally the nonce file should have some text that points at this code with the reason described in the file.

@hyperfekt
Copy link
Contributor Author

nonce file location should be below some nix hierarchy

nonce file should have some text

Done. I decided to put it under /etc/nixos so it's trivial to put there from the configuration via environment.etc.
I also added some tests, but since they still seem broken for me I couldn't check if they're actually any good.

@hyperfekt hyperfekt force-pushed the fix-41826 branch 3 times, most recently from 8a4bb69 to 1b3817a Compare February 25, 2019 00:56
nixos/tests/ec2.nix Outdated Show resolved Hide resolved
@hyperfekt hyperfekt force-pushed the fix-41826 branch 2 times, most recently from d4ca55c to ddda338 Compare August 14, 2019 19:07
@hyperfekt
Copy link
Contributor Author

hyperfekt commented Aug 14, 2019

Updated to use an option in addition to a nonce file, which seemed like a cleaner solution to me and also allows the use case of #66487.
Tests for EC2 still seem to be broken for me, so I haven't actually run them.

@hyperfekt hyperfekt changed the title nixos/amazon-init: copy configuration from user data only once (closes #41826) nixos/amazon-init: add ec2.userData option to copy config only once (closes #41826) Aug 14, 2019
This option prevents NixOS from copying invalid or outdated
configurations from EC2 user data.
Copy link
Contributor

@tomberek tomberek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good option to have. Suspect if we clean up conflicts this can be merged.

@stale
Copy link

stale bot commented Jul 1, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

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

andrew-d commented Jul 2, 2020

This is still something I’d love to see!

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

stale bot commented Jun 5, 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 5, 2021
@wegank wegank marked this pull request as draft March 20, 2024 15:00
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants