mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-10 20:20:41 +03:00
123
This commit is contained in:
@@ -39,12 +39,12 @@ let
|
||||
};
|
||||
};
|
||||
nixosModule =
|
||||
{ config, ... }:
|
||||
{ xlib, ... }:
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users."${config.xlib.device.username}" = homeModule;
|
||||
users."${xlib.device.username}" = homeModule;
|
||||
users.root = rootModule;
|
||||
sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ let
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -20,7 +21,7 @@ let
|
||||
./hardware/logitech.nix
|
||||
];
|
||||
fileSystems = {
|
||||
"${config.xlib.dirs.therima-drive}" = {
|
||||
"${xlib.dirs.therima-drive}" = {
|
||||
device = "/dev/disk/by-uuid/C0A2DDEFA2DDEA44";
|
||||
fsType = "ntfs3";
|
||||
options = [
|
||||
@@ -33,7 +34,7 @@ let
|
||||
#"x-systemd.device-timeout=0"
|
||||
];
|
||||
};
|
||||
"${config.xlib.dirs.vetymae-drive}" = {
|
||||
"${xlib.dirs.vetymae-drive}" = {
|
||||
device = "/dev/disk/by-uuid/6E04EA7F04EA49A3";
|
||||
fsType = "ntfs3";
|
||||
options = [
|
||||
@@ -85,7 +86,7 @@ let
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
networking = {
|
||||
hostName = "${config.xlib.device.hostname}";
|
||||
hostName = "${xlib.device.hostname}";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
};
|
||||
@@ -114,10 +115,10 @@ let
|
||||
syncthing = {
|
||||
enable = true;
|
||||
systemService = true;
|
||||
configDir = "${config.xlib.dirs.user-storage}/Syncthing/${config.system.name}";
|
||||
dataDir = "${config.xlib.dirs.user-home}";
|
||||
configDir = "${xlib.dirs.user-storage}/Syncthing/${config.system.name}";
|
||||
dataDir = "${xlib.dirs.user-home}";
|
||||
group = "users";
|
||||
user = "${config.xlib.device.username}";
|
||||
user = "${xlib.device.username}";
|
||||
};
|
||||
pipewire = {
|
||||
enable = lib.mkDefault true;
|
||||
|
||||
@@ -29,7 +29,7 @@ let
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"${config.xlib.dirs.therima-drive}" = {
|
||||
"${xlib.dirs.therima-drive}" = {
|
||||
device = "/dev/disk/by-uuid/C0A2DDEFA2DDEA44";
|
||||
fsType = "ntfs3";
|
||||
options = [
|
||||
@@ -41,7 +41,7 @@ let
|
||||
"nofail"
|
||||
];
|
||||
};
|
||||
"${config.xlib.dirs.vetymae-drive}" = {
|
||||
"${xlib.dirs.vetymae-drive}" = {
|
||||
device = "/dev/disk/by-uuid/38D63C6ED63C2E8E";
|
||||
fsType = "ntfs3";
|
||||
options = [
|
||||
@@ -74,7 +74,7 @@ let
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
networking = {
|
||||
hostName = "${config.xlib.device.hostname}";
|
||||
hostName = "${xlib.device.hostname}";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
};
|
||||
@@ -104,10 +104,10 @@ let
|
||||
syncthing = {
|
||||
enable = true;
|
||||
systemService = true;
|
||||
configDir = "${config.xlib.dirs.user-storage}/Syncthing/${config.system.name}";
|
||||
dataDir = "${config.xlib.dirs.user-home}";
|
||||
configDir = "${xlib.dirs.user-storage}/Syncthing/${config.system.name}";
|
||||
dataDir = "${xlib.dirs.user-home}";
|
||||
group = "users";
|
||||
user = "${config.xlib.device.username}";
|
||||
user = "${xlib.device.username}";
|
||||
};
|
||||
pipewire = {
|
||||
enable = lib.mkDefault true;
|
||||
|
||||
@@ -5,6 +5,7 @@ let
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -36,7 +37,7 @@ let
|
||||
|
||||
fileSystems = {
|
||||
# External drive
|
||||
"${config.xlib.dirs.server-home}" = {
|
||||
"${xlib.dirs.server-home}" = {
|
||||
device = "/dev/disk/by-uuid/37e53ebc-5343-a94d-9fe2-0ca39e13a8de";
|
||||
fsType = "ext4";
|
||||
# options = [
|
||||
@@ -86,7 +87,7 @@ let
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "${config.xlib.device.hostname}";
|
||||
hostName = "${xlib.device.hostname}";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ let
|
||||
lib,
|
||||
modulesPath,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -59,19 +60,19 @@ let
|
||||
"path" = "/etc/nixos";
|
||||
"browseable" = "yes";
|
||||
"read only" = "no";
|
||||
"valid users" = "${config.xlib.device.username}";
|
||||
"valid users" = "${xlib.device.username}";
|
||||
"guest ok" = "no";
|
||||
"writable" = "yes";
|
||||
"create mask" = 755;
|
||||
"directory mask" = 755;
|
||||
"force user" = "${config.xlib.device.username}";
|
||||
"force user" = "${xlib.device.username}";
|
||||
"force group" = "users";
|
||||
};
|
||||
root = {
|
||||
"path" = "/";
|
||||
"browseable" = "yes";
|
||||
"read only" = "no";
|
||||
"valid users" = "${config.xlib.device.username}";
|
||||
"valid users" = "${xlib.device.username}";
|
||||
"guest ok" = "no";
|
||||
"writable" = "yes";
|
||||
#"create mask" = 0644;
|
||||
@@ -79,16 +80,16 @@ let
|
||||
"force user" = "root";
|
||||
"force group" = "root";
|
||||
};
|
||||
"${config.xlib.device.username}" = {
|
||||
"path" = "/home/${config.xlib.device.username}";
|
||||
"${xlib.device.username}" = {
|
||||
"path" = "/home/${xlib.device.username}";
|
||||
"browseable" = "yes";
|
||||
"read only" = "no";
|
||||
"valid users" = "${config.xlib.device.username}";
|
||||
"valid users" = "${xlib.device.username}";
|
||||
"guest ok" = "no";
|
||||
"writable" = "yes";
|
||||
"create mask" = 700;
|
||||
"directory mask" = 700;
|
||||
"force user" = "${config.xlib.device.username}";
|
||||
"force user" = "${xlib.device.username}";
|
||||
"force group" = "users";
|
||||
};
|
||||
};
|
||||
@@ -116,7 +117,7 @@ let
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "${config.xlib.device.hostname}";
|
||||
hostName = "${xlib.device.hostname}";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = true;
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ let
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -30,14 +31,14 @@ let
|
||||
|
||||
networking = {
|
||||
firewall.enable = false;
|
||||
hostName = config.xlib.device.hostname;
|
||||
hostName = xlib.device.hostname;
|
||||
};
|
||||
|
||||
wsl = {
|
||||
enable = true;
|
||||
startMenuLaunchers = true;
|
||||
#useWindowsDriver = true;
|
||||
defaultUser = config.xlib.device.username;
|
||||
defaultUser = xlib.device.username;
|
||||
};
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
tailscale.enable = config.xlib.device.type != "wsl"; # true, if not wsl
|
||||
tailscale.enable = xlib.device.type != "wsl"; # true, if not wsl
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
{
|
||||
config,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.calibre-web = {
|
||||
enable = true;
|
||||
group = "users";
|
||||
user = "${config.xlib.device.username}";
|
||||
user = "${xlib.device.username}";
|
||||
options = {
|
||||
calibreLibrary = "${config.xlib.dirs.calibre-library}";
|
||||
calibreLibrary = "${xlib.dirs.calibre-library}";
|
||||
enableBookUploading = true;
|
||||
enableKepubify = false;
|
||||
};
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
cloudflared = {
|
||||
enable = false;
|
||||
certificateFile = "${config.xlib.dirs.server-credentials}/cloudflared/cert.pem";
|
||||
certificateFile = "${xlib.dirs.server-credentials}/cloudflared/cert.pem";
|
||||
tunnels = {
|
||||
"58b340ee-e98a-4af9-b786-74600c71f49e" = {
|
||||
credentialsFile = "${config.xlib.dirs.server-credentials}/cloudflared/server.json";
|
||||
credentialsFile = "${xlib.dirs.server-credentials}/cloudflared/server.json";
|
||||
warp-routing.enabled = true;
|
||||
ingress = {
|
||||
"immich.zeroq.ru" = {
|
||||
@@ -24,7 +25,7 @@
|
||||
default = "http_status:404";
|
||||
};
|
||||
# "58b340ee-e98a-4af9-b786-74600c71f49e" = {
|
||||
# credentialsFile = "${config.xlib.dirs.server-credentials}/cloudflared/server.json";
|
||||
# credentialsFile = "${xlib.dirs.server-credentials}/cloudflared/server.json";
|
||||
# warp-routing.enabled = true;
|
||||
# ingress = {
|
||||
# "nextcloud.zeroq.ru" = {
|
||||
@@ -56,7 +57,7 @@
|
||||
# ];
|
||||
# wantedBy = [ "multi-user.target" ];
|
||||
# serviceConfig = {
|
||||
# ExecStart = "${pkgs.cloudflared}/bin/cloudflared tunnel --no-autoupdate --config=${config.xlib.dirs.server-credentials}/cloudflared/config.yaml --origincert=${config.xlib.dirs.server-credentials}/cloudflared/cert.pem --credentials-file=${config.xlib.dirs.server-credentials}/cloudflared/server.json run";
|
||||
# ExecStart = "${pkgs.cloudflared}/bin/cloudflared tunnel --no-autoupdate --config=${xlib.dirs.server-credentials}/cloudflared/config.yaml --origincert=${xlib.dirs.server-credentials}/cloudflared/cert.pem --credentials-file=${xlib.dirs.server-credentials}/cloudflared/server.json run";
|
||||
# Group = "root";
|
||||
# User = "root";
|
||||
# Restart = "on-failure";
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -20,7 +21,7 @@
|
||||
};
|
||||
|
||||
fileSystems."${config.services.immich.mediaLocation}" = {
|
||||
device = "${config.xlib.dirs.immich-folder}";
|
||||
device = "${xlib.dirs.immich-folder}";
|
||||
options = [
|
||||
"bind"
|
||||
#"uid=1000"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -76,7 +77,7 @@
|
||||
};
|
||||
|
||||
fileSystems."/mnt/nextcloud" = {
|
||||
device = "${config.xlib.dirs.nextcloud-folder}";
|
||||
device = "${xlib.dirs.nextcloud-folder}";
|
||||
options = [
|
||||
"bind"
|
||||
#"uid=1000"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
config,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -15,19 +16,19 @@
|
||||
"path" = "/etc/nixos";
|
||||
"browseable" = "yes";
|
||||
"read only" = "no";
|
||||
"valid users" = "${config.xlib.device.username}";
|
||||
"valid users" = "${xlib.device.username}";
|
||||
"guest ok" = "no";
|
||||
"writable" = "yes";
|
||||
"create mask" = 755;
|
||||
"directory mask" = 755;
|
||||
"force user" = "${config.xlib.device.username}";
|
||||
"force user" = "${xlib.device.username}";
|
||||
"force group" = "users";
|
||||
};
|
||||
root = {
|
||||
"path" = "/";
|
||||
"browseable" = "yes";
|
||||
"read only" = "no";
|
||||
"valid users" = "${config.xlib.device.username}";
|
||||
"valid users" = "${xlib.device.username}";
|
||||
"guest ok" = "no";
|
||||
"writable" = "yes";
|
||||
#"create mask" = 0644;
|
||||
@@ -35,16 +36,16 @@
|
||||
"force user" = "root";
|
||||
"force group" = "root";
|
||||
};
|
||||
"${config.xlib.device.username}" = {
|
||||
"path" = "${config.xlib.dirs.server-home}";
|
||||
"${xlib.device.username}" = {
|
||||
"path" = "${xlib.dirs.server-home}";
|
||||
"browseable" = "yes";
|
||||
"read only" = "no";
|
||||
"valid users" = "${config.xlib.device.username}";
|
||||
"valid users" = "${xlib.device.username}";
|
||||
"guest ok" = "no";
|
||||
"writable" = "yes";
|
||||
"create mask" = 700;
|
||||
"directory mask" = 700;
|
||||
"force user" = "${config.xlib.device.username}";
|
||||
"force user" = "${xlib.device.username}";
|
||||
"force group" = "users";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
config,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -7,9 +8,9 @@
|
||||
enable = true;
|
||||
systemService = true;
|
||||
guiAddress = "0.0.0.0:8384";
|
||||
configDir = "${config.xlib.dirs.storage}/Syncthing/${config.xlib.device.hostname}";
|
||||
dataDir = "${config.xlib.dirs.server-home}";
|
||||
configDir = "${xlib.dirs.storage}/Syncthing/${xlib.device.hostname}";
|
||||
dataDir = "${xlib.dirs.server-home}";
|
||||
group = "users";
|
||||
user = "${config.xlib.device.username}";
|
||||
user = "${xlib.device.username}";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -12,8 +13,8 @@
|
||||
#after = [ ];
|
||||
requisite = [ "mnt-archive.mount" ]; # hard-code
|
||||
script = ''
|
||||
${pkgs.rsync}/bin/rsync -rtv --delete ${config.xlib.dirs.immich-folder}/ ${config.xlib.dirs.archive-drive}/Services/immich/
|
||||
${pkgs.rsync}/bin/rsync -rtv --delete ${config.xlib.dirs.nextcloud-folder}/ ${config.xlib.dirs.archive-drive}/Services/nextcloud/
|
||||
${pkgs.rsync}/bin/rsync -rtv --delete ${xlib.dirs.immich-folder}/ ${xlib.dirs.archive-drive}/Services/immich/
|
||||
${pkgs.rsync}/bin/rsync -rtv --delete ${xlib.dirs.nextcloud-folder}/ ${xlib.dirs.archive-drive}/Services/nextcloud/
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.transmission = {
|
||||
enable = false;
|
||||
#credentialsFile = "${config.xlib.dirs.server-home}/server/transmission/settings.json";
|
||||
#credentialsFile = "${xlib.dirs.server-home}/server/transmission/settings.json";
|
||||
openRPCPort = true;
|
||||
package = pkgs.transmission_4;
|
||||
user = "${config.xlib.device.username}";
|
||||
user = "${xlib.device.username}";
|
||||
group = "users";
|
||||
settings = {
|
||||
download-dir = "${config.xlib.dirs.server-home}/Downloads";
|
||||
incomplete-dir = "${config.xlib.dirs.server-home}/Downloads/Temp";
|
||||
download-dir = "${xlib.dirs.server-home}/Downloads";
|
||||
incomplete-dir = "${xlib.dirs.server-home}/Downloads/Temp";
|
||||
incomplete-dir-enabled = true;
|
||||
rpc-bind-address = "0.0.0.0";
|
||||
rpc-port = 9091;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{ inputs, ... }@flakeContext:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -15,7 +15,7 @@
|
||||
# HSA_OVERRIDE_GFX_VERSION = "11.5.0";
|
||||
# HCC_AMDGPU_TARGET = "gfx1150"; # used to be necessary, but doesn't seem to anymore
|
||||
# };
|
||||
# user = "ollama"; # "${config.xlib.device.username}";
|
||||
# user = "ollama"; # "${xlib.device.username}";
|
||||
# group = "ollama";
|
||||
# acceleration = "rocm";
|
||||
# rocmOverrideGfx = "11.5.0";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{ inputs, ... }@flakeContext:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -38,12 +38,12 @@ let
|
||||
in
|
||||
{
|
||||
systemd.tmpfiles.rules = [
|
||||
"z /mnt/beets 0700 ${config.xlib.device.username} users -" # beets absolute paths
|
||||
"z /mnt/beets 0700 ${xlib.device.username} users -" # beets absolute paths
|
||||
];
|
||||
|
||||
users = {
|
||||
users = {
|
||||
"${config.xlib.device.username}" = {
|
||||
"${xlib.device.username}" = {
|
||||
packages = [
|
||||
beetsEnv
|
||||
pkgs.beets
|
||||
|
||||
Reference in New Issue
Block a user