mirror of
https://github.com/sstent/vmimages.git
synced 2026-04-04 03:53:38 +00:00
sync
This commit is contained in:
77
home-manager/global/keybase.nix
Normal file
77
home-manager/global/keybase.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{ config, pkgs, inputs, lib, hostName, util, ... }:
|
||||
with lib;
|
||||
|
||||
let
|
||||
# inherit
|
||||
# (builtins)
|
||||
# attrNames
|
||||
# attrValues
|
||||
# foldl'
|
||||
# isPath
|
||||
# pathExists
|
||||
# readDir
|
||||
# toString
|
||||
# ;
|
||||
|
||||
# inherit
|
||||
# (lib)
|
||||
# flatten
|
||||
# filterAttrs
|
||||
# forEach
|
||||
# getAttrFromPath
|
||||
# hasPrefix
|
||||
# hasSuffix
|
||||
# id
|
||||
# mapAttrs'
|
||||
# mapAttrsToList
|
||||
# mkIf
|
||||
# nameValuePair
|
||||
# removeSuffix
|
||||
# ;
|
||||
cfg = config.custom.keybase;
|
||||
username = config.home.username;
|
||||
secretstore = config._secretstore;
|
||||
util = import "${inputs.self}/lib";
|
||||
|
||||
# # 'sops' Encrypted Secrets
|
||||
# hm_secrets = dir: out_dir:
|
||||
# filter (name: type: type != null && !(hasPrefix "_" name)) (name: type:
|
||||
# if type == "regular"
|
||||
# then
|
||||
# nameValuePair name {
|
||||
# sopsFile = dir + "/${name}";
|
||||
# format = "binary";
|
||||
# path = out_dir + "/${name}";
|
||||
|
||||
# }
|
||||
# else nameValuePair "" null) (readDir dir);
|
||||
|
||||
# filter = name: func: attrs: filterAttrs name (mapAttrs' func attrs);
|
||||
|
||||
|
||||
in {
|
||||
# imports = [
|
||||
# "${inputs.self}/libs/map.nix"
|
||||
# ];
|
||||
|
||||
options.custom.keybase = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable KeyBase";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.keybase.enable = true;
|
||||
services.kbfs.enable = true;
|
||||
systemd.user.services.keybase.Unit.After = [ "sops-nix.service" ];
|
||||
systemd.user.services.kbfs.Unit.After = [ "sops-nix.service" ];
|
||||
|
||||
sops = {
|
||||
secrets = util.map.hm_secrets "${secretstore}/user_dotfiles/${username}@${hostName}/keybase/" "${config.xdg.configHome}/keybase/";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user