diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..6d5f971 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,23 @@ +self: { pkgs, ... }: { + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = + [ pkgs.vim + ]; + + # Necessary for using flakes on this system. + nix.settings.experimental-features = "nix-command flakes"; + + # Enable alternative shell support in nix-darwin. + # 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 = 6; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; +} diff --git a/flake.lock b/flake.lock index 1111b31..608365e 100644 --- a/flake.lock +++ b/flake.lock @@ -300,6 +300,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1786845137, + "narHash": "sha256-oQFip+v0luP8NIxJzmiW4Wu8bILsbFWom5l0zonl8hQ=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "4cff07de74b50e64bdd68cd4e722ab5b6b35ee48", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-flatpak": { "locked": { "lastModified": 1767983141, @@ -548,6 +569,7 @@ "home-manager": "home-manager", "lanzaboote": "lanzaboote", "nix-cachyos-kernel": "nix-cachyos-kernel", + "nix-darwin": "nix-darwin", "nix-flatpak": "nix-flatpak", "nix-skills": "nix-skills", "nix-sweep": "nix-sweep", diff --git a/flake.nix b/flake.nix index ecfe243..69f8736 100644 --- a/flake.nix +++ b/flake.nix @@ -58,9 +58,13 @@ url = "github:nix-community/bun2nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + nix-darwin = { + url = "github:nix-darwin/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixos-hardware, ... }@inputs: + outputs = { self, nixos-hardware, nix-darwin, ... }@inputs: { nixosConfigurations = let @@ -71,5 +75,8 @@ acer = mkNixosSystem {} hosts/acer.nix; gaming-pc = mkNixosSystem {} hosts/gaming-pc.nix; }; + darwinConfigurations."MacBook-Pro-Macbook" = nix-darwin.lib.darwinSystem { + modules = [ ((import ./configuration.nix) self) ]; + }; }; }