{"id":26495968,"url":"https://github.com/dededecline/nix-config","last_synced_at":"2025-03-20T11:20:02.486Z","repository":{"id":283207754,"uuid":"950330994","full_name":"dededecline/nix-config","owner":"dededecline","description":"A declarative macOS system configuration using nix-darwin, home-manager, and homebrew.","archived":false,"fork":false,"pushed_at":"2025-03-19T20:07:15.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T20:33:44.418Z","etag":null,"topics":["bash","darwin","home-manager","homebrew","macos","nix","nix-darwin","nix-flake","zsh"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dededecline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-03-18T01:57:23.000Z","updated_at":"2025-03-19T20:07:19.000Z","dependencies_parsed_at":"2025-03-19T04:40:52.704Z","dependency_job_id":null,"html_url":"https://github.com/dededecline/nix-config","commit_stats":null,"previous_names":["dededecline/nixos-config","dededecline/nix-config"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dededecline%2Fnix-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dededecline%2Fnix-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dededecline%2Fnix-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dededecline%2Fnix-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dededecline","download_url":"https://codeload.github.com/dededecline/nix-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244600725,"owners_count":20479307,"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":["bash","darwin","home-manager","homebrew","macos","nix","nix-darwin","nix-flake","zsh"],"created_at":"2025-03-20T11:20:01.968Z","updated_at":"2025-03-20T11:20:02.476Z","avatar_url":"https://github.com/dededecline.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nix-Darwin Configuration\n\n## Table of Contents\n- [Repository Structure](#repository-structure)\n- [Features](#features)\n- [Setup Tutorial](#setup-tutorial)\n  - [Prerequisites](#prerequisites)\n  - [Installation Steps](#installation-steps)\n  - [1Password Setup](#1password-setup)\n- [Usage Guide](#usage-guide)\n  - [Updating Your System](#updating-your-system)\n  - [Adding New Packages](#adding-new-packages)\n  - [Adding New Applications](#adding-new-applications)\n  - [Changing User Information](#changing-user-information)\n- [Customization](#customization)\n  - [System Preferences](#system-preferences)\n  - [Shell Configuration](#shell-configuration)\n  - [Git Configuration](#git-configuration)\n  - [Window Management](#window-management)\n- [Troubleshooting](#troubleshooting)\n\nA declarative macOS system configuration using nix-darwin, home-manager, and homebrew.\n\n## Repository Structure\n\n```\n/etc/nix-darwin/\n├── flake.nix               # Main configuration entry point\n├── config/\n│   ├── default.nix         # Import all configurations\n│   ├── home.nix            # Home-manager configuration\n│   ├── homebrew.nix        # Homebrew packages and casks\n│   ├── packages.nix        # System packages configuration\n│   └── system.nix          # System preferences and defaults\n├── apps/\n│   ├── default.nix         # Import all app configurations\n│   ├── aerospace/\n│   │   └── aerospace.flake # Aerospace window manager configuration\n│   ├── git/\n│   │   └── git.flake       # Git configuration \n│   └── zsh/\n│       └── zsh.flake       # ZSH shell configuration\n├── scripts/\n│   └── fetch-email.sh      # Script for 1Password email fetching\n└── README.md               # This file\n```\n\n## Features\n\n- **Declarative System Configuration**: Define your entire macOS setup in code\n- **Package Management**: Manage packages with Nix and Homebrew\n- **Dotfile Management**: Configure your shell and tools with home-manager\n- **Reproducible**: Easily replicate your setup on a new machine\n- **1Password Integration**: Securely retrieve secrets like Git email\n- **Modular Structure**: Easily maintain and extend configurations\n- **External Scripts**: Separation of logic from configuration\n- **Window Management**: Tiling window management with Aerospace\n\n## Setup Tutorial\n\n### Prerequisites\n\n- macOS 12+\n- Administrative access\n\n### Installation Steps\n\n1. Install Nix package manager using Lix (recommended):\n\n   ```bash\n   curl -sSf -L https://install.lix.systems/lix | sh -s -- install --nix-build-group-id 30000\n   ```\n   \n   - Answer `Y` when prompted to install Nix\n   - Answer `Y` when prompted to set up the nix-daemon\n\n2. Source the Nix profile:\n\n   ```bash\n   . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh\n   ```\n\n3. Create and set permissions for the nix-darwin directory:\n\n   ```bash\n   sudo mkdir -p /etc/nix-darwin\n   sudo chown $(id -nu):$(id -ng) /etc/nix-darwin\n   ```\n\n4. Clone this repository (or create a new one from the template):\n\n   ```bash\n   # Option 1: Clone this repository\n   git clone https://github.com/dededecline/nixos-config.git /etc/nix-darwin\n   \n   # Option 2: Create a new configuration from template\n   cd /etc/nix-darwin\n   nix flake init -t nix-darwin/nix-darwin-24.11\n   ```\n\n5. If using Option 2, customize the configuration files to match your needs.\n\n6. Apply the configuration:\n\n   ```bash\n   nix run nix-darwin/nix-darwin-24.11#darwin-rebuild -- switch\n   ```\n\n7. After the first install, you can use the simplified command:\n\n   ```bash\n   darwin-rebuild switch\n   ```\n\n### 1Password Setup\n\nThis configuration uses 1Password to store sensitive information such as your Git email. To set this up:\n\n1. Install 1Password (already included in the configuration)\n2. Create an item in 1Password with the title \"git-email\" and a field called \"email\"\n3. Ensure you're signed in to 1Password CLI:\n\n   ```bash\n   op signin\n   ```\n\n## Usage Guide\n\n### Updating Your System\n\nUpdate and rebuild your system with:\n\n```bash\ndarwin-rebuild switch --flake /etc/nix-darwin\n```\n\nOr use the alias defined in the configuration:\n\n```bash\nupdate\n```\n\n### Adding New Packages\n\n1. Edit `config/packages.nix` to add system-wide packages\n2. Edit `config/homebrew.nix` to add Homebrew packages or casks\n3. Edit `config/home.nix` to add user-specific packages\n\n### Adding New Applications\n\nTo add a new application configuration:\n\n1. Create a new directory in `apps/` for your application\n2. Create a configuration file (e.g., `myapp.flake`)\n3. Add it to the imports in `apps/default.nix`\n\nExample for a new app configuration:\n\n```nix\n# apps/newapp/newapp.flake\n{ pkgs, user, ... }: {\n  home-manager.users.${user.username} = { ... }: {\n    programs.newapp = {\n      enable = true;\n      # Configuration options here\n    };\n  };\n}\n```\n\n### Changing User Information\n\nUser information is centralized in `flake.nix` (or config/host.nix if extracted):\n\n```nix\nuser = {\n  name = \"Dani Klein\";\n  username = \"daniklein\";\n  githubUsername = \"dededecline\";\n  homeDirectory = \"/Users/daniklein\";\n};\n```\n\n## Customization\n\n### System Preferences\n\nSystem preferences are configured in `config/system.nix`.\n\n### Shell Configuration\n\nShell aliases and configuration are defined in `apps/zsh/zsh.flake`.\n\n### Git Configuration\n\nGit settings are configured in `apps/git/git.flake`.\n\n### Window Management\n\nAerospace window manager settings are configured in `apps/aerospace/aerospace.flake`. This includes:\n\n- Keyboard shortcuts for window manipulation\n- Gap and padding settings\n- Window layouts and workspace configuration\n- Application-specific rules\n- Integration with sketchybar and borders\n\n## Troubleshooting\n\nIf you encounter issues:\n\n1. Check Nix store permissions:\n   ```bash\n   sudo chown -R root:wheel /nix\n   ```\n\n2. Ensure proper permissions on configuration directory:\n   ```bash\n   sudo chown -R $(id -nu):$(id -ng) /etc/nix-darwin\n   ```\n\n3. For more help, consult:\n   - [nix-darwin documentation](https://github.com/LnL7/nix-darwin)\n   - [home-manager documentation](https://nix-community.github.io/home-manager/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdededecline%2Fnix-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdededecline%2Fnix-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdededecline%2Fnix-config/lists"}