Skip to content

Instantly share code, notes, and snippets.

@letThemPlay
Created November 18, 2024 09:15
Show Gist options
  • Select an option

  • Save letThemPlay/6f9fcbe28562de22d34c8995747a88b1 to your computer and use it in GitHub Desktop.

Select an option

Save letThemPlay/6f9fcbe28562de22d34c8995747a88b1 to your computer and use it in GitHub Desktop.
Stripped Down version of agenix home-manager setup with Env Vars
{
inputs,
stateVersion,
pkgs,
nixvim,
...
}:
{
imports = [ ./hmuser.nix ];
home-manager = {
sharedModules = [
../../hm
nixvim.homeManagerModules.nixvim
inputs.agenix.homeManagerModules.default
];
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs stateVersion pkgs;
};
};
}
{
pkgs,
stateVersion,
inputs,
config,
...
}:
{
programs = {
home-manager.enable = true;
};
age.secrets.tailscaleAuth.file = ../../../../secrets/tailscale-authkey.age;
xdg = {
enable = true;
userDirs = {
enable = true;
createDirectories = true;
};
};
home = {
inherit stateVersion;
username = "bob";
homeDirectory = "/home/bob";
sessionVariables = {
tailscaleAuth = ''
$(${pkgs.coreutils}/bin/cat ${config.age.secrets.tailscaleAuth.path})
'';
};
};
}
let
user1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDynItXS1ayKkq9UZ6Tw1jIB9Q1SK0lsuFsYofJY56Ni";
in
{
"tailscale-authkey.age".publicKeys = [
user1
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment