unify papis config dir
This commit is contained in:
parent
575a4bd26f
commit
6c1cfc9afa
1 changed files with 16 additions and 11 deletions
|
|
@ -1,10 +1,15 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
# Platform-aware papis config directory
|
||||
papisConfigDir = if pkgs.stdenv.isDarwin then "Library/Application Support/papis" else ".config/papis";
|
||||
in
|
||||
|
||||
{
|
||||
# Install papis package
|
||||
home.packages = [ pkgs.papis ];
|
||||
# Papis configuration
|
||||
home.file.${if pkgs.stdenv.isDarwin then "Library/Application Support/papis/config" else ".config/papis/config"}.text = ''
|
||||
home.file."${papisConfigDir}/config".text = ''
|
||||
[settings]
|
||||
default-library = main
|
||||
editor = nvim
|
||||
|
|
@ -39,7 +44,7 @@
|
|||
'';
|
||||
|
||||
# Papis bibliography template
|
||||
home.file."Library/Application Support/papis/templates/bibitem.template".text = ''
|
||||
home.file."${papisConfigDir}/templates/bibitem.template".text = ''
|
||||
{doc[title]} ({doc[year]}). {doc[author]}.
|
||||
Venue: {doc[journal]} {doc[booktitle]} {doc[eprinttype]} {doc[eprint]} {doc[eventtitle]}
|
||||
Tags: {doc[tags]}
|
||||
|
|
@ -48,7 +53,7 @@
|
|||
'';
|
||||
|
||||
# Papis BibTeX template
|
||||
home.file."Library/Application Support/papis/templates/bibtex.template".text = ''
|
||||
home.file."${papisConfigDir}/templates/bibtex.template".text = ''
|
||||
@{doc[type]}{{{doc[ref]},
|
||||
author = {{{doc[author]}}},
|
||||
title = {{{doc[title]}}},
|
||||
|
|
@ -64,23 +69,23 @@
|
|||
'';
|
||||
|
||||
# Papis citation template
|
||||
home.file."Library/Application Support/papis/templates/citation.template".text = ''
|
||||
home.file."${papisConfigDir}/templates/citation.template".text = ''
|
||||
{doc[author]}. "{doc[title]}." {doc[journal]}{doc[booktitle]} ({doc[year]}).
|
||||
'';
|
||||
|
||||
# Shell aliases for papis workflow
|
||||
programs.zsh.shellAliases = {
|
||||
# Bibliography formatting
|
||||
pals = "papis list --template \"$HOME/Library/Application Support/papis/templates/bibitem.template\"";
|
||||
pals = "papis list --template \"$HOME/${papisConfigDir}/templates/bibitem.template\"";
|
||||
|
||||
# Add new entry with bibtex
|
||||
paadd = "papis add --from bibtex";
|
||||
|
||||
# BibTeX export
|
||||
pabib = "papis list --template \"$HOME/Library/Application Support/papis/templates/bibtex.template\"";
|
||||
pabib = "papis list --template \"$HOME/${papisConfigDir}/templates/bibtex.template\"";
|
||||
|
||||
# Citation formatting
|
||||
pacite = "papis list --template \"$HOME/Library/Application Support/papis/templates/citation.template\"";
|
||||
pacite = "papis list --template \"$HOME/${papisConfigDir}/templates/citation.template\"";
|
||||
|
||||
# File operations
|
||||
paurl = "papis addto -u";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue