-
Notifications
You must be signed in to change notification settings - Fork 0
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
63: Added some lightweight Nix state #81
base: main
Are you sure you want to change the base?
Conversation
// If we ever decide to enable `use-xdg-base-directories`, we'll need this to point to | ||
// `$XDG_STATE_HOME/nix/channels` instead. | ||
const NIX_CHANNELS_FILE: &str = "/root/.nix-channels"; | ||
fn from_host() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Did you have anything specific in mind? I can put some wrapper functions around the constant path name, have the test(s) create a dummy channel file and use this code to parse it if we think there's value there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some unit tests would be fine by me. Just anything to run through a happy path and validate it works as intended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i propose the following as additions to this PR as they're lightweight enough IMO:
/root/.nix-defexpr/channels/holo-nixpkgs/.git-version
as a blob/var/lib/zerotier-one/identity.public
as a blob/etc/nixos
as a compressed tarball. i expect this a few KB max. in my case it's 711B usingtar --dereference --hard-dereference -cavjf etcnixos.tbz2 /etc/nixos/*.nix
- value of the NIX_PATH env var
- output of
systemctl status holo-nixpkgs-auto-upgrade.service
or equivalent - output of
systemctl status auto-update.timer
or equivalent
having these in a follow-up is fine with me.
i just think without these the requirements discussed in this issue aren't covered.
// If we ever decide to enable `use-xdg-base-directories`, we'll need this to point to | ||
// `$XDG_STATE_HOME/nix/channels` instead. | ||
const NIX_CHANNELS_FILE: &str = "/root/.nix-channels"; | ||
fn from_host() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some unit tests would be fine by me. Just anything to run through a happy path and validate it works as intended
Closes #63. Some of the heavier-weight Nix-related stuff we want to check on will be added to self-checks infrastructure.