139 lines
4.6 KiB
Nix
139 lines
4.6 KiB
Nix
{
|
|
description = "Nix-Darwin Configuration Flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = inputs@{ self, nix-darwin, nixpkgs }:
|
|
let
|
|
configuration = { pkgs, ... }: {
|
|
networking.computerName = "cspark-macos-desktop";
|
|
networking.hostName = "cspark-macos-desktop";
|
|
networking.localHostName = "cspark-macos-desktop";
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
# Nix packages.
|
|
environment.systemPackages = with pkgs; [
|
|
git
|
|
unrar
|
|
pass
|
|
neofetch
|
|
neovim
|
|
yt-dlp
|
|
qbittorrent
|
|
emacs
|
|
discord
|
|
];
|
|
|
|
# Homebrew configuration and packages.
|
|
homebrew.enable = true;
|
|
# Homebrew formulae
|
|
homebrew.brews = [
|
|
];
|
|
# Homebrew casks
|
|
homebrew.casks = [
|
|
"steam"
|
|
"librewolf"
|
|
# "eloston-chromium" # Ungoogled Chromium
|
|
"chromium"
|
|
# "blackhole-2ch" # Virtual Audio driver that I'm using alongside the builtin Mac audio routing (Multi-Output/Aggregate
|
|
];
|
|
|
|
services.yabai = {
|
|
enable = true;
|
|
config = {
|
|
external_bar = "off:40:0";
|
|
menubar_opacity = 1.0;
|
|
mouse_follows_focus = "off";
|
|
focus_follows_mouse = "off";
|
|
display_arrangement_order = "default";
|
|
window_origin_display = "default";
|
|
window_placement = "second_child";
|
|
window_zoom_persist = "on";
|
|
window_shadow = "on";
|
|
window_animation_duration = 0.0;
|
|
window_animation_easing = "ease_out_circ";
|
|
window_opacity_duration = 0.0;
|
|
active_window_opacity = 1.0;
|
|
normal_window_opacity = 0.90;
|
|
window_opacity = "off";
|
|
insert_feedback_color = "0xffd75f5f";
|
|
split_ratio = 0.50;
|
|
split_type = "auto";
|
|
auto_balance = "off";
|
|
top_padding = 12;
|
|
bottom_padding = 12;
|
|
left_padding = 12;
|
|
right_padding = 12;
|
|
window_gap = 06;
|
|
layout = "bsp";
|
|
mouse_modifier = "fn";
|
|
mouse_action1 = "move";
|
|
mouse_action2 = "resize";
|
|
mouse_drop_action = "swap";
|
|
};
|
|
};
|
|
services.skhd = {
|
|
enable = true;
|
|
skhdConfig = ''
|
|
cmd - return : open -a Terminal "`pwd`"
|
|
'';
|
|
};
|
|
|
|
|
|
# Auto upgrade nix package and the daemon service.
|
|
services.nix-daemon.enable = true;
|
|
# nix.package = pkgs.nix;
|
|
|
|
# Necessary for using flakes on this system.
|
|
nix.settings.experimental-features = "nix-command flakes";
|
|
|
|
# Create /etc/zshrc that loads the nix-darwin environment.
|
|
# programs.zsh.enable = true; # default shell on catalina
|
|
# programs.fish.enable = true;
|
|
programs.bash = {
|
|
enable = true;
|
|
enableCompletion = true;
|
|
interactiveShellInit = ''
|
|
export PS1="\[\e[92;40m\]\h\[\e[m\]:\[\e[93m\]\W\[\e[m\] \\$ "
|
|
cd ~
|
|
neofetch
|
|
'';
|
|
};
|
|
environment.shellAliases = {
|
|
edit = "emacs -nw";
|
|
nix-darwin-rebuild-system-flake = "nix run nix-darwin -- switch --flake ~/.config/nix-darwin#desktop";
|
|
};
|
|
|
|
# Set Git commit hash for darwin-version.
|
|
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
|
|
# Used for backwards compatibility, please read the changelog before changing.
|
|
# $ darwin-rebuild changelog
|
|
system.stateVersion = 4;
|
|
|
|
# The platform the configuration will be used on.
|
|
nixpkgs.hostPlatform = "x86_64-darwin";
|
|
};
|
|
in
|
|
{
|
|
# Build darwin flake using:
|
|
# $ darwin-rebuild build --flake .#Curts-Mac-Pro
|
|
darwinConfigurations = {
|
|
desktop = nix-darwin.lib.darwinSystem {
|
|
specialArgs = {inherit inputs;};
|
|
modules = [
|
|
configuration
|
|
];
|
|
};
|
|
};
|
|
|
|
# Expose the package set, including overlays, for convenience.
|
|
darwinPackages = self.darwinConfigurations.desktop-macos.pkgs;
|
|
};
|
|
}
|