From 1e7f0558db89e2f2fd523d1d1161faedfb8d581c Mon Sep 17 00:00:00 2001 From: digitalsoba Date: Tue, 5 May 2026 00:02:55 -0700 Subject: [PATCH] nix darwin flake --- flake.nix | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..53b309c --- /dev/null +++ b/flake.nix @@ -0,0 +1,73 @@ +{ + description = "Soba MacOS Nix Flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:nix-darwin/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = + inputs@{ + self, + nix-darwin, + nixpkgs, + }: + let + configuration = + { pkgs, ... }: + { + environment.systemPackages = [ + pkgs.argocd + pkgs.fastfetch + pkgs.htop + pkgs.k9s + pkgs.kubectl + pkgs.kubectx + pkgs.mise + pkgs.neovim + pkgs.nixd + pkgs.nil + pkgs.ollama + pkgs.vim + ]; + + homebrew = { + enable = true; + onActivation.cleanup = "zap"; + onActivation.autoUpdate = true; + onActivation.upgrade = true; + casks = [ + "alfred" + "firefox" + "ghostty" + "orbstack" + "rectangle" + "zed" + ]; + }; + + nix.settings.experimental-features = "nix-command flakes"; + nix.gc.automatic = true; + nix.optimise.automatic = true; + + system.configurationRevision = self.rev or self.dirtyRev or null; + security.pam.services.sudo_local.touchIdAuth = true; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 6; + + system.primaryUser = "soba"; + + nixpkgs.hostPlatform = "aarch64-darwin"; + }; + in + { + # Build darwin flake using: + # $ darwin-rebuild build --flake .#neptune + darwinConfigurations."neptune" = nix-darwin.lib.darwinSystem { + modules = [ configuration ]; + }; + }; +}