Skip to content

Instantly share code, notes, and snippets.

@r281GQ
Last active March 19, 2023 20:25
Show Gist options
  • Save r281GQ/1cb88e81f792cfb0add085a79c378331 to your computer and use it in GitHub Desktop.
Save r281GQ/1cb88e81f792cfb0add085a79c378331 to your computer and use it in GitHub Desktop.
wezterm nixos
{ config, pkgs, ... }:
let
p = import ./test.nix;
pkgsM1 = import <nixpkgs> { overlays = []; };
inherit (import <nixpkgs> {}) fetchFromGitHub lib;
inherit (pkgsM1) ffmpeg imagemagick tmux zsh starship gnupg nodejs-14_x nodejs-16_x postgresql_13 rustup;
wezterm = (pkgsM1.wezterm.overrideAttrs(old: rec {
name = "wezterm";
version = "20220408-101518-b908e2dd";
buildInputs = (with pkgsM1; [
openssl
fontconfig
zlib
libiconv
]) ++ (with pkgsM1.darwin.apple_sdk_11_0.frameworks; [
Cocoa
CoreGraphics
Foundation
UserNotifications
]);
postPatch = ''
echo ${version} > .tag
'';
src = fetchFromGitHub {
owner = "wez";
repo = "wezterm";
rev = "b908e2dd8cd27c613c8d76e9e6abc5245e500d7d";
sha256 = "0rnc3f6s90q02inllaswvf4ki1ysfnnwaj2lbk83x0kax07siswj";
fetchSubmodules = true;
};
dontCargoCheck = true;
cargoDeps = old.cargoDeps.overrideAttrs (lib.const {
inherit src;
name = "${name}-vendor.tar.gz";
outputHash = "02f37b79j0dgf1b98mxkqwg6nm8a207xlianhkplw9pjmngn6bga";
});
cargoSha256 = null;
OPENSSL_NO_VENDOR = 1;
preBuild = ''
export OPENSSL_DIR=${pkgsM1.lib.getDev pkgsM1.openssl}
export OPENSSL_LIB_DIR=${pkgsM1.openssl.out}/lib
export OPENSSL_INCLUDE_DIR=${pkgsM1.openssl.dev}/include
./get-deps
'';
shellHook = ''
export PS1="[$name] \[$txtgrn\]\u@\h\[$txtwht\]:\[$bldpur\]\w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty \[$bldylw\]\$aws_env\[$txtrst\]\$ "
export NIX_LDFLAGS="-F${pkgsM1.darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS";
'';
}));
in
{
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
nixpkgs.config.allowBroken = true;
environment.systemPackages =
[ pkgs.curl
rustup
pkgs.neovim
pkgs.ripgrep
pkgs.vim
pkgs.bottom
pkgs.lazygit
pkgs.tmux
pkgs.rnix-lsp
pkgs.ansible
pkgs.yabai
pkgs.skhd
wezterm
];
# Use a custom configuration.nix location.
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
# environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# nix.package = pkgs.nix;
# Create /etc/bashrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina
# programs.bash.enable = true;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
system = {
keyboard = {
enableKeyMapping = true;
remapCapsLockToControl = true;
};
defaults = {
finder.CreateDesktop = true;
screencapture.location = "~/Screenshots";
loginwindow = {
GuestEnabled = false;
DisableConsoleAccess = true;
};
dock = {
autohide = true;
tilesize = 46;
};
NSGlobalDomain = {
ApplePressAndHoldEnabled = true;
AppleShowAllExtensions = true;
InitialKeyRepeat = 10;
KeyRepeat = 2;
"com.apple.swipescrolldirection" = false;
};
};
};
imports = [<home-manager/nix-darwin>];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment