update: modularize users, pam, gnupg, openssh
This commit is contained in:
parent
15d7453ff2
commit
b708969576
9 changed files with 113 additions and 73 deletions
|
|
@ -1,13 +1,26 @@
|
|||
{ pkgs, ... }: {
|
||||
{ pkgs, lib, ... }: {
|
||||
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../../nixosModules/default.nix
|
||||
];
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
|
||||
settings = {
|
||||
users.veneficium.enable = lib.mkForce true;
|
||||
|
||||
programs.gnupg.enable = lib.mkForce true;
|
||||
programs.gnupg.ssh = lib.mkForce true;
|
||||
|
||||
services = {
|
||||
pam = {
|
||||
enable = lib.mkForce true;
|
||||
sshd.useGoogleAuth = lib.mkForce true;
|
||||
sshd.gnupg = lib.mkForce true;
|
||||
};
|
||||
openssh.enable = lib.mkForce true;
|
||||
openssh.usePAM = lib.mkForce true;
|
||||
};
|
||||
};
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
|
@ -18,50 +31,6 @@
|
|||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 12342 ];
|
||||
settings = {
|
||||
PasswordAuthentication = true;
|
||||
AllowUsers = null;
|
||||
UsePAM = true;
|
||||
X11Forwarding = false;
|
||||
PermitRootLogin = "prohibit-password"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no"
|
||||
};
|
||||
};
|
||||
|
||||
security.pam = {
|
||||
services.sshd = {
|
||||
name = "sshd";
|
||||
unixAuth = true;
|
||||
googleAuthenticator.enable = true;
|
||||
gnupg.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Rome";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "it_IT.UTF-8";
|
||||
LC_IDENTIFICATION = "it_IT.UTF-8";
|
||||
LC_MEASUREMENT = "it_IT.UTF-8";
|
||||
LC_MONETARY = "it_IT.UTF-8";
|
||||
LC_NAME = "it_IT.UTF-8";
|
||||
LC_NUMERIC = "it_IT.UTF-8";
|
||||
LC_PAPER = "it_IT.UTF-8";
|
||||
LC_TELEPHONE = "it_IT.UTF-8";
|
||||
LC_TIME = "it_IT.UTF-8";
|
||||
};
|
||||
|
||||
services.xserver.xkb = {
|
||||
layout = "it";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
console.keyMap = "it";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nano
|
||||
lshw
|
||||
|
|
@ -73,14 +42,6 @@
|
|||
google-authenticator
|
||||
];
|
||||
|
||||
users.users.veneficium = {
|
||||
isNormalUser = true;
|
||||
description = "Veneficium";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [];
|
||||
};
|
||||
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# Allow unfree packages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue