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

[READY] - added vim config to hide mouse and locale for military time #774

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

fossadmin
Copy link

@fossadmin fossadmin commented Sep 22, 2024

Description of PR

Fixes: #694

Added vim config to disable mouse plus plugin for nix syntax highlighting.

Also, added locale settings for 24h military time.

@fossadmin fossadmin linked an issue Sep 22, 2024 that may be closed by this pull request
Copy link
Member

@kylerisse kylerisse left a comment

Choose a reason for hiding this comment

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

Hi @fossadmin . Looks like CI is failing from the new drive by formatter implementation...

https://github.com/socallinuxexpo/scale-network/actions/runs/10984414775/job/30494982929?pr=774

please run nixfmt against /nix/machines/_common/base.nix and rebase

@fossadmin
Copy link
Author

Hey @kylerisse , just pushed reformatted update through.

@fossadmin
Copy link
Author

Looks like reformatting with nixfmt is what caused "nix checks" to fail. Manually reformatted based on the errors and "nix checks" is now successful.

@fossadmin
Copy link
Author

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

@kylerisse
Copy link
Member

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

Not sure. This was just merged Saturday night with no documented guidelines, so you’re the first victim. Best to get comment from for @djacu and @sarcasticadmin .

@sarcasticadmin
Copy link
Member

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

Since its part of the flake.nix formatter you should be able to just run nix fmt from inside the scale-network repo and itll call the same formatters as CI and format to appropriate files in the repo. We definitely should document this.

@fossadmin
Copy link
Author

fossadmin commented Sep 24, 2024

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

Since its part of the flake.nix formatter you should be able to just run nix fmt from inside the scale-network repo and itll call the same formatters as CI and format to appropriate files in the repo. We definitely should document this.

@sarcasticadmin maybe a shell.nix file with all the tools needed so we can just run nix-shell in the repo and have a similar dev environment with everything we need?

I just ran nix fmt to test the formatter you mentioned and got the following error:

error:
       … in the left operand of the update (//) operator

         at «string»:56:13:

           55|             # This is shadowed in the next //
           56|             // sourceInfo
             |             ^
           57|             // {

       … in the left operand of the update (//) operator

         at /nix/store/zazfm8nliz6ar3310x1cf9ynlf3ysl5f-source/flake.nix:31:5:

           30|     })
           31|     // {
             |     ^
           32|       formatter = import ./nix/formatter inputs;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: unable to download 'https://api.github.com/repos/hercules-ci/flake-parts/tarball/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca': HTTP error 401

       response body:

       {
         "message": "Bad credentials",
         "documentation_url": "https://docs.github.com/rest",
         "status": "401"
       }

@kylerisse
Copy link
Member

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

Thanks @sarcasticadmin for clearing up the confusion.

Hi @fossadmin you can get the equivalent of a nix-shell with nix develop

nix develop
nix fmt

@kylerisse
Copy link
Member

@fossadmin next request is to please squash your commits. Since you have 4 the process should be:

git rebase -i HEAD~4

In the editor, replace the word pick on 2nd through 4th commit lines with s for squash. Save the file buffer. You will then be in your editor again with the commit messages. I suggest you just remove all lines below the first so the message is the same as the 1st commit. You should then see just 1 commit in your git log with all changes included. You will have to force push the branch (git push -f) to update this PR but should now see only 1 clean commit. I'll ping you on that chat thing we use for that group that we're in also so we can discuss there if you have any questions.

@fossadmin
Copy link
Author

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

Thanks @sarcasticadmin for clearing up the confusion.

Hi @fossadmin you can get the equivalent of a nix-shell with nix develop

nix develop
nix fmt

@kylerisse I tried nix develop and got the same error as the one in my previous comment. I think there's something wrong with my laptop. Will reinstall NixOS in the morning, in the process of backing up my data now.

@fossadmin
Copy link
Author

@fossadmin next request is to please squash your commits. Since you have 4 the process should be:

git rebase -i HEAD~4

In the editor, replace the word pick on 2nd through 4th commit lines with s for squash. Save the file buffer. You will then be in your editor again with the commit messages. I suggest you just remove all lines below the first so the message is the same as the 1st commit. You should then see just 1 commit in your git log with all changes included. You will have to force push the branch (git push -f) to update this PR but should now see only 1 clean commit. I'll ping you on that chat thing we use for that group that we're in also so we can discuss there if you have any questions.

@kylerisse your instructions were perfect, thanks! Looks like it's down to 1 commit now.

@djacu
Copy link
Contributor

djacu commented Sep 24, 2024

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

Since its part of the flake.nix formatter you should be able to just run nix fmt from inside the scale-network repo and itll call the same formatters as CI and format to appropriate files in the repo. We definitely should document this.

@sarcasticadmin maybe a shell.nix file with all the tools needed so we can just run nix-shell in the repo and have a similar dev environment with everything we need?

I just ran nix fmt to test the formatter you mentioned and got the following error:

error:
       … in the left operand of the update (//) operator

         at «string»:56:13:

           55|             # This is shadowed in the next //
           56|             // sourceInfo
             |             ^
           57|             // {

       … in the left operand of the update (//) operator

         at /nix/store/zazfm8nliz6ar3310x1cf9ynlf3ysl5f-source/flake.nix:31:5:

           30|     })
           31|     // {
             |     ^
           32|       formatter = import ./nix/formatter inputs;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: unable to download 'https://api.github.com/repos/hercules-ci/flake-parts/tarball/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca': HTTP error 401

       response body:

       {
         "message": "Bad credentials",
         "documentation_url": "https://docs.github.com/rest",
         "status": "401"
       }

This doesn't look like a nix or dev environment problem but possibly that you are getting rate limited by GH. Do you have a PAT setup?

@fossadmin
Copy link
Author

Hey @djacu , I'm using SSH keys but just checked my PAT setup and it says it expired on Sept. 6th. I'll update it in the morning and see if that fixes my problem. Still probably need to reinstall NixOS due to some other issues with the wofi app launcher for wayland throwing this error:

segmentation fault (core dumped)

@sarcasticadmin
Copy link
Member

FYI, I do not have the nixfmt command on my system but I'm running NixOS unstable and ran nix-shell -p nixfmt to run it on the base.nix file. Not sure if that is what caused the issues.

Since its part of the flake.nix formatter you should be able to just run nix fmt from inside the scale-network repo and itll call the same formatters as CI and format to appropriate files in the repo. We definitely should document this.

@sarcasticadmin maybe a shell.nix file with all the tools needed so we can just run nix-shell in the repo and have a similar dev environment with everything we need?

I just ran nix fmt to test the formatter you mentioned and got the following error:

error:
       … in the left operand of the update (//) operator

         at «string»:56:13:

           55|             # This is shadowed in the next //
           56|             // sourceInfo
             |             ^
           57|             // {

       … in the left operand of the update (//) operator

         at /nix/store/zazfm8nliz6ar3310x1cf9ynlf3ysl5f-source/flake.nix:31:5:

           30|     })
           31|     // {
             |     ^
           32|       formatter = import ./nix/formatter inputs;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: unable to download 'https://api.github.com/repos/hercules-ci/flake-parts/tarball/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca': HTTP error 401

       response body:

       {
         "message": "Bad credentials",
         "documentation_url": "https://docs.github.com/rest",
         "status": "401"
       }

That was the same error we say while were at nullspace. Its unclear why you'd be setting a bad credentials error since you dont need credentials to download the source: https://api.github.com/repos/hercules-ci/flake-parts/tarball/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca (Im able to download it successfully). Are you using some kind of shared VPN or proxy? I like djacu's recommendation of trying to install a GH PAT to see if that helps, but its still odd that you get a 401 from the gitub api.

Another thing to check is that you dont have a ~/.netrc or similar file with credentials to github since that could be causing the 401. https://nixos.wiki/wiki/Enterprise mentions setting where else this could be configured for nixos.

@fossadmin
Copy link
Author

@sarcasticadmin yeah, it's really weird. I don't see any .netrc files and not using a VPN or proxy. I'm hoping a fresh install does the trick but I'll try the PAT as well.

Copy link
Member

@kylerisse kylerisse left a comment

Choose a reason for hiding this comment

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

@fossadmin thanks for rebasing and working through the formatting. PR LGTM! We should have @owendelong review before merging as originally noted.

@djacu
Copy link
Contributor

djacu commented Sep 24, 2024

I don't completely understand it either but searching for some keywords returned a bunch of gh rate limiting discussions. If you can download the file in your browser by following the link then it's possibly something else

@fossadmin
Copy link
Author

I don't completely understand it either but searching for some keywords returned a bunch of gh rate limiting discussions. If you can download the file in your browser by following the link then it's possibly something else

It was really weird because I was able to download the file via that link in my browser. I reinstalled NixOS this morning and seems to be working fine now.

@sarcasticadmin
Copy link
Member

Tested this by modifying the existing loghost vmTest and importing machines/_common/base.nix:

ss-202409271727422236
ss-202409271727422225
ss-202409271727422212

The configuration looks like its loading as expected for vim and date

Copy link
Member

@sarcasticadmin sarcasticadmin left a comment

Choose a reason for hiding this comment

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

If you can fixup the changes once your done, then Ill merge :shipit:

nix/machines/_common/base.nix Outdated Show resolved Hide resolved
nix/machines/_common/base.nix Show resolved Hide resolved
@fossadmin
Copy link
Author

If you can fixup the changes once your done, then Ill merge :shipit:

@sarcasticadmin done!

Copy link
Member

@sarcasticadmin sarcasticadmin left a comment

Choose a reason for hiding this comment

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

awesome, looks great @fossadmin :shipit:

@sarcasticadmin sarcasticadmin changed the title added vim config to hide mouse and locale for military time [READY] - added vim config to hide mouse and locale for military time Sep 27, 2024
@sarcasticadmin sarcasticadmin merged commit 25abe86 into master Sep 27, 2024
14 checks passed
@sarcasticadmin sarcasticadmin deleted the issue694 branch September 27, 2024 22:39
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.

shell-isms for sanity
4 participants