Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7f1081

Browse files
authored
fix(flake.nix): install locales on linux host devShells (#16120)
Change-Id: I22dba63d317b41749c807a55e15278006cdcecad Signed-off-by: Thomas Kosiewski <[email protected]> - 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`.
1 parent 92d02ad commit e7f1081

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

dogfood/contents/Dockerfile.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM nixos/nix:2.19.2 as nix
2+
FROM nixos/nix:2.19.2 AS nix
33

44
# enable --experimental-features 'nix-command flakes' globally
55
# 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 && \
1414
nix-collect-garbage -d
1515

1616
# Final image
17-
FROM codercom/enterprise-base:latest as final
17+
FROM codercom/enterprise-base:latest AS final
1818

1919
# Set the non-root user
2020
USER root

flake.nix

+9-5
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,22 @@
5858

5959
# The minimal set of packages to build Coder.
6060
devShellPackages = with pkgs; [
61-
# google-chrome is not available on OSX and aarch64 linux
62-
(if pkgs.stdenv.hostPlatform.isDarwin || pkgs.stdenv.hostPlatform.isAarch64 then null else google-chrome)
61+
# google-chrome is not available on aarch64 linux
62+
(lib.optionalDrvAttr ( !stdenv.isLinux || !stdenv.isAarch64 ) google-chrome)
6363
# strace is not available on OSX
64-
(if pkgs.stdenv.hostPlatform.isDarwin then null else strace)
64+
(lib.optionalDrvAttr ( !pkgs.stdenv.isDarwin ) strace)
6565
bat
6666
cairo
6767
curl
6868
delve
6969
drpc.defaultPackage.${system}
70+
fzf
7071
gcc
7172
gdk
7273
getopt
7374
gh
7475
git
76+
(lib.optionalDrvAttr stdenv.isLinux glibcLocales)
7577
gnumake
7678
gnused
7779
go_1_22
@@ -85,8 +87,10 @@
8587
kubernetes-helm
8688
less
8789
mockgen
90+
moreutils
8891
nfpm
8992
nodejs
93+
neovim
9094
pnpm
9195
openssh
9296
openssl
@@ -98,8 +102,6 @@
98102
protobuf
99103
proto_gen_go_1_30
100104
ripgrep
101-
# This doesn't build on latest nixpkgs (July 10 2024)
102-
(pinnedPkgs.sapling)
103105
shellcheck
104106
(pinnedPkgs.shfmt)
105107
sqlc
@@ -165,6 +167,8 @@
165167
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
166168
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
167169
'';
170+
171+
LOCALE_ARCHIVE = with pkgs; lib.optionalDrvAttr stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
168172
};
169173
packages = {
170174
proto_gen_go = proto_gen_go_1_30;

0 commit comments

Comments
 (0)