Added homepage

This commit is contained in:
Julien Malka 2021-12-04 16:11:23 +01:00
parent 18b7795c15
commit 44d81ecca3
6 changed files with 104 additions and 162 deletions

View file

@ -37,6 +37,7 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
luj.mediaserver.enable = true;
luj.homepage.enable = true;
networking.hostName = "lisa"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

View file

@ -1,121 +0,0 @@
{ config, pkgs, ... }:
{
services.jellyfin = {
enable = true;
group = "tv";
package = pkgs.jellyfin;
};
services.sonarr = {
enable = true;
openFirewall = true;
group = "tv";
};
services.radarr = {
enable = true;
openFirewall = true;
group = "tv";
};
services.transmission = {
enable = true;
group = "tv";
downloadDirPermissions = "774";
settings = {
rpc-port = 9091;
download-dir = "/home/transmission/Downloads/";
incomplete-dir = "/home/transmission/Incomplete/";
incomplete-dir-enable = true;
};
};
services.jackett = {
enable = true;
openFirewall = true;
};
services.nginx = {
enable = true;
virtualHosts."julienmalka.me" = {
enableACME = true;
forceSSL = true;
root = "/var/www/julienmalka.me";
default = true;
};
virtualHosts."www.julienmalka.me" = {
enableACME = true;
forceSSL = true;
root = "/var/www/julienmalka.me";
};
virtualHosts."tv.julienmalka.me" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8096";
};
};
virtualHosts."series.julienmalka.me" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8989";
};
};
virtualHosts."downloads.julienmalka.me" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:9091";
};
};
virtualHosts."jackett.julienmalka.me" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:9117";
};
};
virtualHosts."films.julienmalka.me" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:7878";
};
};
};
security.acme.certs = {
"www.julienmalka.me".email = "julien.malka@me.com";
"julienmalka.me".email = "julien.malka@me.com";
"tv.julienmalka.me".email = "julien.malka@me.com";
"series.julienmalka.me".email = "julien.malka@me.com";
"downloads.julienmalka.me".email = "julien.malka@me.com";
"jackett.julienmalka.me".email = "julien.malka@me.com";
"films.julienmalka.me".email = "julien.malka@me.com";
};
security.acme.acceptTerms = true;
}

23
flake.lock generated
View file

@ -51,6 +51,22 @@
"type": "github"
}
},
"homepage": {
"flake": false,
"locked": {
"lastModified": 1638627658,
"narHash": "sha256-1mGBNxJqzvbQG4HcHfRLVn5sx+nTx5g/DzeihloGbr8=",
"owner": "JulienMalka",
"repo": "homepage",
"rev": "20d331990ad8c889ef6817ad4f84638947880ac4",
"type": "github"
},
"original": {
"owner": "JulienMalka",
"repo": "homepage",
"type": "github"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils",
@ -142,11 +158,11 @@
},
"nur": {
"locked": {
"lastModified": 1638622311,
"narHash": "sha256-Jcn+xvme8X57vmB1THosjYHMhUqMmKiQeLbAI9rtuEA=",
"lastModified": 1638628541,
"narHash": "sha256-3xNNiD+UKdI0zMqo6FAP0/53nm6Q/GPwRITPJkYYUvg=",
"owner": "nix-community",
"repo": "NUR",
"rev": "3d283655b37acadb5485768bfb89d68e5263458e",
"rev": "8f0ed744fa090ccc90feea252ea0290d80c9a0d9",
"type": "github"
},
"original": {
@ -157,6 +173,7 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"homepage": "homepage",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_3",
"nur": "nur"

View file

@ -1,43 +1,57 @@
{
description = "A flake for my personnal configurations";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
description = "A flake for my personnal configurations";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
};
homepage = {
url = "github:JulienMalka/homepage";
flake = false;
};
};
outputs = inputs@{ self, home-manager, nixpkgs, neovim-nightly-overlay, nur, ... }:
{
nixosModules = builtins.listToAttrs (map
(x: {
name = x;
value = import (./modules + "/${x}");
})
(builtins.attrNames (builtins.readDir ./modules)));
nixosConfigurations = {
lisa = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
};
system = "x86_64-linux";
modules = builtins.attrValues self.nixosModules ++ [
./configuration.nix
./config/hosts/lisa.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.julien = import ./config/home/home-lisa.nix;
nixpkgs.overlays = [
inputs.neovim-nightly-overlay.overlay
];
}
];
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
};
};
outputs = { self, home-manager, nixpkgs, neovim-nightly-overlay, nur, ... }@inputs :
{
nixosModules = builtins.listToAttrs (map (x: {
name = x;
value = import (./modules + "/${x}");
}) (builtins.attrNames (builtins.readDir ./modules)));
nixosConfigurations = {
lisa = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = builtins.attrValues self.nixosModules ++ [./configuration.nix ./config/hosts/lisa.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.julien = import ./config/home/home-lisa.nix;
nixpkgs.overlays = [
inputs.neovim-nightly-overlay.overlay
];
}];
};
};
};
};
};

View file

@ -71,7 +71,7 @@ in
luj.nginx.enable = true;
virtualHosts."cloud.julienmalka.me" = {
services.nginx.virtualHosts."cloud.julienmalka.me" = {
forceSSL = true;
enableACME = true;
locations."/" = {
@ -88,4 +88,6 @@ in
}
};
}

View file

@ -0,0 +1,29 @@
{ lib, pkgs, inputs, config, ... }:
with lib;
let
cfg = config.luj.homepage;
in
{
options.luj.homepage = {
enable = mkEnableOption "enable homepage";
};
config = mkIf cfg.enable
{
luj.nginx.enable = true;
services.nginx.virtualHosts."julienmalka.me" = {
enableACME = true;
forceSSL = true;
root = inputs.homepage;
default = true;
};
services.nginx.virtualHosts."www.julienmalka.me" = {
enableACME = true;
forceSSL = true;
root = inputs.homepage;
};
};
}