init
This commit is contained in:
commit
dc5069e9b2
7 changed files with 323 additions and 0 deletions
71
configuration.nix
Normal file
71
configuration.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
indexHtml = pkgs.writeText "index.html" ''
|
||||
hello mofo
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./microvm.nix
|
||||
./vm-variant.nix
|
||||
];
|
||||
networking = {
|
||||
firewall.enable = false;
|
||||
useDHCP = lib.mkForce true;
|
||||
hostName = "demo";
|
||||
};
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
workstation = true;
|
||||
};
|
||||
};
|
||||
# boot = {
|
||||
# # loader.grub.device = "nodev";
|
||||
# kernelParams = [ "console=ttyS0" ];
|
||||
# };
|
||||
|
||||
users.users = {
|
||||
root = {
|
||||
password = "";
|
||||
};
|
||||
};
|
||||
|
||||
# Optional: Make sure DNS is configured
|
||||
networking = {
|
||||
nameservers = [
|
||||
"9.9.9.9"
|
||||
];
|
||||
# Enable networking
|
||||
# networkmanager.enable = true;
|
||||
};
|
||||
nix = {
|
||||
settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."localhost" = {
|
||||
root = "${pkgs.runCommand "nginx-root" { } ''
|
||||
mkdir -p $out
|
||||
cp ${indexHtml} $out/index.html
|
||||
''}";
|
||||
locations."/" = {
|
||||
index = "index.html";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# users.mutableUsers = false;
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue