MIT License

项目介绍

brizzbuzz/opnix 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 190 个 Star、21 次 Fork。

仓库全名
brizzbuzz/opnix
开源许可证
MIT License
Star 数
190
Fork 数
21
未关闭 Issue
3

README 摘要

OpNix Secure 1Password secrets integration for NixOS, nix-darwin, and Home Manager. Features Declarative Secrets: Define secrets directly in Nix configuration Service Integration: Automatic systemd/launchd service restarts on secret changes Multi-Platform: Full support for NixOS, nix-darwin, and Home Manager Secure: Uses 1Password service accounts with proper file permissions Reliable: systemd services ensure…

完整内容见 GitHub 原始 README 或本页 。

常见问题

opnix 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 190 个 Star。

opnix 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 opnix 的源码?

可以直接克隆仓库:git clone https://github.com/brizzbuzz/opnix.git,默认分支为 main;安装与运行步骤见仓库 README。

opnix 最近还在维护吗?

仓库最近一次更新为 8月18日,当前有 3 个未关闭 Issue;Star 数为 190,可作为社区活跃度的参考。

关于

Agenix inspired tool enabling users to inject secrets from 1password into their Nix servers at build time

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
235
价值分
120
活跃状态
活跃

README

OpNix

Secure 1Password secrets integration for NixOS, nix-darwin, and Home Manager.

Features

  • Declarative Secrets: Define secrets directly in Nix configuration
  • Service Integration: Automatic systemd/launchd service restarts on secret changes
  • Multi-Platform: Full support for NixOS, nix-darwin, and Home Manager
  • Secure: Uses 1Password service accounts with proper file permissions
  • Reliable: systemd services ensure secrets are available without breaking system boot
  • Developer Shells: Export 1Password secrets as environment variables inside flake devshells

Quick Start

Add OpNix to your flake:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    opnix.url = "github:brizzbuzz/opnix";
  };

  outputs = { nixpkgs, opnix, ... }: {
    # NixOS
    nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
      modules = [
        opnix.nixosModules.default
        ./configuration.nix
      ];
    };

    # nix-darwin
    darwinConfigurations.yourhostname = nix-darwin.lib.darwinSystem {
      modules = [
        opnix.darwinModules.default
        ./configuration.nix
      ];
    };

    # Home Manager
    homeConfigurations.yourusername = home-manager.lib.homeManagerConfiguration {
      modules = [
        opnix.homeManagerModules.default
        ./home.nix
      ];
    };
  };
}

Configure secrets:

# NixOS/nix-darwin
services.onepassword-secrets = {
  enable = true;
  tokenFile = "/etc/opnix-token";
  secrets = {
    databasePassword = {
      reference = "op://Homelab/Database/password";
      owner = "postgres";
      services = ["postgresql"];
    };
  };
};

# Home Manager
programs.onepassword-secrets = {
  enable = true;
  secrets = {
    sshPrivateKey = {
      reference = "op://Personal/SSH/private-key";
      path = ".ssh/id_rsa";
      mode = "0600";
    };
  };
};

Set up your token:

sudo nixos-rebuild switch --flake .
sudo opnix token set
sudo systemctl restart opnix-secrets.service

Note: On NixOS, opnix is automatically added to environment.systemPackages once services.onepassword-secrets.enable = true and you rebuild — no separate CLI install or overlay needed. If you previously added opnix manually on NixOS, that entry is now redundant and can be removed. (On nix-darwin and Home Manager, CLI installation is unchanged.)

Documentation

📚 Complete Documentation

Platform Support

Platform Module Use Case
NixOS nixosModules.default System-wide secret management
nix-darwin darwinModules.default macOS system secrets
Home Manager homeManagerModules.default User-specific secrets

Getting Help

License

MIT License

评论

暂无评论