From cdaa324b510f5ddbb11c7d19b20e2750d1e5cff0 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Tue, 17 Mar 2026 19:45:31 -0400 Subject: Initial nix-darwin flake for mojo --- hostnix/mojo/flake.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 hostnix/mojo/flake.nix (limited to 'hostnix/mojo/flake.nix') diff --git a/hostnix/mojo/flake.nix b/hostnix/mojo/flake.nix new file mode 100644 index 0000000..913d702 --- /dev/null +++ b/hostnix/mojo/flake.nix @@ -0,0 +1,46 @@ +{ + description = "nix-darwin system flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-25.11-darwin"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.11"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs@{ self, nix-darwin, nixpkgs, nixpkgs-unstable }: + let + configuration = { pkgs, ... }: { + environment.systemPackages = let + # TODO is there a better way to do this? + pkgsUnstable = import nixpkgs-unstable { + localSystem = pkgs.stdenv.system; + config.allowUnfree = true; + }; + in + [ + pkgsUnstable.claude-code + pkgsUnstable.jujutsu + ]; + + nix.settings.experimental-features = "nix-command flakes"; + + # 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 = 6; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; + + nixpkgs.config.allowUnfree = true; + }; + in + { + darwinConfigurations.mojo = nix-darwin.lib.darwinSystem { + modules = [ configuration ]; + }; + }; +} -- cgit v1.3.1