Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
kylecarbs merged 2 commits intomainfromseparatedeps
Aug 18, 2023
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletionsflake.nix
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,9 +19,7 @@
bash
cairo
curl
docker
drpc.defaultPackage.${system}
exa
gcc
getopt
git
Expand All@@ -35,9 +33,9 @@
gotestsum
jq
kubernetes-helm
less
mockgen
nfpm
nix
nodejs
nodePackages.pnpm
nodePackages.prettier
Expand All@@ -52,7 +50,6 @@
protobuf
protoc-gen-go
ripgrep
screen
shellcheck
shfmt
sqlc
Expand All@@ -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.
Expand DownExpand Up@@ -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}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/coder/go/bin"
"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.
Expand DownExpand Up@@ -153,6 +159,13 @@
experimental-features = nix-command flakes
''
)
# Allow people to change shells!
(
pkgs.writeTextDir "etc/shells" ''
Copy link
Member

Choose a reason for hiding this comment

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

Need slash?

Suggested change
pkgs.writeTextDir"etc/shells"''
pkgs.writeTextDir"/etc/shells"''

Copy link
MemberAuthor

Choose a reason for hiding this comment

The 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 {
Expand DownExpand Up@@ -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";
};
config = {
Env = devEnvVars;
Entrypoint = [ "/bin/bash" ];
User = "coder";
};
};
in
{
in
{
packages = {
devEnvImage = devEnvImage;
};
defaultPackage = formatter; # or replace it with your desired default package.
devShell = pkgs.mkShell { buildInputs = devShellPackages; };
}
);
}
}
);
}

[8]ページ先頭

©2009-2025 Movatter.jp