diff --git a/flake.nix b/flake.nix index 1248308..6860495 100644 --- a/flake.nix +++ b/flake.nix @@ -1,133 +1,134 @@ { - description = "Example Darwin system flake"; + description = "Example 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 - ]; - - homebrew = { - enable = true; - casks = [ - "firefox" - "arc" - "cyberduck" - "discord" - "gpg-suite-no-mail" - "iina" - "jetbrains-toolbox" - "keka" - "maccy" - "nordvpn" - "notion" - "plex" - "swish" - "termius" - "tower" - "warp" - ]; - brews = [ - "wget" - "act" - "bear" - "cmake" - "deno" - "firebase-cli" - "git" - "git-flow" - "git-lfs" - "gnupg" - "gtk+3" - "llvm@18" - "nvm" - "pinentry-mac" - "pinentry" - "pnpm" - "sdl2" - "sdl2_image" - "sdl2_ttf" - "terraform" - "tmux" - "tree" - "wget" - "zsh" - "yubikey-agent" - ]; - taps = [ - "hashicorp/tap" - ]; - onActivation.cleanup = "uninstall"; - onActivation.autoUpdate = true; - onActivation.upgrade = 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"; + 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"; }; - in - { + + 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 + ]; + + # 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" + "warp" + ]; + brews = [ + "wget" + "act" + "bear" + "cmake" + "deno" + "firebase-cli" + "git" + "git-flow" + "git-lfs" + "gnupg" + "gtk+3" + "llvm@18" + "nvm" + "pinentry-mac" + "pinentry" + "pnpm" + "sdl2" + "sdl2_image" + "sdl2_ttf" + "terraform" + "tmux" + "tree" + "wget" + "zsh" + "yubikey-agent" + ]; + taps = [ + "hashicorp/tap" + ]; + onActivation.cleanup = "uninstall"; + onActivation.autoUpdate = true; + onActivation.upgrade = 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; + 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; + # Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2 + enableRosetta = true; - # User owning the Homebrew prefix - user = "louisgallet"; + # User owning the Homebrew prefix + user = "louisgallet"; - # Automatically migrate existing Homebrew installations - autoMigrate = true; - }; - } - ]; + # Automatically migrate existing Homebrew installations + autoMigrate = true; + }; + } + ]; + }; + + # Expose the package set, including overlays, for convenience. + darwinPackages = self.darwinConfigurations."MBP-Louis".pkgs; }; - - # Expose the package set, including overlays, for convenience. - darwinPackages = self.darwinConfigurations."MBP-Louis".pkgs; - }; }