feat: add pimalaya profile

This commit is contained in:
Moritz Böhme 2024-12-21 10:29:58 +01:00
parent 6913bb4ee3
commit d2a4ec7f03
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
9 changed files with 638 additions and 29 deletions

View file

@ -0,0 +1,30 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.himalaya;
toml = pkgs.formats.toml { };
in
{
options.my.programs.himalaya.enable = mkEnableOption "himalaya";
options.my.programs.himalaya.package = mkPackageOption pkgs "himalaya" { };
options.my.programs.himalaya.settings = mkOption {
inherit (toml) type;
default = { };
apply = toml.generate "config.toml";
};
config = mkIf cfg.enable {
home-manager.users.moritz.xdg.configFile."himalaya/config.toml".source = cfg.settings;
home-manager.users.moritz.home.packages = [ cfg.package ];
age.secrets.email = {
file = ../../secrets/email.age;
owner = "1000";
};
};
}

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
home-manager.users.moritz.programs.nixvim = lib.mkIf config.my.programs.himalaya.enable {
extraPlugins = with pkgs.vimPlugins; [
# himalaya-vim
inputs.himalaya-vim.packages.${pkgs.system}.default
];
extraConfigLuaPost = ''
vim.g.himalaya_folder_picker = "telescope";
'';
autoCmd = [
{
command = "set modifiable";
event = [ "FileType" ];
pattern = [ "himalaya-email-listing" ];
}
];
};
}