From 3254a57c8f8a839d769bd22f59aac1fad7a760c2 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Wed, 9 May 2018 16:46:33 +0200 Subject: [PATCH] WIP: Site max --- configuration.nix | 1 + overlays/site-max.nix | 5 +++++ pkgs/site-max/default.nix | 30 ++++++++++++++++++++++++++++++ services.nix | 6 ++++++ 4 files changed, 42 insertions(+) create mode 100644 overlays/site-max.nix create mode 100644 pkgs/site-max/default.nix diff --git a/configuration.nix b/configuration.nix index 0a58215..866b718 100644 --- a/configuration.nix +++ b/configuration.nix @@ -41,6 +41,7 @@ (import ./overlays/lidarr.nix) (import ./overlays/organizr.nix) (import ./overlays/sudo.nix) + (import ./overlays/site-max.nix) ]; environment.systemPackages = with pkgs; [ neovim diff --git a/overlays/site-max.nix b/overlays/site-max.nix new file mode 100644 index 0000000..b52cea9 --- /dev/null +++ b/overlays/site-max.nix @@ -0,0 +1,5 @@ +self: super: + +{ + site-max = super.callPackage ../pkgs/site-max { }; +} diff --git a/pkgs/site-max/default.nix b/pkgs/site-max/default.nix new file mode 100644 index 0000000..bc2f7bc --- /dev/null +++ b/pkgs/site-max/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, sassc }: + +stdenv.mkDerivation rec { + name= "site-max-${version}"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "nyanloutre"; + repo = "site-max"; + rev = "d867dc88282802fda5616c0320456cab38e57d88"; + sha256 = "05q1jn0ak04kpcih51nxsy4phf15vg2xlsvp26lycncfygkq2vy0"; + }; + + buildPhase = '' + ${sassc}/bin/sassc -m auto -t compressed scss/creative.scss css/creative.css + ''; + + installPhase = '' + mkdir -p $out/ + cp -R . $out/ + ''; + + meta = { + description = "Site de présentation de Max Spiegel"; + homepage = https://maxspiegel.fr/; + maintainers = with stdenv.lib.maintainers; [ nyanloutre ]; + license = stdenv.lib.licenses.cc-by-nc-sa-40; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/services.nix b/services.nix index d6d5115..be66236 100644 --- a/services.nix +++ b/services.nix @@ -8,6 +8,7 @@ let riot_port = 52345; organizr_port = 52346; pgmanage_port = 52347; + max_port = 52348; in { @@ -34,6 +35,7 @@ in organizr = { ip = "127.0.0.1"; port = organizr_port; auth = true; }; calibre = { ip = "127.0.0.1"; port = 8080; auth = false; }; pgmanage = { ip = "127.0.0.1"; port = pgmanage_port; auth = true; }; + max = { ip = "127.0.0.1"; port = max_port; auth = false; }; }; services.mailserver.enable = true; @@ -131,6 +133,10 @@ in ''; }; }; + "max" = { + listen = [ { addr = "127.0.0.1"; port = max_port; } ]; + locations = { "/" = { root = pkgs.site-max; }; }; + }; }; services.phpfpm.poolConfigs.mypool = ''