This commit is contained in:
2023-02-28 12:56:08 +00:00
parent 06da209722
commit d8394373ec
9 changed files with 197 additions and 98 deletions

View File

@@ -1,53 +1,11 @@
{ config, pkgs, inputs, lib, hostName, util, ... }:
{ config, pkgs, lib, inputs, hostName, outputs, ... }:
with lib;
with lib.my;
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;
# map = import "${inputs.self}/lib/map.nix";
# '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 = [
@@ -70,7 +28,7 @@ in {
systemd.user.services.kbfs.Unit.After = [ "sops-nix.service" ];
sops = {
secrets = hm_secrets "${secretstore}/user_dotfiles/${username}@${hostName}/keybase/" "${config.xdg.configHome}/keybase/";
secrets = map.hm_secrets "${secretstore}/user_dotfiles/${username}@${hostName}/keybase/" "${config.xdg.configHome}/keybase/";
};
};
}