-
-
Notifications
You must be signed in to change notification settings - Fork 36
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 support #199
Nixos support #199
Conversation
WalkthroughThe project introduces a comprehensive enhancement for environment management and development workflow with Nix and Visual Studio Code. It focuses on automating the setup for a Hugo project, managing VSCode extensions more efficiently, and ensuring a cleaner repository by ignoring unnecessary files. This update streamlines the development process, making it easier to maintain and collaborate on the project. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (5)
- .envrc (1 hunks)
- .gitignore (2 hunks)
- list-vscode-extensions.sh (1 hunks)
- shell.nix (1 hunks)
- vscode.sh (1 hunks)
Additional comments: 4
.envrc (1)
- 1-1: The directive
use nix
is correctly used to enable Nix for environment management. This is a standard and recommended approach for projects utilizing Nix, ensuring a consistent development environment.vscode.sh (1)
- 1-3: The script
vscode.sh
correctly launches VSCode with a specified extensions directory, enhancing the development experience by allowing developers to use a consistent set of extensions. The shebang and command syntax are correctly used.list-vscode-extensions.sh (1)
- 1-3: The script
list-vscode-extensions.sh
effectively lists installed VSCode extensions and formats the output to generate installation commands. This facilitates easy management and replication of VSCode setups across different environments. The shebang and command syntax are correctly used..gitignore (1)
- 12-12: The addition of
.vscode-extensions/
to the.gitignore
file is a good practice, ensuring that personal or local development environment configurations are not shared across all developers. This keeps the repository clean and focused on essential files.
let | ||
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8.tar.gz"; | ||
pkgs = import nixpkgs { config = { }; overlays = [ ]; }; | ||
in | ||
with pkgs; | ||
mkShell { | ||
buildInputs = [ | ||
hugo | ||
vscode | ||
]; | ||
# DIRENV_LOG_FORMAT to reduce direnv verbosity | ||
# See https://github.com/direnv/direnv/issues/68#issuecomment-162639262 | ||
shellHook = '' | ||
export DIRENV_LOG_FORMAT= | ||
echo "-----------------------" | ||
echo "🌈 Your Hugo Dev Environment is ready." | ||
echo "It provides hugo and vscode for use with the QGIS Hugo Project" | ||
echo "" | ||
echo "🪛 Installing VSCode Extensions:" | ||
echo "--------------------------------" | ||
code --extensions-dir=".vscode-extensions" --install-extension maziac.asm-code-lens | ||
echo "" | ||
echo "📒 Note:" | ||
echo "-----------------------" | ||
echo "start vscode like this:" | ||
echo "" | ||
echo "code --extensions-dir=\".vscode-extensions\" ." | ||
echo "-----------------------" | ||
''; | ||
postShellHook = '' | ||
''; | ||
} |
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.
The shell.nix
file correctly sets up a development environment tailored for Hugo projects, including Hugo and VSCode as build inputs. The use of a specific commit hash for fetching Nix packages ensures a stable and reproducible environment. The shell hook enhances usability by installing VSCode extensions and providing clear instructions for launching VSCode.
However, for clarity and maintainability, consider adding comments to explain the choice of the specific VSCode extension (maziac.asm-code-lens
) and its relevance to the Hugo project. This will help future contributors understand the rationale behind these choices.
+ # The maziac.asm-code-lens extension is included for [reason]. It's particularly useful for [use case].
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
let | |
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8.tar.gz"; | |
pkgs = import nixpkgs { config = { }; overlays = [ ]; }; | |
in | |
with pkgs; | |
mkShell { | |
buildInputs = [ | |
hugo | |
vscode | |
]; | |
# DIRENV_LOG_FORMAT to reduce direnv verbosity | |
# See https://github.com/direnv/direnv/issues/68#issuecomment-162639262 | |
shellHook = '' | |
export DIRENV_LOG_FORMAT= | |
echo "-----------------------" | |
echo "🌈 Your Hugo Dev Environment is ready." | |
echo "It provides hugo and vscode for use with the QGIS Hugo Project" | |
echo "" | |
echo "🪛 Installing VSCode Extensions:" | |
echo "--------------------------------" | |
code --extensions-dir=".vscode-extensions" --install-extension maziac.asm-code-lens | |
echo "" | |
echo "📒 Note:" | |
echo "-----------------------" | |
echo "start vscode like this:" | |
echo "" | |
echo "code --extensions-dir=\".vscode-extensions\" ." | |
echo "-----------------------" | |
''; | |
postShellHook = '' | |
''; | |
} | |
let | |
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8.tar.gz"; | |
pkgs = import nixpkgs { config = { }; overlays = [ ]; }; | |
in | |
with pkgs; | |
mkShell { | |
buildInputs = [ | |
hugo | |
vscode | |
]; | |
# DIRENV_LOG_FORMAT to reduce direnv verbosity | |
# See https://github.com/direnv/direnv/issues/68#issuecomment-162639262 | |
shellHook = '' | |
export DIRENV_LOG_FORMAT= | |
echo "-----------------------" | |
echo "🌈 Your Hugo Dev Environment is ready." | |
echo "It provides hugo and vscode for use with the QGIS Hugo Project" | |
echo "" | |
echo "🪛 Installing VSCode Extensions:" | |
echo "--------------------------------" | |
# The maziac.asm-code-lens extension is included for [reason]. It's particularly useful for [use case]. | |
code --extensions-dir=".vscode-extensions" --install-extension maziac.asm-code-lens | |
echo "" | |
echo "📒 Note:" | |
echo "-----------------------" | |
echo "start vscode like this:" | |
echo "" | |
echo "code --extensions-dir=\".vscode-extensions\" ." | |
echo "-----------------------" | |
''; | |
postShellHook = '' | |
''; | |
} |
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.
Hold please before merging
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.
@timlinux, I've noted your request to hold off on merging the PR. If there are specific concerns or additional changes that need to be addressed, please let me know how I can assist.
This PR adds convenience tools for working with the project in Nixos and VSCode. It adds extensions that make working with Hugo easier in VSCode. The list-vscode-extensions.sh is a convenience tool to enumerate the installed VSCode extensions.
Summary by CodeRabbit
.gitignore
to exclude.vscode-extensions/
directory.