{"id":29246617,"url":"https://github.com/makuche/config","last_synced_at":"2025-07-26T03:12:16.721Z","repository":{"id":242130128,"uuid":"808675763","full_name":"makuche/config","owner":"makuche","description":"Declarative configuration files for my Ubuntu and Darwin machines. Uses home-manager, nix-darwin and brew to install user packages and settings.","archived":false,"fork":false,"pushed_at":"2025-07-25T05:25:43.000Z","size":238,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T10:50:10.895Z","etag":null,"topics":["brew","git","home-manager","linux","macos","neovim","nix","nix-darwin","nixos","system"],"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/makuche.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,"zenodo":null}},"created_at":"2024-05-31T15:12:52.000Z","updated_at":"2025-07-25T05:25:46.000Z","dependencies_parsed_at":"2024-11-22T12:21:27.433Z","dependency_job_id":"afcf2db9-2a29-4a6e-9657-d6ae1478ec8e","html_url":"https://github.com/makuche/config","commit_stats":null,"previous_names":["makuche/config"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/makuche/config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makuche%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makuche%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makuche%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makuche%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makuche","download_url":"https://codeload.github.com/makuche/config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makuche%2Fconfig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267110049,"owners_count":24037634,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["brew","git","home-manager","linux","macos","neovim","nix","nix-darwin","nixos","system"],"created_at":"2025-07-03T23:02:21.412Z","updated_at":"2025-07-26T03:12:16.682Z","avatar_url":"https://github.com/makuche.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Config\n\nThis repo contains my `~/.config` directory with declarative system configurations using a combination of Nix, home-manager, and nix-darwin. It enables reproducible environment setup across macOS machines with minimal manual intervention.\n\n## System Overview\n- **Nix**: Package management and system configuration\n- **nix-darwin**: macOS-specific system configuration\n- **home-manager**: User environment management\n- **Homebrew**: Additional macOS (and GUI) applications via nix-homebrew integration\n\nI've moved most GUI apps to Homebrew instead of home-manager so the home-manager setup can also be used on resource-restricted Linux systems (e.g., Raspberry Pis). Additionally, Homebrew uses cached binaries while Nix compiles from source, making it faster and more convenient for certain applications.\n\n## Initial Setup\n\nThe following describes how to set up nix-darwin and home-manager for the cases 1) when using the configuration files and 2) when starting from scratch (i.e. with empty home.nix files etc.). The steps for starting from scratch are marked via \"Optional\".\n\n### 1. Install Nix\n```bash\nsh \u003c(curl -L https://nixos.org/nix/install)\n```\n\n### 2. Configure Shell\nAppend to `.zshrc`:\n```bash\nif [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then\n  . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'\nfi\n```\n\n### 3. Install Home Manager\n```bash\nnix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager\nnix-channel --update\nnix-shell '\u003chome-manager\u003e' -A install\n\n# Optional: Add packages and other settings to this file\nvim /Users/manuel/.config/home-manager/home.nix\n```\n\n### 4. Install nix-darwin\n```bash\n# Enable flakes\necho \"experimental-features = nix-command flakes\" | sudo tee -a /etc/nix/nix.conf\nsudo launchctl kickstart -k system/org.nixos.nix-daemon\n\n# Optional: Create nix darwin flake config\nmkdir -p ~/.config/nix-darwin\nnix flake init -t nix-darwin\nsed -i '' \"s/simple/$(scutil --get LocalHostName)/\" flake.nix\n\n\n# Optional: backup existing configs if present\n# mv ~/.bashrc ~/.bashrc.backup\n# mv ~/.zshrc ~/.zshrc.backup\n# mv /etc/nix/nix.conf /etc/nix/nix.conf.backup\n\n# First build\n# NOTE: When re-using the config folder, make sure to substitute darwinConfigurations.\"HOST\" with the correct host name (run scutil --get LocalHostName on MacOS)\nnix run nix-darwin --extra-experimental-features 'nix-command flakes' -- switch --flake ~/.config\n```\n\n## Daily Usage\n\n### System Management\nRebuild your system after configuration changes:\n\n```bash\nsudo bash scripts/rebuild.sh\n```\n\n### Home Manager (on non-darwin systems)\nIn this setup, using home-manager directly is not required. However, on other host systems:\n\n```bash\nhome-manager switch\nhome-manager generations\n\u003cGENERATION\u003e/activate\n```\n\n### Git Configuration\nThe gitconfig contains a label for a GPG key used for signing commits. This will need to be adapted when installing with another GitHub account or GPG key.\n\n### Package Management\nPackage versions (including Homebrew packages) are frozen by the flake.lock file for reproducibility. To update:\n\n```bash\n# Update all flake inputs\nnix flake update\n\n# Or update specific inputs\nnix flake lock --update-input nixpkgs\nnix flake lock --update-input home-manager\n\n# After updating the lock file, rebuild the system\ndarwin-rebuild switch --flake ~/.config/nix-darwin --impure\n```\n\n### Security\n\nUpdate the virus database via\n\n```bash\nfreshclam --config-file=$HOME/.config/clamav/freshclam.conf\n```\n\nScan folder or directory recursively via\n\n```bash\nclamscan --recursive --infected --database=$HOME/.config/clamav/db PATH-TO-SCAN\n```\n## Tasks\n\n### High Priority\n- [ ] install slidev (npm package) declaratively, maybe via bun\n- [ ] fix `--impure` flag requirement in darwin-rebuild\n- [ ] proper symlinks to `~/.config` for better file management\n- [ ] better documentation for the rebuild command\n\n### Medium Priority\n- [ ] simpler update mechanism for common package updates\n- [ ] GPG key configuration for git commit signing\n- [ ] Better integrate home-manager with nix-darwin\n\n### Future Work\n- [ ] migrate to a graphical virtual Linux machine running on macOS host\n  - pro: macOS peripherals and ecosystem while using Linux for development\n  - configure the VM using the same declarative approach\n- [ ] consolidate duplicate configuration between dotfiles\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakuche%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakuche%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakuche%2Fconfig/lists"}