diff --git a/generated/all-maintainers.nix b/generated/all-maintainers.nix index a96aaa41..2eec1a2f 100644 --- a/generated/all-maintainers.nix +++ b/generated/all-maintainers.nix @@ -40,6 +40,17 @@ matrix = "@noodlez1232:matrix.org"; name = "Nathaniel Barragan"; }; + TheColorman = { + email = "nixpkgs@colorman.me"; + github = "TheColorman"; + githubId = 18369995; + keys = [ + { + fingerprint = "3D8C A43C FBA2 5D28 0196 19F0 AB11 0475 B417 291D"; + } + ]; + name = "colorman"; + }; TheMaxMur = { email = "muravjev.mak@yandex.ru"; github = "TheMaxMur"; @@ -141,6 +152,12 @@ ]; name = "Mateus Auler"; }; + michaelgoldenn = { + email = "Michael.Golden0278@gmail.com"; + github = "michaelgoldenn"; + githubId = 95949544; + name = "Michael Golden"; + }; mightyiam = { email = "mightyiampresence@gmail.com"; github = "mightyiam"; diff --git a/modules/obsidian/hm.nix b/modules/obsidian/hm.nix new file mode 100644 index 00000000..91f2dc75 --- /dev/null +++ b/modules/obsidian/hm.nix @@ -0,0 +1,98 @@ +{ + mkTarget, + lib, + ... +}: +mkTarget { + name = "obsidian"; + humanName = "Obsidian"; + + extraOptions.vaultNames = lib.mkOption { + description = "The obsidian vault names to apply styling on."; + type = lib.types.listOf lib.types.str; + default = [ ]; + }; + + configElements = [ + ( + { cfg, fonts }: + { + programs.obsidian = { + defaultSettings.appearance = { + "interfaceFontFamily" = fonts.sansSerif.name; + "monospaceFontFamily" = fonts.monospace.name; + "baseFontSize" = fonts.sizes.applications; + }; + vaults = lib.genAttrs cfg.vaultNames (_: { + settings.appearance = { + "interfaceFontFamily" = fonts.sansSerif.name; + "monospaceFontFamily" = fonts.monospace.name; + "baseFontSize" = fonts.sizes.applications; + }; + }); + }; + } + ) + ( + { + cfg, + colors, + polarity, + }: + { + programs.obsidian.defaultSettings.cssSnippets = with colors.withHashtag; [ + { + name = "Stylix Config"; + text = '' + .theme-${polarity} { + /* Base Colors */ + --color-base-00: ${base00}; + --color-base-05: ${base00}; + --color-base-10: ${base00}; + --color-base-20: ${base01}; + --color-base-25: ${base01}; + --color-base-30: ${base02}; + --color-base-35: ${base02}; + --color-base-40: ${base03}; + --color-base-50: ${base03}; + --color-base-60: ${base04}; + --color-base-70: ${base04}; + --color-base-100: ${base05}; + + --color-accent: ${base0E}; + --color-accent-1: ${base0E}; + } + ''; + } + ]; + programs.obsidian.vaults = lib.genAttrs cfg.vaultNames (_: { + settings.cssSnippets = with colors.withHashtag; [ + { + name = "Stylix Config"; + text = '' + .theme-${polarity} { + /* Base Colors */ + --color-base-00: ${base00}; + --color-base-05: ${base00}; + --color-base-10: ${base00}; + --color-base-20: ${base01}; + --color-base-25: ${base01}; + --color-base-30: ${base02}; + --color-base-35: ${base02}; + --color-base-40: ${base03}; + --color-base-50: ${base03}; + --color-base-60: ${base04}; + --color-base-70: ${base04}; + --color-base-100: ${base05}; + + --color-accent: ${base0E}; + --color-accent-1: ${base0E}; + } + ''; + } + ]; + }); + } + ) + ]; +} diff --git a/modules/obsidian/meta.nix b/modules/obsidian/meta.nix new file mode 100644 index 00000000..a3820306 --- /dev/null +++ b/modules/obsidian/meta.nix @@ -0,0 +1,9 @@ +{ lib, ... }: +{ + name = "Obsidian"; + homepage = "https://obsidian.md"; + maintainers = with lib.maintainers; [ + TheColorman + michaelgoldenn + ]; +} diff --git a/modules/obsidian/testbeds/obsidian.nix b/modules/obsidian/testbeds/obsidian.nix new file mode 100644 index 00000000..4607f91e --- /dev/null +++ b/modules/obsidian/testbeds/obsidian.nix @@ -0,0 +1,29 @@ +{ lib, pkgs, ... }: +let + package = pkgs.obsidian; +in +{ + nixpkgs.config.allowUnfreePredicate = + pkg: + builtins.elem (lib.getName pkg) [ + "obsidian" + ]; + + stylix.testbed.ui.application = { + name = "obsidian"; + inherit package; + }; + + home-manager.sharedModules = + let + vault = "stylix"; + in + lib.singleton { + programs.obsidian = { + enable = true; + vaults.${vault}.enable = true; + inherit package; + }; + stylix.targets.obsidian.vaultNames = [ vault ]; + }; +} diff --git a/stylix/maintainers.nix b/stylix/maintainers.nix index 62e1037b..ee004ad1 100644 --- a/stylix/maintainers.nix +++ b/stylix/maintainers.nix @@ -42,6 +42,12 @@ { fingerprint = "36BC 916D DD4E B1EE EE82 4BBF DC95 900F 6DA7 9992"; } ]; }; + michaelgoldenn = { + email = "Michael.Golden0278@gmail.com"; + name = "Michael Golden"; + github = "michaelgoldenn"; + githubId = 95949544; + }; osipog = { email = "osibluber@protonmail.com"; name = "Osi Bluber";