🚀 add ssh module
This commit is contained in:
parent
5c0752b891
commit
4b08e874b7
5 changed files with 65 additions and 3 deletions
|
|
@ -81,6 +81,10 @@ with lib; {
|
|||
logseq.enable = true;
|
||||
python.enable = true;
|
||||
rofi.enable = true;
|
||||
ssh = {
|
||||
enable = true;
|
||||
includeSecrets = [ ../../secrets/ssh-home.age ];
|
||||
};
|
||||
spotify.enable = true;
|
||||
thunar.enable = true;
|
||||
zathura.enable = true;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
./python.nix
|
||||
./rofi
|
||||
./spotify.nix
|
||||
./ssh.nix
|
||||
./sway.nix
|
||||
./thunar.nix
|
||||
./vim.nix
|
||||
|
|
|
|||
39
modules/programs/ssh.nix
Normal file
39
modules/programs/ssh.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.ssh;
|
||||
|
||||
baseName = path: removeSuffix ".age" (baseNameOf path);
|
||||
in
|
||||
{
|
||||
options.my.programs.ssh = {
|
||||
enable = mkEnableOption "ssh";
|
||||
includeSecrets = mkOption {
|
||||
default = [ ];
|
||||
type = with types; listOf path;
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable
|
||||
{
|
||||
age.secrets = listToAttrs (map
|
||||
(path: {
|
||||
name = baseName path;
|
||||
value = {
|
||||
file = path;
|
||||
owner = "1000";
|
||||
};
|
||||
})
|
||||
cfg.includeSecrets);
|
||||
home-manager.users.moritz.programs.ssh = {
|
||||
enable = true;
|
||||
includes = map (path: "/run/agenix/" + baseName path) cfg.includeSecrets;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue