From 043e34ff3d5413b6526550eabc028449314133ba Mon Sep 17 00:00:00 2001 From: Leon Vatthauer Date: Sat, 6 Apr 2024 16:44:54 +0200 Subject: [PATCH 1/3] Add resumee-website --- .gitmodules | 3 +++ willem/services/nginx.nix | 5 +++++ willem/services/resumee-website | 1 + willem/services/resumee-website.nix | 11 +++++++++++ 4 files changed, 20 insertions(+) create mode 160000 willem/services/resumee-website create mode 100644 willem/services/resumee-website.nix diff --git a/.gitmodules b/.gitmodules index 3570931..b8102d7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "nix-secrets"] path = nix-secrets url = gitea@git.vatthauer.xyz:leonv/nix-secrets.git +[submodule "willem/services/resumee-website"] + path = willem/services/resumee-website + url = forgejo@git.vatthauer.xyz:leonv/resumee-website.git diff --git a/willem/services/nginx.nix b/willem/services/nginx.nix index 96aebac..4abb968 100644 --- a/willem/services/nginx.nix +++ b/willem/services/nginx.nix @@ -30,4 +30,9 @@ proxyPass = "http://localhost:8096"; }; }; + services.nginx.virtualHosts."blog.korfuri.fr" = { + forceSSL = true; + enableACME = true; + root = callPackage ./resumee-website.nix {}; + }; } diff --git a/willem/services/resumee-website b/willem/services/resumee-website new file mode 160000 index 0000000..da26393 --- /dev/null +++ b/willem/services/resumee-website @@ -0,0 +1 @@ +Subproject commit da26393e34ba9178a5b55737f7616aa8be25b5b3 diff --git a/willem/services/resumee-website.nix b/willem/services/resumee-website.nix new file mode 100644 index 0000000..344a756 --- /dev/null +++ b/willem/services/resumee-website.nix @@ -0,0 +1,11 @@ +{ stdenv, hugo }: +stdenv.mkDerivation { + name = "resumee-website"; + src = ./resumee-website; + nativeBuildInputs = [ hugo ]; + phases = [ "unpackPhase" "buildPhase" ]; + buildPhase = '' + hugo -s . -d "$out" + ''; +} + From f2a77125b7ef6384b7f17d63c6c94125373669f9 Mon Sep 17 00:00:00 2001 From: "leonv@willem" Date: Sat, 6 Apr 2024 19:49:07 +0200 Subject: [PATCH 2/3] Add website as submodule --- .gitmodules | 2 +- flake.lock | 24 ++++++++++++------------ flake.nix | 3 ++- willem/configuration.nix | 6 ++++-- willem/services/acme.nix | 1 + willem/services/default.nix | 1 + willem/services/nginx.nix | 5 +++-- willem/services/resumee-website | 1 - willem/services/resumee-website.nix | 19 ++++++++++++------- 9 files changed, 36 insertions(+), 26 deletions(-) delete mode 160000 willem/services/resumee-website diff --git a/.gitmodules b/.gitmodules index b8102d7..eedf244 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "nix-secrets"] path = nix-secrets - url = gitea@git.vatthauer.xyz:leonv/nix-secrets.git + url = forgejo@git.vatthauer.xyz:leonv/nix-secrets.git [submodule "willem/services/resumee-website"] path = willem/services/resumee-website url = forgejo@git.vatthauer.xyz:leonv/resumee-website.git diff --git a/flake.lock b/flake.lock index 6101d78..514588c 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ "cask-fonts": { "flake": false, "locked": { - "lastModified": 1712340494, - "narHash": "sha256-Xq3YY66+LUxodhTnbALN6AmMnoVUEzBDiHV5NKMfQwA=", + "lastModified": 1712395066, + "narHash": "sha256-UKzc0lFCMYMakD0pPqmfyVMGY3Ibjx/IxCdbcntKCPI=", "owner": "homebrew", "repo": "homebrew-cask-fonts", - "rev": "273b8c4573487b4c43ad4997dc9806cc8223b37c", + "rev": "b84143d3f249d4e9475ad3a7766f81a64e892724", "type": "github" }, "original": { @@ -128,11 +128,11 @@ ] }, "locked": { - "lastModified": 1712317700, - "narHash": "sha256-rnkQ6qMhlxfjpCECkTMlFXHU/88QvC5KpdJWq5H6F1E=", + "lastModified": 1712390667, + "narHash": "sha256-ebq+fJZfobqpsAdGDGpxNWSySbQejRwW9cdiil6krCo=", "owner": "nix-community", "repo": "home-manager", - "rev": "782eed8bb64b27acaeb7c17be4a095c85e65717f", + "rev": "b787726a8413e11b074cde42704b4af32d95545c", "type": "github" }, "original": { @@ -144,11 +144,11 @@ "homebrew-cask": { "flake": false, "locked": { - "lastModified": 1712374513, - "narHash": "sha256-hrvNE6P0CZ+Mqx3kui6ceiCaKc0ZvtEyHp2VjlTMeAM=", + "lastModified": 1712421408, + "narHash": "sha256-r9DUBMQ+00DrbzAf6ASgsPjt/IOX/EVhyFzml7v9kdU=", "owner": "homebrew", "repo": "homebrew-cask", - "rev": "dac61755c09ea59ca4c1f4872dd5bcbc737fcd36", + "rev": "0e98f655a97c1ca602f226dc4475c5c0046fb9fa", "type": "github" }, "original": { @@ -160,11 +160,11 @@ "homebrew-core": { "flake": false, "locked": { - "lastModified": 1712377794, - "narHash": "sha256-dQZMd6oYS4axXZglPHexD+wFUe69XIIGPZ2saB3GAdQ=", + "lastModified": 1712416518, + "narHash": "sha256-0JscAhnrgVYNmq+xcP5lP4ci2/6sfKZr07L05oOhB5g=", "owner": "homebrew", "repo": "homebrew-core", - "rev": "5414997e0a30b72ad44d9fb4257e71a95a5f3dc9", + "rev": "39dc7ab8487832cef395e96fceb32000a956aa8a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a576014..2991826 100644 --- a/flake.nix +++ b/flake.nix @@ -54,7 +54,8 @@ }; willem = unstable.lib.nixosSystem { system = "aarch64-linux"; - modules = [ ./willem/configuration.nix ]; + specialArgs = { inherit inputs; }; + modules = [ ./willem/configuration.nix ]; }; }; darwinConfigurations = { diff --git a/willem/configuration.nix b/willem/configuration.nix index c89e381..88bfb81 100644 --- a/willem/configuration.nix +++ b/willem/configuration.nix @@ -2,8 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running 'nixos-help'). -{ config, pkgs, lib, ... }: - +{ config, pkgs, lib, inputs, ... }: { imports = [ @@ -45,6 +44,9 @@ zsh oh-my-zsh restic + # for hugo website + hugo + go ]; environment.variables = { EDITOR = "nvim"; diff --git a/willem/services/acme.nix b/willem/services/acme.nix index 955c5f4..597e1f6 100644 --- a/willem/services/acme.nix +++ b/willem/services/acme.nix @@ -4,5 +4,6 @@ "git.vatthauer.xyz".email = "leonvatthauer@outlook.com"; "bitwarden.vatthauer.xyz".email = "leonvatthauer@outlook.com"; "video.vatthauer.xyz".email = "leonvatthauer@outlook.com"; + "vatthauer.xyz".email = "leonvatthauer@outlook.com"; }; } diff --git a/willem/services/default.nix b/willem/services/default.nix index 0d27feb..d8f83e4 100644 --- a/willem/services/default.nix +++ b/willem/services/default.nix @@ -1,3 +1,4 @@ +{ lib, pkgs, inputs, ... }: { imports = [ ./acme.nix diff --git a/willem/services/nginx.nix b/willem/services/nginx.nix index 4abb968..2329123 100644 --- a/willem/services/nginx.nix +++ b/willem/services/nginx.nix @@ -1,3 +1,4 @@ +{ lib, pkgs, inputs, ... }: { services.nginx = { enable = true; @@ -30,9 +31,9 @@ proxyPass = "http://localhost:8096"; }; }; - services.nginx.virtualHosts."blog.korfuri.fr" = { + services.nginx.virtualHosts."vatthauer.xyz" = { forceSSL = true; enableACME = true; - root = callPackage ./resumee-website.nix {}; + root = pkgs.callPackage ./resumee-website.nix {}; }; } diff --git a/willem/services/resumee-website b/willem/services/resumee-website deleted file mode 160000 index da26393..0000000 --- a/willem/services/resumee-website +++ /dev/null @@ -1 +0,0 @@ -Subproject commit da26393e34ba9178a5b55737f7616aa8be25b5b3 diff --git a/willem/services/resumee-website.nix b/willem/services/resumee-website.nix index 344a756..d2797af 100644 --- a/willem/services/resumee-website.nix +++ b/willem/services/resumee-website.nix @@ -1,11 +1,16 @@ -{ stdenv, hugo }: +{ stdenv, fetchgit, git, go, hugo }: stdenv.mkDerivation { name = "resumee-website"; - src = ./resumee-website; - nativeBuildInputs = [ hugo ]; - phases = [ "unpackPhase" "buildPhase" ]; - buildPhase = '' - hugo -s . -d "$out" - ''; + version = "1.0"; + src = fetchgit { + url = "https://git.vatthauer.xyz/leonv/resumee-website.git"; + hash = "sha256-WCqkNpUWNGMW3YkrJf64FKZDgebdeOzite9XR9IHifg="; + }; + nativeBuildInputs = [ git go hugo ]; + buildPhase = "hugo -d $out"; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "sha256-d0I7CJLNea9QCGvrKh+LAXsrR+olj8OFmhRgSHZGPU0="; + } From 7a1ae0d0d7a8f1367fb145cb45596f94fc6677b8 Mon Sep 17 00:00:00 2001 From: "leonv@willem" Date: Sat, 6 Apr 2024 20:08:38 +0200 Subject: [PATCH 3/3] Website working. --- willem/services/resumee-website.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/willem/services/resumee-website.nix b/willem/services/resumee-website.nix index d2797af..a71ce55 100644 --- a/willem/services/resumee-website.nix +++ b/willem/services/resumee-website.nix @@ -1,16 +1,16 @@ -{ stdenv, fetchgit, git, go, hugo }: +{ stdenv, git, go, hugo }: stdenv.mkDerivation { name = "resumee-website"; version = "1.0"; - src = fetchgit { + src = builtins.fetchGit { url = "https://git.vatthauer.xyz/leonv/resumee-website.git"; - hash = "sha256-WCqkNpUWNGMW3YkrJf64FKZDgebdeOzite9XR9IHifg="; + rev = "9516643a88018050676dd1f57f5cc7e245e55591"; }; nativeBuildInputs = [ git go hugo ]; buildPhase = "hugo -d $out"; outputHashAlgo = "sha256"; outputHashMode = "recursive"; - outputHash = "sha256-d0I7CJLNea9QCGvrKh+LAXsrR+olj8OFmhRgSHZGPU0="; + outputHash = "sha256-icJv4zvaioxj9Ego0rDIFSm1PXRhAMsxmtYJj0H0+8Y="; }