add ssh agent

This commit is contained in:
cswimr 2025-01-28 06:41:18 -06:00
parent 233c2ca4eb
commit f383242c41
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -1,7 +1,12 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ pkgs, config, hostname, ... }:
{
pkgs,
config,
hostname,
...
}:
{
nix = {
settings = {
@ -18,10 +23,10 @@
# install the most recent stable linux kernel
/*
TODO: change this back to 'pkgs.linuxPackages_latest' once
https://github.com/NixOS/nixpkgs/commit/c805021f3a95da44a1811f1235b997f57d893dc3
and https://github.com/NixOS/nixpkgs/pull/375838
trickle down to nixos-unstable
TODO: change this back to 'pkgs.linuxPackages_latest' once
https://github.com/NixOS/nixpkgs/commit/c805021f3a95da44a1811f1235b997f57d893dc3
and https://github.com/NixOS/nixpkgs/pull/375838
trickle down to nixos-unstable
*/
boot.kernelPackages = pkgs.linuxPackages_6_12;
@ -79,11 +84,11 @@
# Add /etc/current-system-packages
environment.etc."current-system-packages".text =
let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
# Enable CUPS to print documents.
@ -132,17 +137,27 @@
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
# enableSSHSupport = true;
enableExtraSocket = true; # VSCode devcontainers require this
};
programs.ssh = {
startAgent = true;
extraConfig = ''
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
'';
};
# PAM modules
security.pam = {
loginLimits = [{
domain = "*";
type = "soft";
item = "nofile";
value = 8192;
}];
loginLimits = [
{
domain = "*";
type = "soft";
item = "nofile";
value = 8192;
}
];
};
# List services that you want to enable: