diff --git a/machines/Oracle-Cloud/default.nix b/machines/Oracle-Cloud/default.nix index 2cbfae0..dddfab6 100644 --- a/machines/Oracle-Cloud/default.nix +++ b/machines/Oracle-Cloud/default.nix @@ -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"; } diff --git a/modules/devices.nix b/modules/devices.nix index 0ac0522..261b51d 100644 --- a/modules/devices.nix +++ b/modules/devices.nix @@ -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; diff --git a/profiles/network.nix b/profiles/network.nix index 46f046b..9cb3267 100644 --- a/profiles/network.nix +++ b/profiles/network.nix @@ -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; diff --git a/profiles/workspace/locale.nix b/profiles/workspace/locale.nix index 2c927b9..0e01af4 100644 --- a/profiles/workspace/locale.nix +++ b/profiles/workspace/locale.nix @@ -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; diff --git a/roles/server.nix b/roles/server.nix index 73c9a1c..5726c73 100644 --- a/roles/server.nix +++ b/roles/server.nix @@ -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 ]; }