{ 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.gh-copilot pkgs.gh pkgs.texlab pkgs.texliveFull pkgs.rcm pkgs.fnm pkgs.universal-ctags pkgs.ripgrep pkgs.pyenv pkgs.rustup pkgs.ngrok pkgs.marp-cli pkgs.discord pkgs.yarn pkgs.typescript pkgs.firefox ]; # HomeBrew configuration homebrew = { enable = true; casks = [ "cyberduck" #"gpg-suite-no-mail" "iina" "jetbrains-toolbox" "keka" "maccy" "nordvpn" "notion" "swish" "termius" "mattermost" "aldente" "logi-options+" "adobe-creative-cloud" "qbittorrent" "zoom" "tailscale" "zed" "whisky" "visual-studio-code" "vmware-fusion" "pycharm" "cleanshot" "bartender" "chromedriver" "epic-games" "alt-tab" ]; brews = [ "wget" "bear" "cmake" "firebase-cli" "git" "git-flow" "git-lfs" "gnupg" "llvm@18" "gtk+3" "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.services.sudo_local.touchIdAuth = true; system.defaults = { dock = { autohide = true; orientation = "bottom"; show-recents = false; magnification = false; autohide-time-modifier = 0.0; persistent-apps = [ "/System/Applications/Launchpad.app" "/System/Applications/Messages.app" "/Applications/Nix Apps/Firefox.app" "/System/Applications/Mail.app" "/Applications/BusyCal.app" "/Applications/Things.app" "/System/Applications/Music.app" "/Applications/Nix Apps/Discord.app" "/Applications/Zed.app" "/Applications/Visual\ Studio\ Code.app" "/Applications/Warp.app" "/System/Applications/System\ Settings.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; system.primaryUser = "louisgallet"; # 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; }; }