mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
Install himalaya vim plugin
This commit is contained in:
parent
6f2a5d795c
commit
001cb2e91d
6 changed files with 35 additions and 21 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./protonmail-bridge.nix
|
||||
./himalaya-client.nix
|
||||
./himalaya-workflow.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,14 @@
|
|||
{ pkgs, lib, system, inputs, ... }:
|
||||
let
|
||||
himalaya = inputs.himalaya.outputs.defaultPackage.${system};
|
||||
in
|
||||
{
|
||||
environment.systemPackages =
|
||||
let
|
||||
# Wrap himalaya to be aware of ProtonMail's bridge cert.
|
||||
himalayaWithSslEnv =
|
||||
pkgs.writeScriptBin "h" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
export SSL_CERT_FILE=~/.config/protonmail/bridge/cert.pem
|
||||
exec ${himalaya}/bin/himalaya $*
|
||||
'';
|
||||
himalaya = import ./himalaya.nix { inherit pkgs system inputs; };
|
||||
# Helper to read and display the (HTML) email message in Markdown,
|
||||
# highlighted with pager.
|
||||
himalayaReadMail =
|
||||
pkgs.writeScriptBin "h-read" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
${himalayaWithSslEnv}/bin/h read $* \
|
||||
${himalaya}/bin/himalaya read $* \
|
||||
| ${pkgs.pandoc}/bin/pandoc -f html -t markdown_strict \
|
||||
| ${pkgs.bat}/bin/bat -l md
|
||||
'';
|
||||
|
|
@ -25,7 +16,7 @@ in
|
|||
# - `h move` with fzf-selector for target folder
|
||||
in
|
||||
[
|
||||
himalayaWithSslEnv
|
||||
himalaya
|
||||
# Helpers
|
||||
himalayaReadMail
|
||||
];
|
||||
10
features/email/himalaya.nix
Normal file
10
features/email/himalaya.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, system, inputs, ... }:
|
||||
let
|
||||
himalaya = inputs.himalaya.outputs.defaultPackage.${system};
|
||||
in
|
||||
# Wrap himalaya to be aware of ProtonMail's bridge cert.
|
||||
pkgs.writeScriptBin "himalaya" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
export SSL_CERT_FILE=~/.config/protonmail/bridge/cert.pem
|
||||
exec ${himalaya}/bin/himalaya $*
|
||||
''
|
||||
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -167,17 +167,17 @@
|
|||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1618072958,
|
||||
"narHash": "sha256-QDKj58ECixtb4EJMWV5D5Lb2xdCgab1Opi4zjQWbDOg=",
|
||||
"lastModified": 1618260938,
|
||||
"narHash": "sha256-sRIKbJKplnAY9uN4QGGVtq4dasRKzmZhjleCUtPvTa8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a73020b2a150322c9832b50baeb0296ba3b13dd7",
|
||||
"rev": "e8893cc489de8ffbe8125fb0d37f05e8023a2d99",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a73020b2a150322c9832b50baeb0296ba3b13dd7",
|
||||
"rev": "e8893cc489de8ffbe8125fb0d37f05e8023a2d99",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
# https://status.nixos.org/
|
||||
#
|
||||
# This ensures that we always use the official # cache.
|
||||
nixpkgs.url = "github:nixos/nixpkgs/a73020b2a150322c9832b50baeb0296ba3b13dd7";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/e8893cc489de8ffbe8125fb0d37f05e8023a2d99";
|
||||
|
||||
nixos-hardware.url = github:NixOS/nixos-hardware/master;
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
|
|
@ -38,7 +38,10 @@
|
|||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.srid = import ./home.nix;
|
||||
home-manager.users.srid = import ./home.nix {
|
||||
inherit inputs system;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
};
|
||||
}
|
||||
] ++ extraModules);
|
||||
};
|
||||
|
|
|
|||
14
home.nix
14
home.nix
|
|
@ -1,8 +1,9 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{ pkgs, inputs, system, ... }:
|
||||
let
|
||||
nix-thunk =
|
||||
(import (builtins.fetchTarball "https://github.com/obsidiansystems/nix-thunk/archive/master.tar.gz") { }).command;
|
||||
himalayaSrc = inputs.himalaya;
|
||||
himalaya = import ./features/email/himalaya.nix { inherit pkgs inputs system; };
|
||||
in
|
||||
{
|
||||
# Let Home Manager install and manage itself.
|
||||
|
|
@ -73,8 +74,16 @@ in
|
|||
vimAlias = true;
|
||||
# withNodeJs = true;
|
||||
|
||||
extraPackages = [
|
||||
himalaya
|
||||
];
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-nix
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "himalaya";
|
||||
src = himalayaSrc + "/vim";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
|
|
@ -84,6 +93,7 @@ in
|
|||
g = "git";
|
||||
t = "tig";
|
||||
l = "ls --color=always";
|
||||
h = "${himalaya}/bin/himalaya";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue