- Notifications
You must be signed in to change notification settings - Fork928
fix: separate dev shell and dev image nix deps#9189
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -19,9 +19,7 @@ | ||||||
bash | ||||||
cairo | ||||||
curl | ||||||
drpc.defaultPackage.${system} | ||||||
gcc | ||||||
getopt | ||||||
git | ||||||
@@ -35,9 +33,9 @@ | ||||||
gotestsum | ||||||
jq | ||||||
kubernetes-helm | ||||||
less | ||||||
mockgen | ||||||
nfpm | ||||||
nodejs | ||||||
nodePackages.pnpm | ||||||
nodePackages.prettier | ||||||
@@ -52,7 +50,6 @@ | ||||||
protobuf | ||||||
protoc-gen-go | ||||||
ripgrep | ||||||
shellcheck | ||||||
shfmt | ||||||
sqlc | ||||||
@@ -67,6 +64,15 @@ | ||||||
zsh | ||||||
zstd | ||||||
]; | ||||||
# We separate these to reduce the size of the dev shell for packages that we only | ||||||
# want in the image. | ||||||
devImagePackages = with pkgs; [ | ||||||
docker | ||||||
exa | ||||||
nix | ||||||
nixpkgs-fmt | ||||||
screen | ||||||
]; | ||||||
# This is the base image for our Docker container used for development. | ||||||
# Use `nix-prefetch-docker ubuntu --arch amd64 --image-tag lunar` to get this. | ||||||
@@ -102,7 +108,7 @@ | ||||||
# Environment variables that live in `/etc/environment` in the container. | ||||||
# These will also be applied to the container config. | ||||||
devEnvVars = [ | ||||||
"PATH=${pkgs.lib.makeBinPath(devShellPackages ++ devImagePackages)}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/coder/go/bin" | ||||||
# This setting prevents Go from using the public checksum database for | ||||||
# our module path prefixes. It is required because these are in private | ||||||
# repositories that require authentication. | ||||||
@@ -153,6 +159,13 @@ | ||||||
experimental-features = nix-command flakes | ||||||
'' | ||||||
) | ||||||
# Allow people to change shells! | ||||||
( | ||||||
pkgs.writeTextDir "etc/shells" '' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Need slash? Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Nah, it adds that automatically | ||||||
${pkgs.bash}/bin/bash | ||||||
${pkgs.zsh}/bin/zsh | ||||||
'' | ||||||
) | ||||||
# This is the debian script for managing Docker with `sudo service docker ...`. | ||||||
( | ||||||
pkgs.writeTextFile { | ||||||
@@ -189,19 +202,19 @@ | ||||||
cp -a ${pkgs.glibcLocales}/lib/locale/locale-archive usr/lib/locale/locale-archive | ||||||
''; | ||||||
config = { | ||||||
Env = devEnvVars; | ||||||
Entrypoint = [ "/bin/bash" ]; | ||||||
User = "coder"; | ||||||
}; | ||||||
}; | ||||||
in | ||||||
{ | ||||||
packages = { | ||||||
devEnvImage = devEnvImage; | ||||||
}; | ||||||
defaultPackage = formatter; # or replace it with your desired default package. | ||||||
devShell = pkgs.mkShell { buildInputs = devShellPackages; }; | ||||||
} | ||||||
); | ||||||
} |