fix(flake.nix): install locales on linux host devShells (#16120)

Change-Id: I22dba63d317b41749c807a55e15278006cdcecad
Signed-off-by: Thomas Kosiewski <tk@coder.com>

- Adds neovim and fzf to development tools, removes sapling, and fixes locale issues on Linux systems. 
- Updates Dockerfile.nix syntax to use uppercase `AS` to remove warnings. 
- Refactored conditional logic for strace inclusion using `lib.optional`.
This commit is contained in:
Thomas Kosiewski
2025-01-15 17:14:55 +01:00
committed by GitHub
parent 92d02ad6cb
commit e7f108145a
2 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,5 @@
# Build stage
FROM nixos/nix:2.19.2 as nix
FROM nixos/nix:2.19.2 AS nix
# enable --experimental-features 'nix-command flakes' globally
# nix does not enable these features by default these are required to run commands like
@ -14,7 +14,7 @@ RUN nix profile install "/app#all" --priority 4 && \
nix-collect-garbage -d
# Final image
FROM codercom/enterprise-base:latest as final
FROM codercom/enterprise-base:latest AS final
# Set the non-root user
USER root

View File

@ -58,20 +58,22 @@
# The minimal set of packages to build Coder.
devShellPackages = with pkgs; [
# google-chrome is not available on OSX and aarch64 linux
(if pkgs.stdenv.hostPlatform.isDarwin || pkgs.stdenv.hostPlatform.isAarch64 then null else google-chrome)
# google-chrome is not available on aarch64 linux
(lib.optionalDrvAttr ( !stdenv.isLinux || !stdenv.isAarch64 ) google-chrome)
# strace is not available on OSX
(if pkgs.stdenv.hostPlatform.isDarwin then null else strace)
(lib.optionalDrvAttr ( !pkgs.stdenv.isDarwin ) strace)
bat
cairo
curl
delve
drpc.defaultPackage.${system}
fzf
gcc
gdk
getopt
gh
git
(lib.optionalDrvAttr stdenv.isLinux glibcLocales)
gnumake
gnused
go_1_22
@ -85,8 +87,10 @@
kubernetes-helm
less
mockgen
moreutils
nfpm
nodejs
neovim
pnpm
openssh
openssl
@ -98,8 +102,6 @@
protobuf
proto_gen_go_1_30
ripgrep
# This doesn't build on latest nixpkgs (July 10 2024)
(pinnedPkgs.sapling)
shellcheck
(pinnedPkgs.shfmt)
sqlc
@ -165,6 +167,8 @@
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';
LOCALE_ARCHIVE = with pkgs; lib.optionalDrvAttr stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
};
packages = {
proto_gen_go = proto_gen_go_1_30;