Last active
April 27, 2025 00:01
-
-
Save aduh95/affe5ba977acaaa8f480bc7d98161ec9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
{ | |
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ | |
"mongodb-ce" | |
]; | |
# This value determines the Home Manager release that your | |
# configuration is compatible with. This helps avoid breakage | |
# when a new Home Manager release introduces backwards | |
# incompatible changes. | |
# | |
# You can update Home Manager without changing this value. See | |
# the Home Manager release notes for a list of state version | |
# changes in each release. | |
home.stateVersion = "24.11"; | |
home.packages = [ | |
pkgs.curl | |
pkgs.deno | |
pkgs.jq # JSON stream parser | |
pkgs.mpv-unwrapped # VLC like | |
pkgs.nodejs-slim | |
pkgs.ollama # LLM stuff | |
pkgs.transmission_4 # Torrenting | |
# Fonts | |
pkgs.fira-code | |
] ++ pkgs.lib.optionals (! pkgs.stdenv.buildPlatform.isDarwin) [ | |
# Packages that are included in xcode-select | |
pkgs.git | |
pkgs.nvi | |
pkgs.python3 | |
] ++ [ | |
(pkgs.writeShellScriptBin "npx" "exec corepack npx \"$@\"") | |
]; | |
# Let Home Manager install and manage itself. | |
programs.home-manager.enable = true; | |
programs.direnv = { | |
enable = true; | |
enableZshIntegration = true; | |
nix-direnv.enable = true; | |
}; | |
programs.gh = { | |
enable = true; | |
settings = { | |
# Workaround for https://github.com/nix-community/home-manager/issues/4744 | |
version = 1; | |
editor = "vi"; | |
aliases = { | |
co = "pr checkout"; | |
pv = "pr view"; | |
}; | |
}; | |
}; | |
programs.gpg = { | |
enable = true; | |
settings = { | |
auto-key-retrieve = true; | |
no-emit-version = true; | |
}; | |
}; | |
programs.vscode = { | |
enable = true; | |
package = pkgs.vscodium; | |
extensions = with pkgs.vscode-extensions; [ | |
streetsidesoftware.code-spell-checker | |
# streetsidesoftware.code-spell-checker-french | |
github.vscode-github-actions | |
bbenoist.nix | |
teabyii.ayu | |
tomoki1207.pdf | |
vscodevim.vim | |
waderyan.gitblame | |
]; | |
userSettings = { | |
"cSpell.language" = "en,fr"; | |
"diffEditor.ignoreTrimWhitespace" = false; | |
"editor.fontFamily" = "'Fira Code'"; | |
"editor.fontLigatures" = true; | |
"editor.fontSize" = 20; | |
"editor.inlineSuggest.enabled" = true; | |
"editor.lineNumbers" = "on"; | |
"editor.mouseWheelZoom" = false; | |
"editor.renderLineHighlight" = "gutter"; | |
"files.autoSave" = "onFocusChange"; | |
"git.allowNoVerifyCommit" = true; | |
"git.branchProtectionPrompt" = "alwaysCommit"; | |
"git.enableStatusBarSync" = false; | |
"git.inputValidation" = true; | |
"git.pullTags" = false; | |
"git.terminalAuthentication" = false; | |
"gitblame.delayBlame" = 500; | |
"gitblame.inlineMessageEnabled" = true; | |
"terminal.integrated.fontSize" = 16; | |
"typescript.updateImportsOnFileMove.enabled" = "never"; | |
"window.autoDetectColorScheme" = true; | |
"window.zoomLevel" = -2; | |
"workbench.colorTheme" = "Ayu Dark"; | |
"workbench.preferredDarkColorTheme" = "Ayu Dark"; | |
}; | |
}; | |
programs.zsh = { | |
enable = true; | |
autosuggestion = { | |
enable = true; | |
}; | |
defaultKeymap = "viins"; | |
oh-my-zsh = { | |
enable = true; | |
theme = "robbyrussell"; | |
}; | |
syntaxHighlighting = { | |
enable = true; | |
}; | |
sessionVariables = {}; | |
shellAliases = { | |
# Frequent typos | |
gti = "git"; | |
igt = "git"; | |
flush-dns = if pkgs.stdenv.buildPlatform.isDarwin then "sudo killall -HUP mDNSResponder" else "sudo resolvectl flush-caches"; | |
# Corepack aliases (for Node.js package manager versioning) | |
pnpm = "corepack pnpm"; | |
yarn = "corepack yarn"; | |
# Update all global dependencies | |
maj = "nix-channel --update && home-manager switch"; | |
remote-node-push-cmd = "awk -F: '{ print \"gitpushto [email protected]:\" $1 \"/node.git \" $2 \" -f\" }' <<<"; | |
}; | |
initExtra = '' | |
gitpushto() { | |
git push "$1" "HEAD:refs/heads/$2" $@ | |
} | |
npm() { | |
command npm "$@" || { | |
EXIT_CODE=$? | |
[ "$EXIT_CODE" = 127 ] && corepack npm "$@" || return "$EXIT_CODE" | |
} | |
} | |
bindkey -v | |
''; | |
}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment