feat: modify wsl config
This commit is contained in:
@@ -1,24 +1,34 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
lib.my.makeSwitch {
|
||||
inherit config;
|
||||
default = true;
|
||||
optionName = "sops secret settings";
|
||||
optionPath = [ "sops" ];
|
||||
config' = {
|
||||
let
|
||||
cfg = config.my.sops;
|
||||
in
|
||||
{
|
||||
options.my.sops = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
sshKeyPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/persistent/home/${username}/.ssh/id_ed25519";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.age.sshKeyPaths = [
|
||||
"/persistent/home/${username}/.ssh/id_ed25519"
|
||||
cfg.sshKeyPath
|
||||
];
|
||||
users.users.${username}.extraGroups = [ "keys" ];
|
||||
environment.variables.SOPS_AGE_KEY_FILE = "/run/secrets.d/age-keys.txt";
|
||||
my.home = {
|
||||
sops.age.sshKeyPaths = [
|
||||
"/persistent/home/${username}/.ssh/id_ed25519"
|
||||
cfg.sshKeyPath
|
||||
];
|
||||
home.packages = [
|
||||
pkgs.sops
|
||||
|
||||
Reference in New Issue
Block a user