mirror of
https://codeberg.org/muon/home.git
synced 2026-03-08 03:25:16 +00:00
Add embedded syntax hl
This commit is contained in:
parent
5bdf9e3a2c
commit
fc14a394aa
5 changed files with 284 additions and 250 deletions
|
|
@ -25,7 +25,7 @@ sudo cp {/mnt,/mnt/persist}/etc/machine-id
|
|||
## Erasure
|
||||
|
||||
```nix
|
||||
boot.initrd.postResumeCommands = lib.mkAfter ''
|
||||
boot.initrd.postResumeCommands = lib.mkAfter /* bash */ ''
|
||||
mkdir /btrfs_tmp
|
||||
mount /dev/mapper/crypted /btrfs_tmp
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@
|
|||
|
||||
programs.nyxt = {
|
||||
enable = false;
|
||||
config = ''
|
||||
config =
|
||||
# lisp
|
||||
''
|
||||
(in-package #:nyxt-user)
|
||||
|
||||
(defvar *my-search-engines*
|
||||
|
|
@ -73,7 +75,9 @@
|
|||
hm = "https://home-manager-options.extranix.com/?release=master&query={}";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
extraConfig =
|
||||
# py
|
||||
''
|
||||
host = c.content.blocking.hosts.lists.append
|
||||
host("https://www.github.developerdan.com/hosts/lists/facebook-extended.txt")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
options.mods.impermanence.enable = mkEnableOption "enables impermanence";
|
||||
|
||||
|
|
@ -8,7 +13,10 @@ with lib; {
|
|||
files = ["/var/lib/sops-nix/key.txt" "/etc/machine-id"];
|
||||
};
|
||||
|
||||
boot.initrd.postResumeCommands = lib.mkAfter ''
|
||||
boot.initrd.postResumeCommands =
|
||||
lib.mkAfter # sh
|
||||
|
||||
''
|
||||
mkdir /btrfs_tmp
|
||||
mount /dev/mapper/crypted /btrfs_tmp
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
inherit (lib)
|
||||
generators mapAttrs mkDefault mkEnableOption mkIf mkPackageOption mkOption
|
||||
types;
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit
|
||||
(lib)
|
||||
generators
|
||||
mapAttrs
|
||||
mkDefault
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkPackageOption
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.mods.services.grav;
|
||||
|
||||
|
|
@ -22,10 +32,8 @@ let
|
|||
ln -sf /var/lib/grav/$p $out/$p
|
||||
done
|
||||
'';
|
||||
|
||||
# systemSettingsYaml =
|
||||
# yamlFormat.generate "grav-settings.yaml" cfg.systemSettings;
|
||||
|
||||
in {
|
||||
options.mods.services.grav = {
|
||||
enable = mkEnableOption "grav";
|
||||
|
|
@ -97,7 +105,10 @@ in {
|
|||
group = "grav";
|
||||
|
||||
phpPackage = cfg.phpPackage.buildEnv {
|
||||
extensions = { all, enabled }:
|
||||
extensions = {
|
||||
all,
|
||||
enabled,
|
||||
}:
|
||||
with all; [
|
||||
apcu
|
||||
ctype
|
||||
|
|
@ -115,7 +126,8 @@ in {
|
|||
zip
|
||||
];
|
||||
|
||||
extraConfig = generators.toKeyValue {
|
||||
extraConfig =
|
||||
generators.toKeyValue {
|
||||
mkKeyValue = generators.mkKeyValueDefault {} " = ";
|
||||
} {
|
||||
output_buffering = "0";
|
||||
|
|
@ -169,10 +181,12 @@ in {
|
|||
${cfg.virtualHost} = {
|
||||
root = "${servedRoot}";
|
||||
|
||||
listen = [{
|
||||
listen = [
|
||||
{
|
||||
addr = cfg.addr;
|
||||
port = cfg.port;
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
||||
locations = {
|
||||
"= /robots.txt" = {
|
||||
|
|
@ -202,8 +216,7 @@ in {
|
|||
};
|
||||
|
||||
# deny running scripts inside core system folders
|
||||
"~* /(system|vendor)/.*\\.(txt|xml|md|html|htm|shtml|shtm|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$" =
|
||||
{
|
||||
"~* /(system|vendor)/.*\\.(txt|xml|md|html|htm|shtml|shtm|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$" = {
|
||||
priority = 300;
|
||||
extraConfig = ''
|
||||
return 403;
|
||||
|
|
@ -211,8 +224,7 @@ in {
|
|||
};
|
||||
|
||||
# deny running scripts inside user folder
|
||||
"~* /user/.*\\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$" =
|
||||
{
|
||||
"~* /user/.*\\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$" = {
|
||||
priority = 300;
|
||||
extraConfig = ''
|
||||
return 403;
|
||||
|
|
@ -220,8 +232,7 @@ in {
|
|||
};
|
||||
|
||||
# deny access to specific files in the root folder
|
||||
"~ /(LICENSE\\.txt|composer\\.lock|composer\\.json|nginx\\.conf|web\\.config|htaccess\\.txt|\\.htaccess)" =
|
||||
{
|
||||
"~ /(LICENSE\\.txt|composer\\.lock|composer\\.json|nginx\\.conf|web\\.config|htaccess\\.txt|\\.htaccess)" = {
|
||||
priority = 300;
|
||||
extraConfig = ''
|
||||
return 403;
|
||||
|
|
@ -245,7 +256,9 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
extraConfig =
|
||||
# sh
|
||||
''
|
||||
index index.php index.html /index.php$request_uri;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
|
@ -268,8 +281,10 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = let datadir = "/var/lib/grav";
|
||||
in map (dir: "d '${dir}' 0750 grav grav - -") [
|
||||
systemd.tmpfiles.rules = let
|
||||
datadir = "/var/lib/grav";
|
||||
in
|
||||
map (dir: "d '${dir}' 0750 grav grav - -") [
|
||||
"/var/cache/grav"
|
||||
"${datadir}/assets"
|
||||
"${datadir}/backup"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.mods.server.nginx;
|
||||
|
||||
in with lib; {
|
||||
in
|
||||
with lib; {
|
||||
options.mods.server.nginx = {
|
||||
enable = mkEnableOption {
|
||||
default = false;
|
||||
|
|
@ -44,7 +47,9 @@ in with lib; {
|
|||
# Only allow PFS-enabled ciphers with AES256
|
||||
# sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
|
||||
|
||||
appendHttpConfig = ''
|
||||
appendHttpConfig =
|
||||
# sh
|
||||
''
|
||||
# Add HSTS header with preloading to HTTPS requests.
|
||||
# Adding this header to HTTP requests is discouraged
|
||||
# map $scheme $hsts_header {
|
||||
|
|
@ -96,10 +101,12 @@ in with lib; {
|
|||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
in mapAttrs' (name: port:
|
||||
nameValuePair ("${name}.${cfg.domain}")
|
||||
in
|
||||
mapAttrs' (name: port:
|
||||
nameValuePair "${name}.${cfg.domain}"
|
||||
# (proxy port // { default = true; })) cfg.ports;
|
||||
(proxy port)) cfg.ports;
|
||||
(proxy port))
|
||||
cfg.ports;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue