mirror of
https://github.com/librephoenix/nixos-config
synced 2025-07-06 06:52:13 +05:30
Split system config into tons of modules!
This commit is contained in:
parent
74c00ca4ef
commit
8262f63886
21 changed files with 266 additions and 180 deletions
9
system/security/blocklist.nix
Normal file
9
system/security/blocklist.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ config, blocklist-hosts, pkgs, ... }:
|
||||
|
||||
let blocklist = builtins.readFile "${blocklist-hosts}/alternates/gambling-porn/hosts";
|
||||
in
|
||||
{
|
||||
networking.extraHosts = ''
|
||||
"${blocklist}"
|
||||
'';
|
||||
}
|
16
system/security/doas.nix
Normal file
16
system/security/doas.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, myName, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Doas instead of sudo
|
||||
security.doas.enable = true;
|
||||
security.sudo.enable = false;
|
||||
security.doas.extraRules = [{
|
||||
users = [ "${myName}" ];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}];
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeScriptBin "sudo" ''exec doas "$@"'')
|
||||
];
|
||||
}
|
11
system/security/firewall.nix
Normal file
11
system/security/firewall.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Firewall
|
||||
networking.firewall.enable = true;
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
}
|
11
system/security/gpg.nix
Normal file
11
system/security/gpg.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
}
|
6
system/security/openvpn.nix
Normal file
6
system/security/openvpn.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = [ pkgs.openvpn ];
|
||||
environment.etc.openvpn.source = "${pkgs.update-resolv-conf}/libexec/openvpn";
|
||||
}
|
10
system/security/sshd.nix
Normal file
10
system/security/sshd.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable incoming ssh
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
# TODO authorizedKeysFiles = "";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue