From 5bdbfb3a5ff321641f0e5bd9fca8cdb74b51e94f Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:09:20 +0200 Subject: [PATCH] Update --- docs/TODO.md | 1 - home/laptop.nix | 1 + hosts/laptop/variables.nix | 1 + hosts/modules/server/www/default.nix | 10 ++--- .../www/home.anotherhadi.com/default.nix | 1 + hosts/modules/server/www/homepage.nix | 39 ++++++++++--------- 6 files changed, 29 insertions(+), 24 deletions(-) diff --git a/docs/TODO.md b/docs/TODO.md index fc3f4ec..00c3e4d 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -27,4 +27,3 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) - [ ] server fetch - [ ] Remote push - [ ] Ntfy auth file -- [ ] Uptime kuma or alt diff --git a/home/laptop.nix b/home/laptop.nix index 1f4ac61..0baf448 100644 --- a/home/laptop.nix +++ b/home/laptop.nix @@ -50,6 +50,7 @@ jq git-ignore node2nix + nurl # Utils fd diff --git a/hosts/laptop/variables.nix b/hosts/laptop/variables.nix index 30bd44e..e55fad5 100644 --- a/hosts/laptop/variables.nix +++ b/hosts/laptop/variables.nix @@ -26,6 +26,7 @@ sops = true; # change the nvim's obsidian configuration if you want to enable that: obsidian = true; + tailscale = true; theme = import ../themes/nixy.nix; # select your theme here }; diff --git a/hosts/modules/server/www/default.nix b/hosts/modules/server/www/default.nix index b3523f7..d64bae7 100644 --- a/hosts/modules/server/www/default.nix +++ b/hosts/modules/server/www/default.nix @@ -1,16 +1,16 @@ { - imports = [ ./home.anotherhadi.com ]; + imports = [ ./home.anotherhadi.com ./homepage.nix ]; services.nginx.virtualHosts = { "anotherhadi.com" = { serverAliases = [ "www.anotherhadi.com" ]; root = "/etc/www/anotherhadi.com"; }; - "home.anotherhadi.com" = { - serverAliases = [ "jack.anotherhadi.com" ]; - root = "/etc/www/home.anotherhadi.com"; - }; + # "home.anotherhadi.com" = { + # serverAliases = [ "jack.anotherhadi.com" ]; + # root = "/etc/www/home.anotherhadi.com"; + # }; "test.anotherhadi.com" = { root = "/var/www/test"; }; }; environment.etc."www/anotherhadi.com" = { source = ./anotherhadi.com; }; diff --git a/hosts/modules/server/www/home.anotherhadi.com/default.nix b/hosts/modules/server/www/home.anotherhadi.com/default.nix index 951a3a4..491f362 100644 --- a/hosts/modules/server/www/home.anotherhadi.com/default.nix +++ b/hosts/modules/server/www/home.anotherhadi.com/default.nix @@ -4,6 +4,7 @@ let Home: [ {text: "Nextcloud", url: "https://cloud.anotherhadi.com", icon: "󰅟"}, {text: "Vaultwarden", url: "https://vault.anotherhadi.com", icon: ""}, + {text: "Uptime Kuma", url: "https://kuma.anotherhadi.com", icon: "󱎫"}, ], Admin: [ {text: "Adguard Home", url: "http://192.168.2.24:3001", icon: "󰷱"}, diff --git a/hosts/modules/server/www/homepage.nix b/hosts/modules/server/www/homepage.nix index 1f0ac74..410dc4f 100644 --- a/hosts/modules/server/www/homepage.nix +++ b/hosts/modules/server/www/homepage.nix @@ -1,25 +1,28 @@ -{ lib, buildNpmPackage, fetchFromGitHub }: +{ pkgs, ... }: { + nginx.virtualHosts."home.anotherhadi.com" = { + enableACME = true; + root = pkgs.stdenv.mkDerivation { + name = "homepage"; -buildNpmPackage rec { - pname = "homepage"; - version = "0.0.0"; + src = pkgs.fetchFromGitHub { + owner = "anotherhadi"; + repo = "homepage"; + rev = "6588787368cbc403cdec08fd25ef27b42077b8d3"; + hash = "sha256-Z2TZ56I6lRmYkLRnnMscvmSCzGt5q9yX90lGPebJpe8="; + }; - src = fetchFromGitHub { - owner = "anotherhadi"; - repo = pname; - rev = "v${version}"; - hash = "sha256-BR+ZGkBBfd0dSQqAvujsbgsEPFYw/ThrylxUbOksYxM="; - }; + buildInputs = with pkgs; [ nodejs ]; - npmDepsHash = "sha256-tuEfyePwlOy2/mOPdXbqJskO6IowvAP4DWg8xSZwbJw="; + buildPhase = '' + npm install + npm run build + ''; - # The prepack script runs the build script, which we'd rather do in the build phase. - npmPackFlags = [ "--ignore-scripts" ]; + installPhase = '' + mkdir -p $out + cp -r build/* $out + ''; - meta = { - description = "A simple homepage for your server."; - homepage = "https://github.com/anotherhadi/homepage"; - # license = lib.licenses.gpl3Only; - # maintainers = with lib.maintainers; [ winter ]; + }; }; }