diff options
| author | Joe Mou <dev@mou.fo> | 2026-03-17 19:45:31 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-03-17 19:46:16 -0400 |
| commit | cdaa324b510f5ddbb11c7d19b20e2750d1e5cff0 (patch) | |
| tree | f78f56a2bbe21ac1a512a01e42c9bbdf88c8e9a4 /hostnix | |
| parent | 1cebf605994cf506f933e5ad33a863061eb2a1a8 (diff) | |
Initial nix-darwin flake for mojo
Diffstat (limited to 'hostnix')
| -rw-r--r-- | hostnix/mojo/Makefile | 5 | ||||
| -rw-r--r-- | hostnix/mojo/flake.lock | 66 | ||||
| -rw-r--r-- | hostnix/mojo/flake.nix | 46 |
3 files changed, 117 insertions, 0 deletions
diff --git a/hostnix/mojo/Makefile b/hostnix/mojo/Makefile new file mode 100644 index 0000000..ebc7e6f --- /dev/null +++ b/hostnix/mojo/Makefile @@ -0,0 +1,5 @@ +rebuild: + sudo darwin-rebuild switch --flake path:. + +update: + nix flake update --flake path:. diff --git a/hostnix/mojo/flake.lock b/hostnix/mojo/flake.lock new file mode 100644 index 0000000..ea7d40c --- /dev/null +++ b/hostnix/mojo/flake.lock @@ -0,0 +1,66 @@ +{ + "nodes": { + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772129556, + "narHash": "sha256-Utk0zd8STPsUJPyjabhzPc5BpPodLTXrwkpXBHYnpeg=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "ebec37af18215214173c98cf6356d0aca24a2585", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "nix-darwin-25.11", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773679630, + "narHash": "sha256-w1T/F8hUiEayrRda277EpXW8LxrSkeer0/4HaCGsEE4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5560a08b531df7bca64849b0c02834dd897878db", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-25.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1773628058, + "narHash": "sha256-hpXH0z3K9xv0fHaje136KY872VT2T5uwxtezlAskQgY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} 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 ]; + }; + }; +} |
