From 0d0d372f17ef3b9f5aeae760d6025a0190f1cdbf Mon Sep 17 00:00:00 2001 From: jeirmeister Date: Tue, 15 Oct 2024 16:53:39 -0700 Subject: [PATCH] Add configuration.nix --- configuration.nix | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 configuration.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..df26d69 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,64 @@ +{ modulesPath, config, pkgs, ... }: + +{ + imports = + [ + # Default path for lxc/lxd configuration + "${modulesPath}/virtualisation/lxc-container.nix" + ]; + boot.isContainer = true; + + systemd.suppressedSystemUnits = [ + "dev-mqueue.mount" + "sys-kernel-debug.mount" + "sys-fs-fuse-connections.mount" + ]; + + # Essential packages + environment.systemPackages = with pkgs; [ + openssh + binutils + man + git + ]; + + # Administrative sudo user + users.users.admin = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # wheel group is sudo access + }; + + security.sudo.wheelNeedsPassword = true; + + # Facilitates access via VS Code Remote Explorer + programs.nix-ld.enable = true; + + # Enable password-based SSH login for admin user + services.openssh = { + enable = true; + settings = { + AllowUsers = ["admin"]; # everyone + PasswordAuthentication = true; # this is just a sandbox + PermitRootLogin = "yes"; + }; + }; + + networking = { + dhcpcd.enable = false; + useDHCP = false; + useHostResolvConf = false; + }; + + systemd.network = { + enable = true; + networks."50-eth0" = { + matchConfig.Name = "eth0"; + networkConfig = { + DHCP = "ipv4"; + IPv6AcceptRA = true; + }; + linkConfig.RequiredForOnline = "routable"; + }; + }; + system.stateVersion = "24.11"; # Did you read the comment? +} \ No newline at end of file