nix-config/flake.nix
2025-02-13 13:23:34 -05:00

201 lines
7.0 KiB
Nix

{
description = "Louis Darwin system flake";
inputs = {
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
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, nix-homebrew, ... }:
let
configuration = { pkgs, ... }: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[
pkgs.termdown
pkgs.fastfetch
pkgs.neovim
pkgs.deno
pkgs.pnpm
pkgs.terraform
pkgs.termdown
pkgs.gh-copilot
pkgs.gh
pkgs.zathura
pkgs.texliveMedium
pkgs.texlab
pkgs.rcm
pkgs.fnm
pkgs.universal-ctags
pkgs.ripgrep
pkgs.pyenv
pkgs.lima
pkgs.rustup
pkgs.ngrok
pkgs.marp-cli
];
# HomeBrew configuration
homebrew = {
enable = true;
casks = [
"hazeover"
"arc"
"cyberduck"
"discord"
#"gpg-suite-no-mail"
"iina"
"jetbrains-toolbox"
"keka"
"maccy"
"nordvpn"
"notion"
"plex"
"swish"
"termius"
"tower"
"mattermost"
"aldente"
"logi-options+"
"adobe-creative-cloud"
"qbittorrent"
"zoom"
"tailscale"
"iterm2"
"zed"
"whisky"
"visual-studio-code"
"vmware-fusion"
"pycharm"
"cleanshot"
"bartender"
"eloston-chromium"
"chromedriver"
"epic-games"
"lookaway"
];
brews = [
"wget"
"bear"
"cmake"
"firebase-cli"
"git"
"git-flow"
"git-lfs"
"gnupg"
"llvm@18"
"gtk+3"
"nvm"
"pinentry-mac"
"sdl2"
"sdl2_image"
"sdl2_ttf"
"tmux"
"tree"
"wget"
"zsh"
"yubikey-agent"
"pkg-config"
"serve"
];
taps = [
"hashicorp/tap"
"eranif/codelite"
"macos-fuse-t/homebrew-cask"
];
onActivation.cleanup = "uninstall";
onActivation.autoUpdate = true;
onActivation.upgrade = true;
};
# System configuration
security.pam.enableSudoTouchIdAuth = true;
system.defaults = {
dock = {
autohide = true;
orientation = "left";
show-recents = false;
magnification = false;
autohide-time-modifier = 0.0;
persistent-apps = [
"/System/Applications/Launchpad.app"
"/System/Applications/Messages.app"
"/Applications/Arc.app"
"/System/Applications/Mail.app"
"/Applications/BusyCal.app"
"/Applications/Things.app"
"/Applications/Perplexity.app"
"/System/Applications/Music.app"
"/Applications/Discord.app"
"/Applications/Zed.app"
"/Applications/Visual\ Studio\ Code.app"
"/Applications/Warp.app"
"/System/Applications/System\ Settings.app"
"/Applications/Notion.app"
"/Applications/Privileges.app"
];
};
finder.FXPreferredViewStyle = "Nlsv";
SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true;
};
# Allow broken packages
nixpkgs.config.allowBroken = true;
# allow unfree packages
nixpkgs.config.allowUnfree = true;
# 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;
# 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 = 5;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#simple
darwinConfigurations."MBP-Louis" = nix-darwin.lib.darwinSystem {
modules = [
configuration
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = true;
# User owning the Homebrew prefix
user = "louisgallet";
# Automatically migrate existing Homebrew installations
autoMigrate = true;
};
}
];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."MBP-Louis".pkgs;
};
}