Clean up module exports and add module to allow Nix to use an SSH agent
This commit is contained in:
parent
526b6532a5
commit
fa1a81c7f4
7 changed files with 81 additions and 77 deletions
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./ezwg.nix
|
||||
./kiosk.nix
|
||||
./ezpassthru.nix
|
||||
./fuckingprint.nix
|
||||
./workstation.nix
|
||||
./ezpw.nix
|
||||
./de2.nix
|
||||
./de3.nix
|
||||
./ezpc.nix
|
||||
];
|
||||
}
|
29
modules/nix-ssh-agent.nix
Normal file
29
modules/nix-ssh-agent.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.nix.ssh-agent;
|
||||
in {
|
||||
options.nix.ssh-agent = {
|
||||
sock = lib.mkOption {
|
||||
description = "SSH agent socket for Nix to use";
|
||||
default = "/run/user/1000/ssh-agent";
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.sock != null) {
|
||||
systemd.services.ssh-agent-nix-proxy = {
|
||||
wantedBy = [ "nix-daemon.service" ];
|
||||
before = [ "nix-daemon.service" ];
|
||||
partOf = [ "nix-daemon.service" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.socat}/bin/socat UNIX-LISTEN:/run/nix-ssh-agent,mode=770,group=nixbld,user=root,reuseaddr UNIX-CONNECT:${cfg.sock}";
|
||||
};
|
||||
};
|
||||
|
||||
nix.envVars.SSH_AUTH_SOCK = "/run/nix-ssh-agent";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue