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

nh os info #198

Merged
merged 6 commits into from
Jan 13, 2025
Merged

nh os info #198

merged 6 commits into from
Jan 13, 2025

Conversation

NotAShelf
Copy link
Contributor

@NotAShelf NotAShelf commented Dec 19, 2024

Quick and dirty implementation for nh os info, which would list

  • Information for current generation
  • Rest of the generations (if any) in a formatted table

when executed. WIP, I'll be working on this once I have some more time. Feedback welcome.

Closes #198

@viperML
Copy link
Owner

viperML commented Dec 19, 2024

Thank you for this. I guess you already know, but to sync:

  • Set the command name to info, not generations
  • Fix the "current" generation being displayed
  • Add some color to the output with owo_colors

After this is merged, I'll look into adding more stuff to info, but that would be after.

@NotAShelf
Copy link
Contributor Author

Yes I intend to get to all of those points (as we have previously discussed). This is here for visibility, and in case anyone wants to chime in.

Hopefully I will complete this in the following weeks when my mental load is a bit more bearable.

src/generations.rs Outdated Show resolved Hide resolved
@NotAShelf NotAShelf marked this pull request as ready for review January 4, 2025 17:39
@NotAShelf
Copy link
Contributor Author

Okay, implementation should be fine but I've not added colors. That can be done at a later date, or on maintainer's own discretion - I cannot come up with good looking colors.

Current design:

Generation No Build Date           NixOS Version                                Kernel       Configuration Revision Specialisations
51 (current)  2025-01-04 09:44:30  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 2df1a3a1-dirty            
50            2025-01-03 12:18:54  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 2df1a3a1-dirty            
49            2025-01-03 11:52:19  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 2df1a3a1-dirty            
48            2025-01-03 11:20:37  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 2df1a3a1-dirty            
47            2025-01-03 11:09:46  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 2df1a3a1-dirty            
46            2025-01-03 11:03:24  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 2df1a3a1-dirty            
45            2025-01-02 12:44:16  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 2df1a3a                   
44            2025-01-02 12:38:44  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 3825eb09-dirty            
43            2025-01-01 10:52:34  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 8d79f9f5-dirty            
42            2025-01-01 05:35:46  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 8d79f9f5-dirty            
41            2024-12-29 23:44:29  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf 8d79f9f                   
40            2024-12-29 23:41:07  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf c118324                   
39            2024-12-29 07:50:44  graphical-workstation-25.05.20241219.d70bd19 6.12.7-shelf a0aeaf56-dirty     

@viperML
Copy link
Owner

viperML commented Jan 10, 2025

is it ready?

@NotAShelf
Copy link
Contributor Author

It is ready.

@viperML viperML merged commit 93aeb37 into viperML:master Jan 13, 2025
1 of 2 checks passed
@bestlem
Copy link

bestlem commented Jan 25, 2025

I just ran nh os info on macOS 15.2.
I got not a useful result

NixOS Unknown
Closure Size: 9.8G

Generation No Build Date           NixOS Version Kernel  Configuration Revision Specialisations
224 (current) 1970-01-01 01:00:01  Unknown Unknown
223           1970-01-01 01:00:01  Unknown Unknown

@NotAShelf
Copy link
Contributor Author

nh os is for NixOS, not Darwin. I do not have any darwin systems to test (nor do I like the darwin ecosystem) so the implementation makes no effort to be compatible.

@bestlem
Copy link

bestlem commented Jan 25, 2025

@NotAShelf fair enough that was viperML's issue as well.

I would leave this here so someone like @ToyVo who does have access to macOS could see if it could be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants