{"id":15171765,"url":"https://github.com/amsynist/zero-darwin","last_synced_at":"2025-04-13T13:34:43.580Z","repository":{"id":243986678,"uuid":"813973757","full_name":"amsynist/zero-darwin","owner":"amsynist","description":"Personal  Nix Configuration for Mac OS :) ","archived":false,"fork":false,"pushed_at":"2024-06-26T04:57:56.000Z","size":191,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T04:41:22.234Z","etag":null,"topics":["home-manager","jankyborders","nix","nix-configs","nix-configuration","nix-darwin","nixos","nixpkgs","nixvim","sketchybar","skhd","yabai"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amsynist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-12T05:22:00.000Z","updated_at":"2025-02-07T04:19:50.000Z","dependencies_parsed_at":"2024-06-12T11:18:31.509Z","dependency_job_id":"545510cc-3beb-4fb4-85d3-806ab8375020","html_url":"https://github.com/amsynist/zero-darwin","commit_stats":null,"previous_names":["amsynist/zero-darwin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsynist%2Fzero-darwin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsynist%2Fzero-darwin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsynist%2Fzero-darwin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsynist%2Fzero-darwin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amsynist","download_url":"https://codeload.github.com/amsynist/zero-darwin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248722168,"owners_count":21151211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-manager","jankyborders","nix","nix-configs","nix-configuration","nix-darwin","nixos","nixpkgs","nixvim","sketchybar","skhd","yabai"],"created_at":"2024-09-27T09:03:46.878Z","updated_at":"2025-04-13T13:34:43.550Z","avatar_url":"https://github.com/amsynist.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":" \u003ch2\u003eVoila! \u003cimg src=\"https://media.giphy.com/media/hvRJCLFzcasrR4ia7z/giphy.gif\" width=\"25px\"\u003e   \u003c/h2\u003e\n \n\u003cimg src=\"https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/palette/macchiato.png\" width=\"750\" /\u003e \n \n[![Typing SVG](https://readme-typing-svg.demolab.com?font=Zen+Dots\u0026size=24\u0026pause=1000\u0026center=false\u0026vCenter=true\u0026random=true\u0026width=835\u0026height=30\u0026lines=❄️+%5Bzero-darwin%5D+My+Personal+Nixified+Dotfiles+~%2F.+%F0%9F%93%82)](https://git.io/typing-svg)\n\n\u003cimg src=\"https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/palette/macchiato.png\" width=\"750\" /\u003e\n\n\n![Boy editing neon](https://github.com/amsynist/zero-darwin/assets/50878560/c69fbd50-1634-4881-986b-bcbeb268f056)\n## Nix-Darwin \u0026 Home Manager: Your macOS dotfiles, perfected.\n\u003e **Harnessing Nix,Flakes,Nix-Darwin, and Home Manager to manage macOS system settings and dotfile configurations**\n### Structure\n\n```css\n├── Makefile\n├── README.md\n├── configs\n├── flake.lock\n├── flake.nix\n└── modules\n    ├── darwin\n    │   ├── custom\n    │   ├── default.nix\n    │   ├── services\n    │   └── settings\n    │       ├── default.nix\n    │       ├── environment.nix\n    │       ├── nix-settings.nix\n    │       └── system.nix\n    └── home-manager\n        ├── cliPkgs.nix\n        ├── default.nix\n        ├── manual.nix\n        └── programs\n```\n### Top-Level Files\n\n- `Makefile`: Contains commands to simplify common tasks, such as updating and building configurations.\n- `flake.lock`: Lock file for the Nix flake, ensuring reproducibility.\n- `flake.nix`: Main entry point for the Nix flake, defining inputs, outputs, and configuration.\n\n### Modules\n\n#### Darwin (System Configuration)\n\n- `default.nix`: Main entry point for system configuration.\n- `modules/customServices`: Custom services configuration.\n  - `borders.nix`: Configuration for window borders.\n  - `default.nix`: Default custom services configuration.\n- `services`: Configuration for system services.\n  - `borders.nix`: Service configuration for borders.\n  - `default.nix`: Default services configuration.\n  - `sketchybar.nix`: Configuration for SketchyBar.\n  - `skhd.nix`: Configuration for Skhd (hotkey daemon).\n  - `yabai.nix`: Configuration for Yabai (window manager).\n- `settings`: System settings configuration.\n  - `default.nix`: Default system settings.\n  - `environment.nix`: Environment variables.\n  - `nix-settings.nix`: Nix-specific settings.\n  - `system.nix`: System-wide settings.\n\n#### Home Manager (User Configuration)\n\n- `cliPkgs.nix`: CLI packages configuration.\n- `default.nix`: Main entry point for Home Manager configuration.\n- `manual.nix`: Post-activation and manual scripting, such as file moving and symlink creation.\n- `programs`: Specific program configurations.\n  - `fzf.nix`: Configuration for FZF (fuzzy finder).\n  - `misc.nix`: Miscellaneous program settings.\n  - `starship.nix`: Configuration for the Starship prompt.\n\n### Configs\n\n- `sketchybar`: Contains the configuration files and plugins for SketchyBar.\n  - `plugins`: Contains various shell scripts used by SketchyBar.\n  - `sketchybarrc`: Main configuration file for SketchyBar.\n\n## Usage\n\n### Prerequisites\n\nEnsure you have Nix and Nix-Darwin installed on your macOS system.\n\n### Setting Up\n\n1. **Clone the Repository**:\n   ```sh\n   git clone \u003crepository-url\u003e\n   cd \u003crepository\u003e\n   ```\n\n2. **Build and Apply Configuration**:\n   ```sh\n   make build\n   make switch\n   ```\n\n   The `Makefile` contains targets to simplify the process:\n   - `make build`: Builds the configuration.\n   - `make switch`: Switches to the new configuration.\n   - `make darwin-refresh`: Refreshes the Nix-Darwin configuration.\n\n### Updating\n\nTo update the configuration or dependencies, use the following commands:\n```sh\nnix flake update\nmake build\nmake switch\n```\n\n## Key Features\n\n- **System Preferences**: Configure macOS system settings such as network configurations, Dock preferences, and power settings.\n- **System Services**: Enable and configure system services such as SSH, NFS, and other daemons.\n- **Package Management**: Install and manage system-wide packages.\n- **Hardware Configuration**: Manage hardware settings like display resolution and sound settings.\n- **User Environment**: Configure user-specific settings and environment variables using Home Manager.\n\n## Post-Activation and Manual Scripting\n\nThe `manual.nix` file contains scripts and configurations for handling post-activation tasks and manual operations, such as file moving and symlink creation for services like SketchyBar.\n\n### Script Details\n\n- **Home Manager Activation**:\n  ```nix\n  { lib, pkgs, ... }:\n  {\n    home.activation.sketchybar = lib.hm.dag.entryAfter [\"writeBoundary\"] (\"${pkgs.sketchybar}/bin/sketchybar --reload\");\n\n    home.file = {\n      \".config/sketchybar\".source = ../../configs/sketchybar;\n    };\n  }\n  ```\n\n- **Post-Activation Script in Darwin Configuration**:\n  ```nix\n  system.activationScripts.postUserActivation.text = ''\n    # Following line should allow us to avoid a logout/login cycle\n    /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u\n    # To reflect Dock Changes (Risky)\n    killall Dock\n  '';\n  ```\n\n  - `/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u`: Applies system settings immediately, avoiding the need for a logout/login cycle.\n  - `killall Dock`: Restarts the Dock to apply any changes made to its configuration.\n\n### Warning\n\n**Comment the above activation script if you are not aware**\n\n- Forcefully restarting the Dock can disrupt the user experience and may result in lost data if any applications are open in the Dock.\n- If you are unsure about the implications of these commands, it is recommended to comment out this section by adding `#` at the beginning of each line.\n\n## Customization\n\nFeel free to customize the configuration files to suit your needs. The modular structure allows for easy addition and modification of settings and services.\n\n## Contribution\n\nContributions are welcome! Feel free to open issues or pull requests to improve this configuration.\n\n---\n\nThis README provides an overview and guide for using and customizing your Nix-Darwin and Home Manager setup. Feel free to adjust the details according to your specific setup and preferences.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famsynist%2Fzero-darwin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famsynist%2Fzero-darwin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famsynist%2Fzero-darwin/lists"}