Compare commits

..

6 commits

Author SHA1 Message Date
Nickiel12
ab4faa2f7e added postgres to wsl installation for dev server 2024-07-12 02:00:32 +00:00
Nickiel12
44c6c38eef added tailscale only nginx rule for nextcloud 2024-07-11 18:59:09 -07:00
Nickiel12
3e0ffca7c8 flake.lock: Update
Flake lock file updates:

• Updated input 'atuin':
    'github:atuinsh/atuin/f56a66add9e64151e98ce35c3e85f436927c1ac3' (2024-07-05)
  → 'github:atuinsh/atuin/8f5af526d31794e3bdf3f4787347f449aa13294f' (2024-07-11)
• Updated input 'home-manager':
    'github:nix-community/home-manager/10486e6b311b3c5ae1c3477fee058704cea7cb4a' (2024-07-06)
  → 'github:nix-community/home-manager/90ae324e2c56af10f20549ab72014804a3064c7f' (2024-07-11)
• Updated input 'kmonad':
    'github:kmonad/kmonad/235b42610758355a664c153999c1ff03b4d918e6?dir=nix' (2024-06-07)
  → 'github:kmonad/kmonad/97a3dea051a3565e97f2bdde60473a2d78182b07?dir=nix' (2024-07-08)
• Updated input 'kmonad/nixpkgs':
    'github:NixOS/nixpkgs/ea780f3de2d169f982564128804841500e85e373' (2024-01-14)
  → 'github:NixOS/nixpkgs/ab82a9612aa45284d4adf69ee81871a389669a9e' (2024-07-07)
• Updated input 'nixos-wsl':
    'github:nix-community/NixOS-WSL/7051b909b9b5e74f19791795bd769de12c5acb3d' (2024-07-05)
  → 'github:nix-community/NixOS-WSL/30ebd0beb2ed26e09bcd245d757504029f807cce' (2024-07-08)
• Updated input 'nixos-wsl/nixpkgs':
    'github:NixOS/nixpkgs/706eef542dec88cc0ed25b9075d3037564b2d164' (2024-07-02)
  → 'github:NixOS/nixpkgs/49ee0e94463abada1de470c9c07bfc12b36dcf40' (2024-07-06)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03)
  → 'github:nixos/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/7144d6241f02d171d25fba3edeaf15e0f2592105' (2024-07-02)
  → 'github:NixOS/nixpkgs/205fd4226592cc83fd4c0885a3e4c9c400efabb5' (2024-07-09)
• Updated input 'nixvim':
    'github:nix-community/nixvim/6674dea8403747827431d4d8497c34023f93d047' (2024-07-06)
  → 'github:nix-community/nixvim/53e85da2409ddfeef27e8cdc9c020433614329f9' (2024-07-11)
• Updated input 'nixvim/git-hooks/flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
  → follows 'nixvim/flake-compat'
2024-07-11 18:32:20 -07:00
Nickiel12
e05ede0a08 added handy shortcut for window tabs 2024-07-12 01:30:55 +00:00
Nickiel12
e18d2a06f7 moved postgres to it's own file 2024-07-12 01:30:41 +00:00
Nickiel12
958128e86e flake.lock: Update
Flake lock file updates:

• Updated input 'atuin':
    'github:atuinsh/atuin/a67cfc82fe0dc907a01f07a0fd625701e062a33b' (2024-07-03)
  → 'github:atuinsh/atuin/f56a66add9e64151e98ce35c3e85f436927c1ac3' (2024-07-05)
• Updated input 'home-manager':
    'github:nix-community/home-manager/c514e862cd5705e51edb6fe8d01146fdeec661f2' (2024-07-04)
  → 'github:nix-community/home-manager/10486e6b311b3c5ae1c3477fee058704cea7cb4a' (2024-07-06)
• Updated input 'nixos-wsl':
    'github:nix-community/NixOS-WSL/269411cfed6aab694e46f719277c972de96177bb' (2024-06-24)
  → 'github:nix-community/NixOS-WSL/7051b909b9b5e74f19791795bd769de12c5acb3d' (2024-07-05)
• Updated input 'nixos-wsl/nixpkgs':
    'github:NixOS/nixpkgs/dd457de7e08c6d06789b1f5b88fc9327f4d96309' (2024-06-19)
  → 'github:NixOS/nixpkgs/706eef542dec88cc0ed25b9075d3037564b2d164' (2024-07-02)
• Updated input 'nixvim':
    'github:nix-community/nixvim/92e9f5466dcfd51e8e2e7627e992c1c9d5fc6fd6' (2024-07-04)
  → 'github:nix-community/nixvim/6674dea8403747827431d4d8497c34023f93d047' (2024-07-06)
2024-07-07 04:21:42 +00:00
7 changed files with 141 additions and 129 deletions

View file

@ -10,11 +10,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719991445, "lastModified": 1720713779,
"narHash": "sha256-0zSXPres0wlhS9n6h44ZzV0TOeWdMsICMlHAGjqkWGE=", "narHash": "sha256-0De2TpilkMce0HRmy6l9YwbTtCx6cj/fVZcw/s+un6E=",
"owner": "atuinsh", "owner": "atuinsh",
"repo": "atuin", "repo": "atuin",
"rev": "a67cfc82fe0dc907a01f07a0fd625701e062a33b", "rev": "8f5af526d31794e3bdf3f4787347f449aa13294f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -132,22 +132,6 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
} }
}, },
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -261,7 +245,10 @@
}, },
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": [
"nixvim",
"flake-compat"
],
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
@ -339,11 +326,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720135141, "lastModified": 1720734513,
"narHash": "sha256-1GHh1/WO+f42TXxb1WiZFMuepM7ITA9iT+6yJBbBNsY=", "narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c514e862cd5705e51edb6fe8d01146fdeec661f2", "rev": "90ae324e2c56af10f20549ab72014804a3064c7f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -379,11 +366,11 @@
}, },
"locked": { "locked": {
"dir": "nix", "dir": "nix",
"lastModified": 1717741147, "lastModified": 1720421296,
"narHash": "sha256-Zz1xi6Fy8QrYkaC7WuKjUt8sxJmP9xd7+kHlkdjQ7qE=", "narHash": "sha256-Pl8n7CkrurvRFGyWV6oi9jmxRHDcsrcM4AlUMYG0rwU=",
"owner": "kmonad", "owner": "kmonad",
"repo": "kmonad", "repo": "kmonad",
"rev": "235b42610758355a664c153999c1ff03b4d918e6", "rev": "97a3dea051a3565e97f2bdde60473a2d78182b07",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -440,11 +427,11 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1719220171, "lastModified": 1720428387,
"narHash": "sha256-xywM6JoGT8AwfoOFJBTv8GRlvNu8LYqqqMS/OQ6uCgE=", "narHash": "sha256-0vHxVNWTql555MZLb2kngrcjfNtsJKoYdyUivTibgnc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "269411cfed6aab694e46f719277c972de96177bb", "rev": "30ebd0beb2ed26e09bcd245d757504029f807cce",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -472,11 +459,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1719957072, "lastModified": 1720535198,
"narHash": "sha256-gvFhEf5nszouwLAkT9nWsDzocUTqLWHuL++dvNjMp9I=", "narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7144d6241f02d171d25fba3edeaf15e0f2592105", "rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -504,11 +491,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1705242415, "lastModified": 1720368505,
"narHash": "sha256-a8DRYrNrzTudvO7XHUPNJD89Wbf1ZZT0VbwCsPnHWaE=", "narHash": "sha256-5r0pInVo5d6Enti0YwUSQK4TebITypB42bWy5su3MrQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ea780f3de2d169f982564128804841500e85e373", "rev": "ab82a9612aa45284d4adf69ee81871a389669a9e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -552,11 +539,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1718835956, "lastModified": 1720244366,
"narHash": "sha256-wM9v2yIxClRYsGHut5vHICZTK7xdrUGfrLkXvSuv6s4=", "narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dd457de7e08c6d06789b1f5b88fc9327f4d96309", "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -568,11 +555,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1720031269, "lastModified": 1720542800,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", "rev": "feb2849fdeb70028c70d73b848214b00d324a497",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -610,11 +597,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1720126856, "lastModified": 1720735595,
"narHash": "sha256-xtRwIUKv7EpuyGtvq+rO7PoZZIpD55AYe6rl+plEhY8=", "narHash": "sha256-TX7PZY80h22+i01d2M1/50gfdzbvqYpmE7+s13FJnJ4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "92e9f5466dcfd51e8e2e7627e992c1c9d5fc6fd6", "rev": "53e85da2409ddfeef27e8cdc9c020433614329f9",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -16,6 +16,7 @@
./modules/nginx.nix ./modules/nginx.nix
./modules/nextcloud.nix ./modules/nextcloud.nix
./modules/nicks_nextcould_integrations.nix ./modules/nicks_nextcould_integrations.nix
./modules/postgres.nix
./modules/protonvpn.nix ./modules/protonvpn.nix
./modules/tailscale.nix ./modules/tailscale.nix
./modules/vaultwarden.nix ./modules/vaultwarden.nix

View file

@ -1,97 +1,78 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
services.nextcloud = { services.nextcloud = {
enable = true; enable = true;
package = pkgs.nextcloud29; package = pkgs.nextcloud29;
enableImagemagick = true; enableImagemagick = true;
nginx.recommendedHttpHeaders = true; nginx.recommendedHttpHeaders = true;
https = true; https = true;
hostName = "files.nickiel.net"; hostName = "files.nickiel.net";
home = "/Aurora/nextcloud"; home = "/Aurora/nextcloud";
autoUpdateApps.enable = true; autoUpdateApps.enable = true;
phpOptions = { phpOptions = {
"opcache.interned_strings_buffer" = "64"; "opcache.interned_strings_buffer" = "64";
}; };
settings = { settings = {
preview_max_x = 2048; preview_max_x = 2048;
preview_max_y = 2048; preview_max_y = 2048;
jpeg_quality = 50; jpeg_quality = 50;
enable_previews = true; enable_previews = true;
enabledPreviewProviders = [ enabledPreviewProviders = [
"OC\\Preview\\HEIC" "OC\\Preview\\HEIC"
"OC\\Preview\\JPEG" "OC\\Preview\\JPEG"
"OC\\Preview\\JPG" "OC\\Preview\\JPG"
"OC\\Preview\\PNG" "OC\\Preview\\PNG"
"OC\\Preview\\MP4" "OC\\Preview\\MP4"
"OC\\Preview\\MOVIE" "OC\\Preview\\MOVIE"
]; ];
log_type = "file"; log_type = "file";
maintenance_window_start = "10"; # 3 AM PDT maintenance_window_start = "10"; # 3 AM PDT
default_phone_region = "US"; default_phone_region = "US";
overwriteProtocol = "https"; overwriteProtocol = "https";
extraTrustedDomains = [ extraTrustedDomains = [
"10.0.0.183" "10.0.0.183"
"files.nickiel.net" "files.nickiel.net"
]; ];
trustedProxies = [ trustedProxies = [
"files.nickiel.net" "files.nickiel.net"
]; ];
}; };
database.createLocally = false; database.createLocally = false;
config = { config = {
dbtype = "pgsql"; dbtype = "pgsql";
dbuser = "nextcloud"; dbuser = "nextcloud";
dbhost = "/run/postgresql"; dbhost = "/run/postgresql";
dbname = "nextcloud"; dbname = "nextcloud";
#dbpassFile = "/Aurora/nextcloud/nextcloud-db-password"; #dbpassFile = "/Aurora/nextcloud/nextcloud-db-password";
# This doesn't seem to be working, see this documation: # This doesn't seem to be working, see this documation:
# https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/reset_admin_password.html # https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/reset_admin_password.html
adminpassFile = "/Aurora/nextcloud/nextcloud-admin-password"; adminpassFile = "/Aurora/nextcloud/nextcloud-admin-password";
adminuser = "admin"; adminuser = "admin";
}; };
}; };
services.postgresql = { # Make sure PostSQL is running before nextcloud
enable = true; systemd.services."nextcloud-setup" = {
enableTCPIP = true; requires = ["postgresql.service"];
ensureDatabases = [ "nextcloud" ]; after = ["postgresql.service"];
ensureUsers = [ };
{
name = "nextcloud";
ensureDBOwnership = true;
}
];
authentication = lib.mkForce ''
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all 0.0.0.0/0 md5
''; # address is the computer you are connecting from
};
# Make sure PostSQL is running before nextcloud systemd.services.nextcloud-preview = {
systemd.services."nextcloud-setup" = { description = "Generate previews for all images that haven't been rendered";
requires = ["postgresql.service"]; path = with pkgs; [
after = ["postgresql.service"]; config.services.nextcloud.occ
}; ];
script = ''
systemd.services.nextcloud-preview = { nextcloud-occ preview:pre-generate
description = "Generate previews for all images that haven't been rendered"; '';
path = with pkgs; [ startAt = "01:00:00";
config.services.nextcloud.occ };
];
script = ''
nextcloud-occ preview:pre-generate
'';
startAt = "01:00:00";
};
} }

