some server changes

This commit is contained in:
Dmitriy Kholkin 2021-10-25 23:13:24 +03:00
parent 6b7325b8d0
commit 2899c3f4fc
5 changed files with 15 additions and 18 deletions

View File

@ -29,10 +29,5 @@
deviceSpecific.wireguard.enable = false;
boot.cleanTmpDir = true;
networking.hostName = "matrix-vm-instance";
networking.firewall.allowPing = true;
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1OdiD3T30dTTVtwDjiVEQ+Dd9P92/4rI60x1xYtr6P75UYZF7eIO6FrxH8FAeSH6N10YsdTK1NPRDj5bsbLDB7d4D4YewPw+tnl3Qnp/04k+/+gpSFhVyUwKWvSTgU34NZFiwdHLuefYkHdAmDBhUhWC+28DyWSPn2LLTHhGRBOaNG39ur/1vaIuJb00vbzA/HWQmIYIByd51gjQkgC+SxIlYb13Q/L6SqHCZ8RUzJyS9bGM9Imw5T7V7SVC2FRjOt6NUm8AVVw06yRgtjXipEYA9GE+Rp69+MNmKr2OxR//KWyQb/SCfQyIWrBn0ee266XukOFuC4bpp50TjTEXx oracle_cloud"
];
# networking.hostName = lib.mkForce "Oracle-Cloud";
}

View File

@ -36,10 +36,10 @@ with types; {
default =
!isNull (builtins.match ".*VM" config.networking.hostName);
};
isCloud = mkOption {
isServer = mkOption {
type = bool;
default =
!isNull (builtins.match ".*Cloud" config.networking.hostName);
!isNull (builtins.match ".*(Cloud|Server)" config.networking.hostName);
};
isISO = mkOption {
type = bool;

View File

@ -30,7 +30,13 @@ with config.deviceSpecific;
};
userControlled.enable = true;
};
firewall.enable = false;
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = lib.mkIf isServer [ 22 80 443 13748 ];
};
usePredictableInterfaceNames = true;
hostName = config.device;

View File

@ -1,5 +1,5 @@
{ pkgs, config, lib, ... }: {
{ pkgs, config, lib, ... }:
with config.deviceSpecific; {
i18n.defaultLocale = "en_GB.UTF-8";
console.font = "cyr-sun16";
@ -11,9 +11,9 @@
LANG = lib.mkForce "en_GB.UTF-8";
};
time.timeZone = lib.mkIf (!config.deviceSpecific.isCloud) "Europe/Moscow";
time.timeZone = lib.mkIf (!isServer) "Europe/Moscow";
location = lib.mkIf (!config.deviceSpecific.isCloud) {
location = lib.mkIf (!isServer) {
provider = "manual";
latitude = 48.78583;
longitude = 44.77973;

View File

@ -1,7 +1,6 @@
{ inputs, ... }: {
imports = with inputs.self.nixosModules; with inputs.self.nixosProfiles; [
inputs.home-manager.nixosModules.home-manager
inputs.base16.hmModule
applications
devices
@ -9,19 +8,16 @@
gpg
locale
misc
network
nix
overlay
secrets
secrets-envsubst
security
themes
ssh
xdg
zsh
kitty
direnv
fonts
];
}