From ac5d403860a6ec9786b7500210e6bdf3a403c338 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 26 Dec 2024 19:25:24 +0200 Subject: [PATCH] Trying basic nginx example --- nixos/configuration.nix | 9 ++------- nixos/nginx.nix | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 nixos/nginx.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 8e19748..8d405a9 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,14 +1,9 @@ -{ - modulesPath, - lib, - pkgs, - ... -}: -{ +{ modulesPath, lib, pkgs, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") ./disk-config.nix + ./nginx.nix ]; boot.loader.grub = { diff --git a/nixos/nginx.nix b/nixos/nginx.nix new file mode 100644 index 0000000..e5e176e --- /dev/null +++ b/nixos/nginx.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + services = { + getty.autologinUser = "root"; + nginx = { + enable = true; + virtualHosts.localhost.locations."/" = { + index = "index.html"; + root = pkgs.writeTextDir "index.html" '' + + + Hello, world! + + + ''; + }; + }; + }; +}