From 611dd1e98ceaee81c0d2c8774f78568519cc942b Mon Sep 17 00:00:00 2001 From: tomoron Date: Thu, 31 Oct 2024 21:06:11 +0100 Subject: [PATCH] add server config for os and home --- flake.nix | 21 ++++++++++++++++++++- homes/server/home.nix | 4 ++++ hosts/server.nix | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 homes/server/home.nix create mode 100644 hosts/server.nix diff --git a/flake.nix b/flake.nix index bdc2aaf..3a5c5c8 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ # By: tomoron +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2024/10/17 18:15:24 by tomoron #+# #+# # -# Updated: 2024/10/19 18:54:48 by tomoron ### ########.fr # +# Updated: 2024/10/31 20:22:15 by tomoron ### ########.fr # # # # **************************************************************************** # @@ -40,6 +40,13 @@ modules = [ ./configuration.nix ]; + }; + server = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs; flakeName="server";}; + modules = [ + ./configuration.nix + ./hosts/server.nix + ]; }; vbox = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;flakeName="vbox";}; @@ -114,6 +121,18 @@ ./home.nix ./homes/desktop/home.nix ]; + }; + server = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + username = "${username}"; + homeDir = "${homeDir}"; + inherit inputs; + }; + modules = [ + ./home.nix + ./homes/server/home.nix + ]; }; }; }; diff --git a/homes/server/home.nix b/homes/server/home.nix new file mode 100644 index 0000000..a8a721d --- /dev/null +++ b/homes/server/home.nix @@ -0,0 +1,4 @@ +{ config, lib, pkgs, ... }: + +{ +} diff --git a/hosts/server.nix b/hosts/server.nix new file mode 100644 index 0000000..ed56368 --- /dev/null +++ b/hosts/server.nix @@ -0,0 +1,23 @@ + +{ config, lib, inputs, pkgs, ... }: + +{ + imports = [ + modules/vboxHost.nix + ]; + + networking.hostName = "server"; + services.openssh.enable = true; + + networking.firewall.allowedTCPPorts = [80 443 5000]; + networking.firewall.allowedUDPPorts = [80 443 5000]; + + networking = { + interfaces.eth0.ipv4.addresses = [ { + address = "192.168.1.24"; + prefixLength = 24; + } ]; + defaultGateway = "192.168.1.254"; + nameservers = ["8.8.8.8" "8.8.4.4" "1.1.1.1"]; + }; +}