fix(nix): resolve stdenv deprecation warnings and gemini-cli deprecation

This commit is contained in:
Noah Masur
2026-08-24 20:22:43 -06:00
parent 32989f1758
commit 4ba1ed807c
23 changed files with 48 additions and 43 deletions
@@ -23,7 +23,7 @@ in
home.packages = [
pkgs._1password-cli
]
++ (if pkgs.stdenv.isLinux then [ pkgs._1password-gui ] else [ ]);
++ (if pkgs.stdenv.hostPlatform.isLinux then [ pkgs._1password-gui ] else [ ]);
# # Firefox extension
# programs.firefox.profiles.default.extensions.packages = [
@@ -203,13 +203,13 @@ in
};
# Used for macOS
xdg.enable = lib.mkIf pkgs.stdenv.isDarwin true;
xdg.enable = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin true;
xdg.desktopEntries.aerc = lib.mkIf (pkgs.stdenv.isLinux) {
xdg.desktopEntries.aerc = lib.mkIf (pkgs.stdenv.hostPlatform.isLinux) {
name = "aerc";
exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} -e aerc %u";
};
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
"${config.xsession.windowManager.i3.config.modifier}+Shift+e" =
let
terminal = config.nmasur.presets.services.i3.terminal;
@@ -14,12 +14,12 @@ in
options.nmasur.presets.programs.calibre.enable = lib.mkEnableOption "Calibre e-book manager";
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf pkgs.stdenv.isLinux [ pkgs.calibre ];
home.packages = lib.mkIf pkgs.stdenv.hostPlatform.isLinux [ pkgs.calibre ];
home.sessionVariables = {
CALIBRE_USE_DARK_PALETTE = 1;
};
home.file.".Brewfile".text = lib.mkIf pkgs.stdenv.isDarwin /* homebrew */ ''
home.file.".Brewfile".text = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin /* homebrew */ ''
cask "calibre" # Nix package broken on macOS
'';
@@ -18,7 +18,7 @@ in
programs.chawan = {
enable = true;
settings = {
external.copy-cmd = if pkgs.stdenv.isLinux then "xclip -selection clipboard -in" else "pbcopy";
external.copy-cmd = if pkgs.stdenv.hostPlatform.isLinux then "xclip -selection clipboard -in" else "pbcopy";
};
};
@@ -25,7 +25,7 @@ in
enable = true;
package = pkgs.firefox;
# Use appropriate default path depending on the OS
configPath = if pkgs.stdenv.isDarwin then "Library/Application Support/Firefox" else ".mozilla/firefox";
configPath = if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support/Firefox" else ".mozilla/firefox";
profiles.default = {
id = 0;
name = "default";
@@ -57,7 +57,7 @@ in
"app.update.auto" = false;
"browser.aboutConfig.showWarning" = false;
"browser.warnOnQuit" = false;
"browser.quitShortcut.disabled" = if pkgs.stdenv.isLinux then true else false;
"browser.quitShortcut.disabled" = if pkgs.stdenv.hostPlatform.isLinux then true else false;
"browser.theme.dark-private-windows" = true;
"browser.toolbars.bookmarks.visibility" = false;
"browser.startup.page" = 3; # Restore previous session
@@ -189,7 +189,7 @@ in
};
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
"${config.xsession.windowManager.i3.config.modifier}+Shift+b" = "exec ${
# Don't name the script `firefox` or it will affect grep
toString (
@@ -21,7 +21,7 @@ in
programs.ghostty = {
enable = true;
package = if pkgs.stdenv.isDarwin then pkgs.ghostty-bin else pkgs.ghostty;
package = if pkgs.stdenv.hostPlatform.isDarwin then pkgs.ghostty-bin else pkgs.ghostty;
enableFishIntegration = false; # Handled conditionally below to avoid conflicts inside Zellij/TMUX
enableBashIntegration = true;
@@ -33,8 +33,8 @@ in
macos-titlebar-style = "hidden";
window-decoration = false;
macos-non-native-fullscreen = true;
quit-after-last-window-closed = lib.mkIf pkgs.stdenv.isDarwin true;
fullscreen = if pkgs.stdenv.isDarwin then true else false;
quit-after-last-window-closed = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin true;
fullscreen = if pkgs.stdenv.hostPlatform.isDarwin then true else false;
keybind = [
"super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs)
"super+shift+]=unbind"
@@ -723,7 +723,7 @@ in
# Create a desktop option for launching Helix from a file manager
# (Requires launching the terminal and then executing Helix)
xdg.desktopEntries.helix =
lib.mkIf (pkgs.stdenv.isLinux && config.nmasur.presets.services.i3.enable)
lib.mkIf (pkgs.stdenv.hostPlatform.isLinux && config.nmasur.presets.services.i3.enable)
{
name = "Helix wrapper";
exec = ''sh -c "${lib.getExe config.nmasur.presets.services.i3.terminal} --command='hx \$1'" _ %F ''; # TODO: change to work for any terminal
@@ -18,7 +18,7 @@ in
nmasur.presets.services.i3.terminal = pkgs.kitty;
# Set the Rofi terminal for running programs
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux (lib.mkDefault "${pkgs.kitty}/bin/kitty");
programs.rofi.terminal = lib.mkIf pkgs.stdenv.hostPlatform.isLinux (lib.mkDefault "${pkgs.kitty}/bin/kitty");
# Display images in the terminal
programs.fish.interactiveShellInit = # fish
@@ -63,7 +63,7 @@ in
# Create a desktop option for launching Neovim from a file manager
# (Requires launching the terminal and then executing Neovim)
xdg.desktopEntries.nvim =
lib.mkIf (pkgs.stdenv.isLinux && config.nmasur.presets.services.i3.enable)
lib.mkIf (pkgs.stdenv.hostPlatform.isLinux && config.nmasur.presets.services.i3.enable)
{
name = "Neovim wrapper";
exec = ''${lib.getExe config.nmasur.presets.services.i3.terminal} --command="nvim %F"''; # TODO: change to generic
@@ -15,7 +15,7 @@ in
description = "Nixpkgs tools for macOS";
default =
config.nmasur.presets.programs.nixpkgs.enable
&& pkgs.stdenv.isDarwin
&& pkgs.stdenv.hostPlatform.isDarwin
&& config.nmasur.presets.programs.dotfiles.enable;
};
@@ -13,7 +13,7 @@ in
options.nmasur.presets.programs.noti.enable = lib.mkEnableOption "Noti CLI notifications";
config = lib.mkIf (cfg.enable && (pkgs.stdenv.isDarwin || config.services.dunst.enable)) {
config = lib.mkIf (cfg.enable && (pkgs.stdenv.hostPlatform.isDarwin || config.services.dunst.enable)) {
home.packages = [ pkgs.noti ];
programs.fish = {
shellAbbrs = {
@@ -42,7 +42,7 @@ in
};
cmd_duration = {
min_time = 5001;
show_notifications = if pkgs.stdenv.isLinux then false else true;
show_notifications = if pkgs.stdenv.hostPlatform.isLinux then false else true;
min_time_to_notify = 30000;
format = "[$duration]($style) ";
};
@@ -105,7 +105,7 @@ in
}
config.font = wezterm.font('${cfg.font}', { weight = 'Bold'})
config.font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"}
config.font_size = ${if pkgs.stdenv.hostPlatform.isLinux then "14.0" else "18.0"}
-- Fix color blocks instead of text
config.front_end = "WebGpu"
@@ -114,7 +114,7 @@ in
config.hide_tab_bar_if_only_one_tab = true
config.window_frame = {
font = wezterm.font('${cfg.font}', { weight = 'Bold'}),
font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"},
font_size = ${if pkgs.stdenv.hostPlatform.isLinux then "12.0" else "16.0"},
}
config.colors = {
@@ -191,7 +191,7 @@ in
-- super-t open new tab in new dir
{
key = 't',
mods = ${if pkgs.stdenv.isDarwin then "'SUPER'" else "'ALT'"},
mods = ${if pkgs.stdenv.hostPlatform.isDarwin then "'SUPER'" else "'ALT'"},
action = wezterm.action.SpawnCommandInNewTab {
cwd = wezterm.home_dir,
},
@@ -140,17 +140,17 @@ in
show_startup_tips = false;
keybinds = {
locked = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) {
locked = lib.mkIf (pkgs.stdenv.hostPlatform.isLinux && !config.programs.ghostty.enable) {
# For servers that I SSH into, use c-a-G to unlock
"bind \"Ctrl Alt G\"" = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) {
"bind \"Ctrl Alt G\"" = lib.mkIf (pkgs.stdenv.hostPlatform.isLinux && !config.programs.ghostty.enable) {
SwitchToMode = {
_args = [ "normal" ];
};
};
};
normal = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) {
normal = lib.mkIf (pkgs.stdenv.hostPlatform.isLinux && !config.programs.ghostty.enable) {
# For servers that I SSH into, use c-a-G to lock
"bind \"Ctrl Alt G\"" = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) {
"bind \"Ctrl Alt G\"" = lib.mkIf (pkgs.stdenv.hostPlatform.isLinux && !config.programs.ghostty.enable) {
SwitchToMode = {
_args = [ "locked" ];
};
@@ -180,7 +180,7 @@ in
"bind \"Alt Shift s\"" = {
Run = {
_args =
if pkgs.stdenv.isDarwin then
if pkgs.stdenv.hostPlatform.isDarwin then
[
# "env"
# "PATH=/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/bin:/bin"
@@ -254,7 +254,7 @@ in
"bind \"Alt Shift j\"" = {
Run = {
_args =
if pkgs.stdenv.isDarwin then
if pkgs.stdenv.hostPlatform.isDarwin then
[
"env"
"PATH=${config.home.homeDirectory}/.nix-profile/bin:/etc/profiles/per-user/${username}/bin:/usr/bin"
@@ -295,24 +295,24 @@ in
"bind \"Ctrl Shift Tab\"" = {
GoToPreviousTab = { };
};
"bind \"Super t\"" = lib.mkIf pkgs.stdenv.isDarwin {
"bind \"Super t\"" = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
NewTab = { };
};
"bind \"Alt t\"" = lib.mkIf pkgs.stdenv.isLinux {
"bind \"Alt t\"" = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
NewTab = { };
};
"bind \"Super k\"" = lib.mkIf pkgs.stdenv.isDarwin {
"bind \"Super k\"" = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
SwitchToMode = {
_args = [ "scroll" ];
};
};
"bind \"Super Shift e\"" = lib.mkIf pkgs.stdenv.isDarwin {
"bind \"Super Shift e\"" = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
EditScrollback = { };
SwitchToMode = {
_args = [ "locked" ];
};
};
"bind \"Alt Shift e\"" = lib.mkIf pkgs.stdenv.isLinux {
"bind \"Alt Shift e\"" = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
EditScrollback = { };
SwitchToMode = {
_args = [ "locked" ];
@@ -43,14 +43,14 @@ in
};
# Automatically check for mail and keep files synced locally
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
services.mbsync = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
enable = true;
frequency = "*:0/5";
postExec = "${lib.getExe pkgs.notmuch} new";
};
# Used to watch for new mail and trigger sync
services.imapnotify.enable = pkgs.stdenv.isLinux;
services.imapnotify.enable = pkgs.stdenv.hostPlatform.isLinux;
# Allows sending email from CLI/sendmail
programs.msmtp.enable = true;
@@ -15,7 +15,7 @@ in
home.username = config.nmasur.settings.username;
home.homeDirectory =
if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
if pkgs.stdenv.hostPlatform.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
home.packages = [
pkgs.dig # DNS lookup
@@ -40,7 +40,6 @@ in
# LLM
pkgs.gemini-cli # AI LLM Agent
pkgs.antigravity-cli # AI LLM Agent
pkgs.pi-coding-agent # AI LLM Agent
@@ -29,10 +29,10 @@ in
# This replaces program and args entirely
# script = ''
# ${process_urls}/bin/process-urls /Users/${username}/Downloads/Sidebery/
# GEMINI_API_KEY=$(cat /Users/${username}/.config/gemini/.gemini_api_key) ${pkgs.gemini-cli}/bin/gemini --allowed-tools all --yolo --include-directories /Users/${username}/Downloads/Sidebery/ --include-directories /Users/${username}/dev/personal/notes/ "${prompt}"
# GEMINI_API_KEY=$(cat /Users/${username}/.config/gemini/.gemini_api_key) ${pkgs.antigravity-cli}/bin/agy --allowed-tools all --yolo --include-directories /Users/${username}/Downloads/Sidebery/ --include-directories /Users/${username}/dev/personal/notes/ "${prompt}"
# '';
script = ''
GEMINI_API_KEY=$(cat /Users/${username}/.config/gemini/.gemini_api_key) ${pkgs.gemini-cli}/bin/gemini --allowed-tools all --yolo --include-directories "/Users/${username}/Downloads/firefox-history/,/Users/${username}/dev/personal/notes/" "${prompt} | tee -a /Users/${username}/dev/personal/gemini-archive/daily-summary-logs/$(date +"%Y-%m-%d").log"
GEMINI_API_KEY=$(cat /Users/${username}/.config/gemini/.gemini_api_key) ${pkgs.antigravity-cli}/bin/agy --allowed-tools all --yolo --include-directories "/Users/${username}/Downloads/firefox-history/,/Users/${username}/dev/personal/notes/" "${prompt} | tee -a /Users/${username}/dev/personal/gemini-archive/daily-summary-logs/$(date +"%Y-%m-%d").log"
'';
path = [