View file

@ -56,6 +56,10 @@
"files.nickiel.net" = { "files.nickiel.net" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/".extraConfig = ''
allow 100.64.0.0/24;
deny all;
'';
}; };
"git.nickiel.net" = { "git.nickiel.net" = {

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
{
services.postgresql = {
enable = true;
enableTCPIP = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{
name = "nextcloud";
ensureDBOwnership = true;
}
];
authentication = lib.mkForce ''
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all 0.0.0.0/0 md5
''; # address is the computer you are connecting from
};
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
# See https://nix-community.github.io/NixOS-WSL/how-to/change-username.html # See https://nix-community.github.io/NixOS-WSL/how-to/change-username.html
@ -31,4 +31,16 @@
package = pkgs.nixVersions.stable; package = pkgs.nixVersions.stable;
extraOptions = "experimental-features = nix-command flakes"; extraOptions = "experimental-features = nix-command flakes";
}; };
services.postgresql = {
enable = true;
enableTCPIP = true;
authentication = lib.mkForce ''
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all 0.0.0.0/0 md5
''; # address is the computer you are connecting from
};
} }

View file

@ -11,6 +11,11 @@ in
shellIntegration.enableZshIntegration = true; shellIntegration.enableZshIntegration = true;
# theme = "colbalt-neon"; # theme = "colbalt-neon";
keybindings = {
"ctrl+shift+l" = "next_tab";
"ctrl+shift+h" = "previous_tab";
};
settings = { settings = {
allow_remote_control = true; allow_remote_control = true;
shell = "zsh"; shell = "zsh";