8000 GitHub - gaoyifan/nix at ci · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2FGitHub.com%2Fgaoyifan%2Fnix%2Ftree%2Fci","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Ffiles%2Fdisambiguate\u0026source=header-repo\u0026source_repo=gaoyifan%2Fnix","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://GitHub.com/gaoyifan/nix/tree/ci\",\"user_id\":null}}","auth_hydro_click_hmac":"a26eacee36e0293ac028fa0d67fb4f3b0d7babc26b4bb5d2f174b9ed7a932c7f"}}
gaoyifanPublic

About

Oh My Nix

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Oh My Nix

This repository is public primarily as a reference for people putting together their own Nix setup.

It is a personal flake covering:

  • macOS machines via nix-darwin
  • Linux user environments via home-manager
  • Linux system services via system-manager
  • NixOS hosts managed through deploy-rs
  • A small set of custom packages under pkgs/

Layout

Quick Start

This is not intended to be a turnkey setup. It is my actual personal configuration, with private pieces removed or replaced by placeholders.

You can still clone it and inspect or build the public parts:

git clone git@github.com:gaoyifan/nix.git
cd nix

If you want to evaluate or adapt it locally:

just check

just is the main entry point if you want to use the repo directly:

  • macOS: runs just darwin
  • Linux: runs just home, then just system

If Nix is not installed yet, just will bootstrap it via the Determinate Systems installer.

Common Commands

# Apply the current machine configuration
just

# Apply only the Home Manager profile on Linux
just home

# Apply only the system-manager profile on Linux
just system

# Apply the nix-darwin system on macOS
just darwin

# Format all supported files
just fmt

# Check formatting without changing files
just fmt-check

# Evaluate the configuration used by this machine
just check

# Validate every flake output across all supported platforms
just check-all

# Deploy a NixOS target through deploy-rs
just deploy <target>

# Sync the flake and run nixos-rebuild on the target host
just sync-and-rebuild <target>

Flake Outputs

The flake exposes:

  • packages.<system>.*: custom packages from pkgs/default.nix
  • devShells.<system>.default: development shell used by CI and local development
  • legacyPackages.<system>.homeConfigurations.<username>: standalone Home Manager configs for Linux
  • systemConfigs.<system>.default: standalone system-manager configs for Linux
  • darwinConfigurations.<hostname>: integrated macOS system configs
  • nixosConfigurations.<hostname>: NixOS host configurations

Examples:

# Enter the dev shell
nix develop

# Build a custom package
nix build .#lazyssh

# Build the default darwin system
nix build .#darwinConfigurations.default.system

Secrets

The main repository is public. Real secrets live in a private submodule:

  • secrets/files/: private submodule with encrypted secrets
  • secrets/files/secrets.nix: private recipient registry and agenix authorization matrix
  • secrets/files-example/: non-secret metadata used in CI and public builds

When the private submodule is absent, the public repo automatically falls back to files-example, so CI and external readers can still evaluate and build the flake safely.

See docs/secrets.md for setup, migration, and adding new secrets.

Notes For Readers

  • Treat this repo as a collection of patterns rather than a reusable module set.
  • Hostnames, package choices, and layout reflect one real environment, not a generic template.
  • The most reusable parts are likely the justfile, the flake structure, the home-manager/ modules, and the shared nixos/common/ modules.

Development Notes

  • Run just fmt before committing.
  • Run just check before opening a PR. Use just check-all when a full flake evaluation is needed.
  • Do not commit result/ symlinks or build outputs.

About

Oh My Nix

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0