diff --git a/.editorconfig b/.editorconfig index 3853bb8..ce16426 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,6 @@ root=true [*] -indent_style: tab +indent_style: space indent_size: 2 +end_of_line: lf diff --git a/flake.lock b/flake.lock index b16a4d9..826ad49 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1706581965, - "narHash": "sha256-1H7dRdK9LJ7+2X1XQtbwXr+QMqtVVo/ZF0/LIvkjdK8=", + "lastModified": 1711763326, + "narHash": "sha256-sXcesZWKXFlEQ8oyGHnfk4xc9f2Ip0X/+YZOq3sKviI=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "91b9daf672c957ef95a05491a75f62e6a01d5aaf", + "rev": "36524adc31566655f2f4d55ad6b875fb5c1a4083", "type": "github" }, "original": { @@ -24,11 +24,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -58,11 +58,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -132,11 +132,11 @@ ] }, "locked": { - "lastModified": 1705659542, - "narHash": "sha256-WA3xVfAk1AYmFdwghT7mt/erYpsU6JPu9mdTEP/e9HQ=", + "lastModified": 1712386041, + "narHash": "sha256-dA82pOMQNnCJMAsPG7AXG35VmCSMZsJHTFlTHizpKWQ=", "owner": "rycee", "repo": "home-manager", - "rev": "10cd9c53115061aa6a0a90aad0b0dde6a999cdb9", + "rev": "d6bb9f934f2870e5cbc5b94c79e9db22246141ff", "type": "github" }, "original": { @@ -153,11 +153,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1706663720, - "narHash": "sha256-nPstfigc9FdWIwbtZcwfAjEP5fsI171CDMQ7rJdg0ok=", + "lastModified": 1712798884, + "narHash": "sha256-Q1qzg/UTsCdRx4g4rlweDL2yBQFnevsXTr74ONGoGm4=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "129d9ddaf92f8a0942037aebf99dfa09d31e0dde", + "rev": "df5f35ed20d9f4fd64429c8e8c0bde079702f767", "type": "github" }, "original": { @@ -175,11 +175,11 @@ ] }, "locked": { - "lastModified": 1706608109, - "narHash": "sha256-Yc7pmonKJX/dOFm+qEInE+JlskMiN9OmOwUd/EKp4a0=", + "lastModified": 1710519878, + "narHash": "sha256-0dbc10OBFUVYyXC+C+N6vRUd8xyBSRxkcZ4Egipbx0M=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "0b52d9e7a6c779f8b88c6e3bdfe6064fad648dcf", + "rev": "aef95bdb6800a3a2af7aa7083d6df03067da6592", "type": "github" }, "original": { @@ -190,27 +190,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1684570954, - "narHash": "sha256-FX5y4Sm87RWwfu9PI71XFvuRpZLowh00FQpIJ1WfXqE=", + "lastModified": 1712222121, + "narHash": "sha256-8f3glF4uwsPlDvaKDRgXD9xGe4YoCH4jA8ICxy/NbCo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3", + "rev": "23ff7d9dc4f3d553939e7bfe0d2667198f993536", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1706515015, - "narHash": "sha256-eFfY5A7wlYy3jD/75lx6IJRueg4noE+jowl0a8lIlVo=", + "lastModified": 1712741485, + "narHash": "sha256-bCs0+MSTra80oXAsnM6Oq62WsirOIaijQ/BbUY59tR4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f4a8d6d5324c327dcc2d863eb7f3cc06ad630df4", + "rev": "b2cf36f43f9ef2ded5711b30b1f393ac423d8f72", "type": "github" }, "original": { @@ -237,11 +237,11 @@ }, "nur": { "locked": { - "lastModified": 1706665018, - "narHash": "sha256-NtvxIQhRxavrL7PQ1ZURqWr15XM1Dc98yv4U5gTbJhk=", + "lastModified": 1712871065, + "narHash": "sha256-DzEwVypkf1+GeTrMJu2aPshDOq0QzP8LpewiFg83h8A=", "owner": "nix-community", "repo": "NUR", - "rev": "98930fb5cf79e652111ed531e6ce777618b1c898", + "rev": "75f6c9334e9402f47d570172f57c78ea87792c13", "type": "github" }, "original": { @@ -270,11 +270,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1706634984, - "narHash": "sha256-xn7lGPE8gRGBe3Lt8ESoN/uUHm7IrbiV7siupwjHX1o=", + "lastModified": 1712801594, + "narHash": "sha256-KZJnVw3TdfDyUhvClzgy3IEoC9tRhvG0yM+lHfqAm34=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "883b84c426107a8ec020e7124f263d7c35a5bb9f", + "rev": "35ebec41fcdeeae8e012e7d62ba153a13645227f", "type": "github" }, "original": { @@ -360,11 +360,11 @@ }, "unstable": { "locked": { - "lastModified": 1706371002, - "narHash": "sha256-dwuorKimqSYgyu8Cw6ncKhyQjUDOyuXoxDTVmAXq88s=", + "lastModified": 1712608508, + "narHash": "sha256-vMZ5603yU0wxgyQeHJryOI+O61yrX2AHwY6LOFyV1gM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c002c6aa977ad22c60398daaa9be52f2203d0006", + "rev": "4cba8b53da471aea2ab2b0c1f30a81e7c451f4b6", "type": "github" }, "original": { @@ -378,11 +378,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -399,11 +399,11 @@ ] }, "locked": { - "lastModified": 1684517665, - "narHash": "sha256-SaAr66uCQ8CF75jIr23FZjk1+9Kfwm5sQnwV25206Gs=", + "lastModified": 1709622318, + "narHash": "sha256-bTscF0366xtoIXgH7Zq+Mn0mpX3w4h/2xKpHiYMyLNc=", "owner": "nix-community", "repo": "nixos-vscode-server", - "rev": "1e1358493df6529d4c7bc4cc3066f76fd16d4ae6", + "rev": "d0ed9b8cf1f0a71f110df9119489ab047e0726bd", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 012ce3e..cc8e2b9 100644 --- a/flake.nix +++ b/flake.nix @@ -129,6 +129,22 @@ specialArgs = {inherit inputs;}; }; + oracle = nixpkgs.lib.nixosSystem { + system = utils.lib.system.x86_64-linux; + modules = [ + home-manager.nixosModules.home-manager + ./modules/nix.nix + { + 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..8239aeb --- /dev/null +++ b/user/environments/nixos-server/home.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: { + imports = [ + ../../modules/git.nix + ../../modules/zsh.nix + ]; + + home.packages = with pkgs; [ + neovim + lazygit + ]; + + home.stateVersion = "21.05"; +}