Skip to content

Commit 6080712

Browse files
committed
Pin gdb to 16.1
1 parent b4292dc commit 6080712

2 files changed

Lines changed: 31 additions & 4 deletions

File tree

bin/switch

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ function show_usage {
66
echo "Usage: switch [OPTIONS] [PROFILE]"
77
echo
88
echo "Options:"
9-
echo " --brew Run brew bundle after successful switch"
10-
echo " --no-gc Skip running nix garbage collection"
11-
echo " --help Show this help message"
9+
echo " --brew Run brew bundle after successful switch"
10+
echo " --no-gc Skip running nix garbage collection"
11+
echo " --skip-todos Allow switch even if TODO comments exist"
12+
echo " --help Show this help message"
1213
echo
1314
echo "If PROFILE is not specified, username@hostname will be used."
1415
exit 0
@@ -17,6 +18,7 @@ function show_usage {
1718
# Parse command line arguments
1819
RUN_BREW=true
1920
RUN_GC=true
21+
SKIP_TODOS=false
2022
PROFILE=""
2123
TRACE=""
2224
FAST=false
@@ -42,6 +44,10 @@ while [[ $# -gt 0 ]]; do
4244
FAST=true
4345
shift
4446
;;
47+
--skip-todos)
48+
SKIP_TODOS=true
49+
shift
50+
;;
4551
*)
4652
PROFILE="$1"
4753
shift
@@ -59,6 +65,18 @@ if [ -z "$PROFILE" ]; then
5965
PROFILE="$(whoami)@$(hostname -s)"
6066
fi
6167

68+
# Check for TODO comments
69+
if [ "$SKIP_TODOS" = false ]; then
70+
TODO_FILES=$(grep -rl --exclude-dir=.git "TODO" . 2>/dev/null || true)
71+
if [ -n "$TODO_FILES" ]; then
72+
echo "Error: TODO comments found in the following files:"
73+
echo "$TODO_FILES"
74+
echo
75+
echo "Resolve the TODOs or use --skip-todos to proceed anyway."
76+
exit 1
77+
fi
78+
fi
79+
6280
echo "Switching to profile: $PROFILE"
6381

6482
# Run home-manager with the selected profile

modules/shell.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ let
1212
cfg = config.modules.shell;
1313
baseZshrc = builtins.readFile ../lib/zshrc;
1414
finalZshrc = baseZshrc + "\n# Appended ZSH configuration\n" + cfg.zshrc.append;
15+
16+
# TODO: unpin once 17.1+ is no longer broken
17+
gdb_16_1 = pkgs.gdb.overrideAttrs (oldAttrs: rec {
18+
version = "16.1";
19+
src = pkgs.fetchurl {
20+
url = "mirror://gnu/gdb/gdb-${version}.tar.xz";
21+
sha256 = "1i940b04404xr44xc66c4r4nk091czqz7zzrmhbpk64aaaax1z5w";
22+
};
23+
});
1524
in
1625
{
1726
options.modules.shell = {
@@ -53,7 +62,7 @@ in
5362
libyaml.dev
5463
jq
5564
direnv
56-
gdb
65+
gdb_16_1
5766

5867
# Nix tools
5968
nix-prefetch

0 commit comments

Comments
 (0)