Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

mducoli/kawari-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kawari-nix

Home manager module to embed a file content (usually secrets) into a text file at system/home-manager activation.

This project was made because sops-nix doesn't support template files when used as a home manager module

At home manager activation the templates are filled and the resulting files are stored in $XDG_RUNTIME_DIR/kawari-nix/secrets and linked where you need them.

Installation

Add kawari-nix to your flake inputs:

{
  inputs = {
    # ...
    kawari-nix.url = "github:mducoli/kawari-nix";
  };
}

Import the home-manager module

{
  # NixOS system-wide home-manager configuration
  home-manager.sharedModules = [
    inputs.kawari-nix.homeManagerModule
  ];
}
{
  # Configuration via home.nix
  imports = [
    inputs.kawari-nix.homeManagerModule
  ];
}

Usage

Here is an example usage with sops-nix

kawari.template."example-app" = {
  # you can pass a path to the function kawari.placeholder to include it's content at activation
  content = ''
    password = "${inputs.kawari.placeholder config.sops.secrets.password.path}"
  '';
  # alternatively you can specify the template file path
  contentPath = "${config.xdg.configHome}/example-app/config.toml"
  # where the result will be linked to, this is the default value
  path = "${config.xdg.configHome}/kawari-nix/secrets/example-app";
  # you can specify other locations to link to
  linkTo = [];
};

Configuration

You can change the default directory of the links

kawari.defaultPath = "${config.xdg.configHome}/kawari-nix"; # default value

About

Home manager module to fill templates with secrets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors