diff --git a/devices/wsl.nix b/devices/wsl.nix index 27e3900..0d337af 100755 --- a/devices/wsl.nix +++ b/devices/wsl.nix @@ -9,7 +9,10 @@ let ... }: { - xlib.device.type = "wsl"; + xlib.device = { + type = "wsl"; + hostname = "wsl"; + }; imports = with inputs; [ # Hardware @@ -59,7 +62,7 @@ let networking = { firewall.enable = false; - hostName = "${inputs.zeroq.devices.wsl.hostname}"; + hostName = "${config.xlib.device.hostname}"; }; wsl = { diff --git a/modules/options.nix b/modules/options.nix index bc86fbe..4ac8b54 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -1,5 +1,6 @@ { inputs, + config, lib, ... }: @@ -20,10 +21,91 @@ }; username = lib.mkOption { type = lib.types.str; - default = "${inputs.zeroq.devices.admin}"; + default = "oqyude"; description = "Username for host."; }; + hostname = lib.mkOption { + type = lib.types.str; + default = "nixos"; + description = "Hostname..."; + }; + }; + dirs = { + user-home = lib.mkOption { + type = lib.types.str; + description = "User home directory."; + }; + user-storage = lib.mkOption { + type = lib.types.str; + description = "User storage directory."; + }; + therima-drive = lib.mkOption { + type = lib.types.str; + description = "Therima drive mount point."; + }; + vetymae-drive = lib.mkOption { + type = lib.types.str; + description = "Vetymae drive mount point."; + }; + wsl-home = lib.mkOption { + type = lib.types.str; + description = "WSL home directory."; + }; + wsl-storage = lib.mkOption { + type = lib.types.str; + description = "WSL storage directory."; + }; + server-home = lib.mkOption { + type = lib.types.str; + description = "Server home directory."; + }; + server-credentials = lib.mkOption { + type = lib.types.str; + description = "Server credentials directory."; + }; + storage = lib.mkOption { + type = lib.types.str; + description = "General storage directory."; + }; + calibre-library = lib.mkOption { + type = lib.types.str; + description = "Calibre library directory."; + }; + music-library = lib.mkOption { + type = lib.types.str; + description = "Music library directory."; + }; + immich-folder = lib.mkOption { + type = lib.types.str; + description = "Immich service folder."; + }; + nextcloud-folder = lib.mkOption { + type = lib.types.str; + description = "Nextcloud service folder."; + }; + postgresql-folder = lib.mkOption { + type = lib.types.str; + description = "PostgreSQL service folder."; + }; }; }; }; + config = { + xlib.dirs = { + user-home = "/home/${config.xlib.device.username}"; + user-storage = "${config.xlib.dirs.user-home}/Storage"; + therima-drive = "/mnt/therima"; + vetymae-drive = "/mnt/vetymae"; + wsl-home = "/mnt/c/Users/${config.xlib.device.username}"; + wsl-storage = "${config.xlib.dirs.wsl-home}/Storage"; + server-home = "/home/${config.xlib.device.username}/External"; + server-credentials = "${config.xlib.dirs.server-home}/Credentials/server"; + storage = "${config.xlib.dirs.server-home}/Storage"; + calibre-library = "${config.xlib.dirs.server-home}/Books-Library"; + music-library = "${config.xlib.dirs.user-home}/Music"; + immich-folder = "${config.xlib.dirs.server-home}/Services/immich"; + nextcloud-folder = "${config.xlib.dirs.server-home}/Services/nextcloud"; + postgresql-folder = "${config.xlib.dirs.server-home}/Services/postgresql"; + }; + }; } diff --git a/modules/users.nix b/modules/users.nix index 81dd364..710be04 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -3,7 +3,9 @@ ... }: { - config.users = { + xlib.device.username = "oqyude"; + + users = { users = { "${config.xlib.device.username}" = { isNormalUser = true;