From 6b0a342cdd82ac8439929131c48a18e9822c9f94 Mon Sep 17 00:00:00 2001 From: lsoriano-mcm Date: Fri, 6 Jun 2025 06:50:54 -0500 Subject: [PATCH] added DARWIN --- flake.nix | 18 +++++++++++++++++- nixos/macos/darwin.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 nixos/macos/darwin.nix diff --git a/flake.nix b/flake.nix index 600b273..4ba81e7 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,8 @@ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; # `follows` ensure it follows nixpkgs versiona. Avoids breaking updates. + darwin.url = "github:lnl7/nix-darwin"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; ags.url = "github:aylur/ags"; ags.inputs.nixpkgs.follows = "nixpkgs"; @@ -25,11 +27,16 @@ outputs = { nixpkgs, home-manager, + darwin, + ags, + hyprland, + unlisted-fonts, + nix-neovim, ... } @ inputs: let info = import ./info.nix; lib = nixpkgs.lib; - system = "x86_64-linux"; + system = pkgs: pkgs.stdenv.hostPlatform.system; # pkgs = nixpkgs.legacyPackages.${system}; # alternative, without overlays. Unused. args = { @@ -46,6 +53,15 @@ ]; }; }; + darwinConfigurations = { + hostname = darwin.lib.darwinSystem { + system = "aarch64-darwin"; + modules = [ + ./nixos/macos/darwin.nix + # home-manager.darwinModules.home-manager + ]; + }; + }; homeConfigurations = { desktop = home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs { diff --git a/nixos/macos/darwin.nix b/nixos/macos/darwin.nix new file mode 100644 index 0000000..9ac8784 --- /dev/null +++ b/nixos/macos/darwin.nix @@ -0,0 +1,29 @@ +{pkgs, ...}: { + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = [pkgs.vim]; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + services.karabiner-elements.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; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; + + users.users.davish = { + name = "davish"; + home = "/Users/davish"; + }; +}