Coder Social home page Coder Social logo

fromage's Introduction

fromage - age secrets for Nix home-manager, decrypted upon profile activation

fromage is a module for home-manager that enables decryption of secrets when a home-manager profile is activated.

It is based on the homeage project.

Features

  • Filetype-agnostic declarative secrets can be used inside your home-manager flakes.
  • Secrets are decrypted with an activation step, integrating seamlessly with home-manager.
  • Decryption uses the typical age workflow with ssh or age keys.
  • Extremely small, so inspect the source yourself!

Options

Check out the list of configuration options.

Overview

Secrets are encrypted by some external identity, and stored as an .age file in your home-manager flake.

Build: Encrypted secrets are copied to the Nix store.

Pre-writeBoundary: Before activating the profile, home-manager verifies the secrets can be decrypted with the provided identity. Additionally, it verifies that no secret file conflicts with a file that home-manager already manages.

Post-writeBoundary: After home-manager activates the rest of the profile, it decrypts all secrets and writes them to ~/.local/share/fromage/. Secret files are re-decrypted each time a generation with this module is activated.

Runtime: Secrets remain unencrypted in that directory.

Roadmap

  • Support passphrases
  • Add more tests

Getting started

Nix Flakes

The below example is mostly home-manager boilerplate. In a nutshell, add fromage.homeManagerModules.fromage to the list of modules and set the proper options.

{
  inputs = {
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
    fromage = {
      url = "github:libjared/fromage";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, home-manager, fromage, ... }:
    let
      pkgs = import nixpkgs {
        system = "x86_64-linux";
      };
    in
    {
      homeConfigurations = {
        "me@machine" = home-manager.lib.homeManagerConfiguration {
          inherit pkgs;
          modules = [
            fromage.homeManagerModules.fromage
            {
              home = {
                username = "me";
                homeDirectory = "/home/me";
                stateVersion = "22.11";
              };

              # CHECK HERE for fromage configuration
              fromage.identityPaths = [ "/home/me/.ssh/id_ed25519" ];
              fromage.file."ta.key" = {
                src = ./secrets/mytakey.age;
              };
              # this will create ~/.local/share/fromage/ta.key
            }
          ];
        };
      };
    };
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.