feat: initial macos setup
This commit is contained in:
+23
-13
@@ -1,24 +1,34 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, lib, isDarwin, ... }:
|
||||
|
||||
let
|
||||
# Modules that only make sense on Linux, either because they use systemd,
|
||||
# KDE/Plasma, or a package that nixpkgs only builds for Linux. On macOS the
|
||||
# equivalents are installed as Homebrew casks (see modules/darwin.nix).
|
||||
linuxOnly = lib.optionals (!isDarwin) [
|
||||
../modules/plasma.nix
|
||||
../modules/dropbox.nix
|
||||
../modules/globalprotect.nix
|
||||
../modules/gimp.nix
|
||||
../modules/libreoffice.nix
|
||||
../modules/masterpdfeditor.nix
|
||||
../modules/pymol.nix
|
||||
../modules/zoom.nix
|
||||
];
|
||||
in
|
||||
{
|
||||
home.username = "alex";
|
||||
home.homeDirectory = "/home/alex";
|
||||
home.homeDirectory = if isDarwin then "/Users/alex" else "/home/alex";
|
||||
home.stateVersion = "25.11";
|
||||
home.sessionPath = [ "$HOME/.local/bin" ];
|
||||
|
||||
imports = [
|
||||
../modules/datalad.nix
|
||||
../modules/docker.nix
|
||||
../modules/dropbox.nix
|
||||
../modules/fonts.nix
|
||||
../modules/ghostty.nix
|
||||
../modules/gimp.nix
|
||||
../modules/globalprotect.nix
|
||||
../modules/helix.nix
|
||||
../modules/hyperfine.nix
|
||||
../modules/libreoffice.nix
|
||||
../modules/masterpdfeditor.nix
|
||||
../modules/pixi.nix
|
||||
../modules/plasma.nix
|
||||
../modules/pymol.nix
|
||||
../modules/python.nix
|
||||
../modules/rust.nix
|
||||
../modules/ssh.nix
|
||||
@@ -28,21 +38,21 @@
|
||||
../modules/yazi.nix
|
||||
../modules/zellij.nix
|
||||
../modules/zig.nix
|
||||
../modules/zoom.nix
|
||||
../modules/zsh.nix
|
||||
./git.nix
|
||||
./gh.nix
|
||||
];
|
||||
] ++ linuxOnly;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
atool
|
||||
httpie
|
||||
just
|
||||
spotify
|
||||
brave
|
||||
git-lfs
|
||||
typst
|
||||
unzip
|
||||
glow
|
||||
] ++ lib.optionals (!isDarwin) [
|
||||
spotify
|
||||
brave
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{ pkgs, lib, isDarwin, ... }:
|
||||
let
|
||||
baseKeybinds = [
|
||||
"ctrl+t=new_tab"
|
||||
@@ -16,7 +16,10 @@ in
|
||||
{
|
||||
programs.ghostty = {
|
||||
enable = true;
|
||||
|
||||
# nixpkgs `ghostty` is the Linux/GTK build (Linux-only meta.platforms).
|
||||
# On macOS use `ghostty-bin`, the repackaged official .dmg.
|
||||
package = if isDarwin then pkgs.ghostty-bin else pkgs.ghostty;
|
||||
|
||||
settings = {
|
||||
# Font Settings
|
||||
"font-family" = "Roboto Mono";
|
||||
@@ -93,8 +96,8 @@ in
|
||||
|
||||
# Keybindings (Tabs & Splits)
|
||||
"keybind" = baseKeybinds
|
||||
++ lib.optionals pkgs.stdenv.isDarwin [ "super+d=unbind" ];
|
||||
} // lib.optionalAttrs pkgs.stdenv.isDarwin {
|
||||
++ lib.optionals isDarwin [ "super+d=unbind" ];
|
||||
} // lib.optionalAttrs isDarwin {
|
||||
"macos-titlebar-style" = "transparent";
|
||||
"macos-icon" = "official";
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, lib, isDarwin, ... }: {
|
||||
programs.vscodium = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
@@ -18,12 +18,16 @@
|
||||
rust-lang.rust-analyzer
|
||||
timonwong.shellcheck
|
||||
unifiedjs.vscode-mdx
|
||||
yzane.markdown-pdf
|
||||
]) ++ pkgs.nix4vscode.forOpenVsx [
|
||||
"akamud.vscode-theme-onedark"
|
||||
"astral-sh.ty"
|
||||
"modular-mojotools.vscode-mojo"
|
||||
];
|
||||
] ++ lib.optionals (!isDarwin) (with pkgs.vscode-extensions; [
|
||||
# markdown-pdf pins ungoogled-chromium (Linux-only) as its PDF
|
||||
# renderer. On macOS, install it from the marketplace by hand and set
|
||||
# markdown-pdf.executablePath to Chrome/Brave, or render via typst.
|
||||
yzane.markdown-pdf
|
||||
]);
|
||||
|
||||
userSettings = {
|
||||
"editor.fontFamily" = "'JetBrains Mono', monospace";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
programs.zed-editor = {
|
||||
enable = true;
|
||||
package = pkgs.zed-editor-fhs;
|
||||
package = pkgs.zed-editor;
|
||||
mutableUserSettings = true;
|
||||
|
||||
userSettings = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, lib, isDarwin, ... }:
|
||||
|
||||
{
|
||||
programs.zsh = {
|
||||
@@ -12,7 +12,7 @@
|
||||
la = "ls -A";
|
||||
l = "ls -CF";
|
||||
tp = "tree -I '__init__*' -I '__pycache__'";
|
||||
clear = "/run/current-system/sw/bin/clear";
|
||||
clear = "${pkgs.ncurses}/bin/clear";
|
||||
zide = "zellij --layout ide";
|
||||
};
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
'';
|
||||
};
|
||||
home.sessionVariables = {
|
||||
TERMINFO_DIRS = "${pkgs.ghostty}/share/terminfo:${pkgs.ncurses}/share/terminfo";
|
||||
# ghostty (GTK) ships terminfo under $out/share on Linux. The macOS
|
||||
# ghostty-bin bundles its own, so only add ncurses there.
|
||||
TERMINFO_DIRS = lib.concatStringsSep ":" (
|
||||
lib.optional (!isDarwin) "${pkgs.ghostty}/share/terminfo"
|
||||
++ [ "${pkgs.ncurses}/share/terminfo" ]
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user