From 6174f3650cf42aaf008012e828d5a1f8e2ce037f Mon Sep 17 00:00:00 2001 From: Leander Scherer Date: Thu, 8 Jan 2026 02:48:11 +0100 Subject: refactor(modules): separate nixos/home-manager modules, use standard option conventions --- modules/users/productivity/anki/default.nix | 30 ++++++++++++++ modules/users/productivity/default.nix | 10 +++++ modules/users/productivity/latex/default.nix | 47 ++++++++++++++++++++++ .../productivity/nextcloud-client/default.nix | 28 +++++++++++++ modules/users/productivity/obsidian/default.nix | 23 +++++++++++ modules/users/productivity/typst/default.nix | 25 ++++++++++++ 6 files changed, 163 insertions(+) create mode 100644 modules/users/productivity/anki/default.nix create mode 100644 modules/users/productivity/default.nix create mode 100644 modules/users/productivity/latex/default.nix create mode 100644 modules/users/productivity/nextcloud-client/default.nix create mode 100644 modules/users/productivity/obsidian/default.nix create mode 100644 modules/users/productivity/typst/default.nix (limited to 'modules/users/productivity') diff --git a/modules/users/productivity/anki/default.nix b/modules/users/productivity/anki/default.nix new file mode 100644 index 0000000..efe4ab5 --- /dev/null +++ b/modules/users/productivity/anki/default.nix @@ -0,0 +1,30 @@ +{ + config, + options, + lib, + ... +}: +let + cfg = config.nx.productivity.anki; + inherit (lib) mkOption types mkIf; +in +{ + options.nx.productivity.anki = { + enable = mkOption { + description = "Anki free and open-source flashcard program"; + type = types.bool; + default = false; + }; + }; + config = mkIf cfg.enable { + # Marked as broken + #home-manager.users.${username}.programs.anki = { + #enable = true; + #style = "native"; + #addons = with pkgs.ankiAddons; [ + # anki-connect + # review-heatmap + #]; + #}; + }; +} diff --git a/modules/users/productivity/default.nix b/modules/users/productivity/default.nix new file mode 100644 index 0000000..9e05dde --- /dev/null +++ b/modules/users/productivity/default.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ./anki + ./latex + ./obsidian + ./typst + ./nextcloud-client + ]; +} diff --git a/modules/users/productivity/latex/default.nix b/modules/users/productivity/latex/default.nix new file mode 100644 index 0000000..0720664 --- /dev/null +++ b/modules/users/productivity/latex/default.nix @@ -0,0 +1,47 @@ +{ + config, + options, + pkgs, + lib, + ... +}: +let + cfg = config.nx.productivity.latex; + inherit (lib) mkOption types mkIf; +in +{ + options.nx.productivity.latex = { + enable = mkOption { + description = "LaTeX typesetting system"; + type = types.bool; + default = false; + }; + }; + + config = mkIf cfg.enable { + programs.texlive = { + enable = true; + # See https://mynixos.com/search?q=texlivepackages.collection for more collections + # and https://mynixos.com/search?q=texlivepackages for more individual packages. + extraPackages = tpkgs: { + inherit (tpkgs) + collection-basic + collection-latex + collection-latexrecommended + biblatex + ; + }; + }; + + home.packages = with pkgs; [ + biber + ]; + + programs.pandoc = { + enable = true; + defaults = { + pdf-engine = "pdfetex"; + }; + }; + }; +} diff --git a/modules/users/productivity/nextcloud-client/default.nix b/modules/users/productivity/nextcloud-client/default.nix new file mode 100644 index 0000000..1b92bb0 --- /dev/null +++ b/modules/users/productivity/nextcloud-client/default.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + pkgs, + username, + ... +}: + +let + inherit (lib) mkOption types mkIf; + cfg = config.nx.productivity.nextcloud-client; +in +{ + options.nx.productivity.nextcloud-client = { + enable = mkOption { + description = "Client for nextcloud"; + type = types.bool; + default = false; + }; + }; + config = mkIf cfg.enable { + #home.packages = with pkgs; [ nextcloud-client ]; + services.nextcloud-client = { + enable = true; + startInBackground = true; + }; + }; +} diff --git a/modules/users/productivity/obsidian/default.nix b/modules/users/productivity/obsidian/default.nix new file mode 100644 index 0000000..21b3f34 --- /dev/null +++ b/modules/users/productivity/obsidian/default.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: +let + cfg = config.nx.productivity.obsidian; + inherit (lib) mkOption types mkIf; +in +{ + options.nx.productivity.obsidian = { + enable = mkOption { + description = "Obsidian note-taking application"; + type = types.bool; + default = false; + }; + }; + config = mkIf cfg.enable { + programs.obsidian = { + enable = true; + }; + }; +} diff --git a/modules/users/productivity/typst/default.nix b/modules/users/productivity/typst/default.nix new file mode 100644 index 0000000..f3e1981 --- /dev/null +++ b/modules/users/productivity/typst/default.nix @@ -0,0 +1,25 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.nx.productivity.typst; + inherit (lib) mkOption types mkIf; +in +{ + options.nx.productivity.typst = { + enable = mkOption { + description = "Typst markup-based typesetting system"; + type = types.bool; + default = false; + }; + }; + config = mkIf cfg.enable { + home.packages = with pkgs; [ + typst + typst-fmt + ]; + }; +} -- cgit v1.3.1