{ 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 ]; # HomeBrew configuration homebrew = { enable = true; casks = [ "firefox" "arc" "cyberduck" "discord" "gpg-suite-no-mail" "iina" "jetbrains-toolbox" "keka" "maccy" "nordvpn" "notion" "plex" "swish" "termius" "tower" "mattermost" "aldente" ]; brews = [ "wget" "bear" "cmake" "firebase-cli" "git" "git-flow" "git-lfs" "gnupg" "llvm@18" "gtk+3" "nvm" "pinentry-mac" "pinentry" "sdl2" "sdl2_image" "sdl2_ttf" "tmux" "tree" "wget" "zsh" "yubikey-agent" "pkg-config" ]; taps = [ "hashicorp/tap" ]; 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; autohide-time-modifier = 0.0; }; finder.FXPreferredViewStyle = "Nlsv"; }; # 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; }; }