Grapple4139

Extract of configuration.nix

Sep 22nd, 2023
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | Software | 0 0
  1. # Enabling hyprlnd on NixOS
  2. programs.hyprland = {
  3. enable = true;
  4. xwayland.enable = true;
  5. };
  6.  
  7. # XDG portal
  8. xdg.portal.enable = true;
  9. xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
  10.  
  11. # Yubikey for GPG and SSH
  12. # https://nixos.wiki/wiki/Yubikey
  13. services.udev.packages = [ pkgs.yubikey-personalization ];
  14.  
  15. # Yubico Authenticator (yubioath-flutter) Requires PCSCD
  16. # BUT...the Wiki states "...that the PCSC-Lite daemon sometimes conflicts with gpg-agent."
  17. services.pcscd.enable = true;
  18.  
  19. # Some programs need SUID wrappers, can be configured further or are
  20. # started in user sessions.
  21. # programs.mtr.enable = true;
  22.  
  23. programs.gnupg.agent = {
  24. enable = true;
  25. enableSSHSupport = true;
  26. };
  27.  
  28. # Enable the OpenSSH daemon.
  29. services.openssh = {
  30. enable = true;
  31. # require public key authentication for better security
  32. settings.PasswordAuthentication = false;
  33. settings.KbdInteractiveAuthentication = false;
  34. settings.PermitRootLogin = "no";
  35. };
  36.  
  37. # Authorized SSH Public Keys
  38. users.users.r0b0ty.openssh.authorizedKeys.keys = [
  39. # note: ssh-copy-id will add user@clientmachine after the public key
  40. # but we can remove the "@clientmachine" part
  41. ];
  42.  
  43. # Enable the u2f PAM module for login and sudo requests
  44. security.pam.services = {
  45. login.u2fAuth = true;
  46. sudo.u2fAuth = true;
  47. };
  48.  
  49.  
Tags: nixos
Advertisement
Add Comment
Please, Sign In to add comment