diff --git a/flake.nix b/flake.nix index aafc279..2cbf154 100644 --- a/flake.nix +++ b/flake.nix @@ -218,6 +218,15 @@ ./hosts/pn02 ]; }; + nrec-nixos01 = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs self; + }; + modules = commonModules ++ [ + ./hosts/nrec-nixos01 + ]; + }; openstack-template = nixpkgs.lib.nixosSystem { inherit system; specialArgs = { diff --git a/hosts/nrec-nixos01/configuration.nix b/hosts/nrec-nixos01/configuration.nix new file mode 100644 index 0000000..91ec2a0 --- /dev/null +++ b/hosts/nrec-nixos01/configuration.nix @@ -0,0 +1,76 @@ +{ + lib, + pkgs, + ... +}: + +{ + services.openssh = { + enable = true; + settings = { + PermitRootLogin = lib.mkForce "no"; + PasswordAuthentication = false; + }; + }; + + users.users.nixos = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + shell = pkgs.zsh; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwfb2jpKrBnCw28aevnH8HbE5YbcMXpdaVv2KmueDu6 torjus@gunter" + ]; + }; + security.sudo.wheelNeedsPassword = false; + programs.zsh.enable = true; + + homelab.dns.enable = false; + homelab.monitoring.enable = false; + homelab.host.labels.ansible = "false"; + + fileSystems."/" = { + device = lib.mkDefault "/dev/vda1"; + fsType = lib.mkDefault "ext4"; + }; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + networking.hostName = "nrec-nixos01"; + networking.useNetworkd = true; + networking.useDHCP = false; + services.resolved.enable = true; + + systemd.network.enable = true; + systemd.network.networks."ens3" = { + matchConfig.Name = "ens3"; + networkConfig.DHCP = "ipv4"; + linkConfig.RequiredForOnline = "routable"; + }; + time.timeZone = "Europe/Oslo"; + + networking.firewall.enable = true; + networking.firewall.allowedTCPPorts = [ + 22 + 80 + ]; + + nix.settings.substituters = [ + "https://cache.nixos.org" + ]; + nix.settings.trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + + services.caddy = { + enable = true; + virtualHosts.":80" = { + extraConfig = '' + respond "Hello from nrec-nixos01" + ''; + }; + }; + + zramSwap.enable = true; + + system.stateVersion = "25.11"; +} diff --git a/hosts/nrec-nixos01/default.nix b/hosts/nrec-nixos01/default.nix new file mode 100644 index 0000000..0047439 --- /dev/null +++ b/hosts/nrec-nixos01/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./configuration.nix + ../../system/packages.nix + ]; +}