diff --git a/flake.nix b/flake.nix index f4f440f..75ecfa6 100644 --- a/flake.nix +++ b/flake.nix @@ -117,6 +117,21 @@ specialArgs = {inherit inputs;}; }; + oracle = nixpkgs.lib.nixosSystem { + system = utils.lib.system.x86_64-linux; + modules = [ + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.michael = import ./user/environments/nixos-server/home.nix; + } + + ./machines/oracle/configuration.nix + ]; + specialArgs = {inherit inputs;}; + }; + # WSL environment work = inputs.nixpkgs.lib.nixosSystem { system = utils.lib.system.x86_64-linux; diff --git a/machines/oracle/configuration.nix b/machines/oracle/configuration.nix new file mode 100644 index 0000000..a01056a --- /dev/null +++ b/machines/oracle/configuration.nix @@ -0,0 +1,58 @@ +{ pkgs, config, ... }: { + imports = [ + ./hardware-configuration.nix + ]; + + boot.tmp.cleanOnBoot = true; + zramSwap.enable = true; + + networking.hostName = "gringottsstatus"; + networking.domain = "subnet08161027.vcn08161027.oraclevcn.com"; + networking.firewall.enable = true; + + services.openssh.enable = true; + services.openssh.settings = { + PasswordAuthentication = false; + }; + + programs.zsh.enable = true; + + users.users.michael = { + isNormalUser = true; + home = "/home/michael"; + description = "Michael Thomas"; + extraGroups = [ "wheel" "networkmanager" ]; + shell = pkgs.zsh; + openssh.authorizedKeys.keys = [ + ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDUYHiTel+RDzygCeNwV25cnBBNioM19EQWqxPC+xq7lNlNcAQ4wi9JIOONVGkshxPXzKZyR3F53Igs9JZr1E9088L52eUp35JhW1pthai82cw1jGkj9wxcKJnU6b7QNDKA+ejPTC/ciFFKytMyPgID0ICzBRQsnj15i4lGvGDgfTQ7qfI2J855H7S7qOpY7cbsGfeoz3f8Ye1FspJFDsNu9QhX05iunBcbni0uLoTtgS5cEBRr7H9RkKR7GCfd4Ae/sp+aeDkLU4aBkEi+A8VLfR74Juia1j/3mAAmkgJKGcBCKUv0ixBGd6XclZmkF8f2Hx0z8mDxJ7U8lsDUSKdvxK7fecsM4F/GTvjrUxV1nLD4SRQ06GtBmGQGDzIn3Nm1URd6gGT9W3486XJsqmGzjuHa5o4WhmBgh/Gs8xUcv7kWD5enrYacBr+HKVJWnnLFp+XfAYaMCT6j/4jc4D9/9hijRbhboICTDxWCWtFgz7QpsO6BQpi/wkR4Ql61vPc= michael@neptune'' + + ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQr9lluvuGk3qU1bE7HrrZcE36x5hhD5Dat+E4My55aoh+Df/JeuWMPvzS4zLKMsIIZCUX6kbjvTtvWe7gPLflhDOUGI947MK9B01pojDn0LBugz57Ai9fPlG5+AlMWaxWitmP8JB637oxBpqesqxHdiEKW25u9t2qOvjX3kCdcoSYDlW72Xm8ZI9+qKcAlGLnFhiQxM18rjHcZYdn9ZyWRRSC1ocuTqnbh5lsYoMhD+4QWo5LmwMVjr5uix0i+ktqKzENaiDgA/MQIWQrHqUavfjvMRyyQO7bScVTe/PllKFpLOBym2SLC5hD7vG69BBo0dQUto8tAbIgI9Tmv1dx michael@venus'' + ]; + }; + + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 4*1024; + } + ]; + + # Services + services.caddy = { + enable = true; + }; + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + services.uptime-kuma = { + enable = true; + settings = { + port = "3001"; + }; + }; + + services.caddy.virtualHosts."status.gringotts.michaelt.xyz".extraConfig = '' + reverse_proxy http://localhost:${config.services.uptime-kuma.settings.PORT} + ''; + + system.stateVersion = "23.11"; +} diff --git a/machines/oracle/hardware-configuration.nix b/machines/oracle/hardware-configuration.nix new file mode 100644 index 0000000..25a81a4 --- /dev/null +++ b/machines/oracle/hardware-configuration.nix @@ -0,0 +1,14 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + fileSystems."/boot" = { device = "/dev/disk/by-uuid/97E5-76C2"; fsType = "vfat"; }; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/mapper/centosvolume-root"; fsType = "xfs"; }; + +} diff --git a/user/environments/nixos-server/config.nix b/user/environments/nixos-server/config.nix new file mode 100644 index 0000000..1dd1750 --- /dev/null +++ b/user/environments/nixos-server/config.nix @@ -0,0 +1,3 @@ +{ + allowUnfree = true; +} diff --git a/user/environments/nixos-server/home.nix b/user/environments/nixos-server/home.nix new file mode 100644 index 0000000..6da0340 --- /dev/null +++ b/user/environments/nixos-server/home.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + imports = [ + ../../modules/git.nix + ../../modules/zsh.nix + ]; + + home.packages = with pkgs; [ + neovim + ]; + + home.stateVersion = "21.05"; +}