1
0
Fork 0

Add zettelkasten.nix

This commit is contained in:
Malte Brandy 2020-07-02 01:20:18 +02:00
parent aadf9426a9
commit e03eede2d3
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
6 changed files with 21 additions and 10 deletions

View file

@ -58,6 +58,7 @@ in {
];
apolloConfig = imports:
makeConfig "apollo" (imports ++ [
./roles/zettelkasten.nix
./battery.nix
./mpd.nix
./mpclient.nix

View file

@ -72,9 +72,9 @@ let
filetypes = [ "nix" ];
};
haskell = {
command = "ghcide";
command = "haskell-language-server";
args = [ "--lsp" ];
rootPatterns = [ ".hie-bios" ];
rootPatterns = [ ".hie-bios" "cabal.project" ];
filetypes = [ "hs" "lhs" "haskell" ];
};
};

View file

@ -2,14 +2,13 @@
let
pythia-path = "${config.home.homeDirectory}/documents/pythia";
pythia = pkgs.writeShellScriptBin "pythia" ''
datei=${pythia-path}/$(date +%Y-%m-%d)
touch $datei
datei=${config.home.homeDirectory}/git/zettelkasten/pythia-$(date +%Y-%m-%d).md
if [[ ! -a $datei ]]; then
neuron new --id pythia-$(date +%Y-%m-%d) Tagebucheintrag
sed -i 's/date:/tags:\n - Pythia\ndate:/' $datei
fi
vim $datei
grep TODO: $datei | sed 's/TODO: //' | while read -r line; do task add "$line"; done && sed -i 's/TODO: /Notiert: /' $datei
grep WEAK: $datei | sed 's/WEAK: //' >> ${pythia-path}/schwächen && sed -i 's/WEAK: /Schwäche: /' $datei
grep STRONG: $datei | sed 's/STRONG: //' >> ${pythia-path}/stärken && sed -i 's/STRONG: /Stärke: /' $datei
grep RULE: $datei | sed 's/RULE: //' >> ${pythia-path}/richtlinien && sed -i 's/RULE: /Richtlinie: /' $datei
grep INDICATOR: $datei | sed 's/INDICATOR: //' >> ${pythia-path}/warnzeichen && sed -i 's/INDICATOR: /Warnzeichen: /' $datei
'';
printslow = pkgs.writeScriptBin "printslow" ''
#!${pkgs.python3}/bin/python

View file

@ -0,0 +1,11 @@
{ pkgs, config, ... }:
let
notesDir = "${config.home.homeDirectory}/git/zettelkasten";
cmd = "${pkgs.myHaskellPackages.neuron}/bin/neuron -d ${notesDir} rib -wS";
in {
systemd.user.services.neuron = {
Unit.Description = "Neuron zettelkasten service";
Install.WantedBy = [ "graphical-session.target" ];
Service.ExecStart = cmd;
};
}

View file

@ -4,7 +4,7 @@
Unit = { Description = "Update taskwarrior tasks"; };
Service = {
Type = "oneshot";
Environment = "PATH=${pkgs.taskwarrior}/bin";
Environment = "PATH=${pkgs.taskwarrior}/bin:${pkgs.git}/bin";
ExecStart = "${config.home.homeDirectory}/.cargo/bin/update_tasks";
};
};

View file

@ -12,7 +12,7 @@ let
inherit (p)
brittany ormolu releaser cabal-fmt stack ghcid ghcide cabal-install dhall
aeson unordered-containers these neuron taskwarrior pandoc hlint
cabal2nix weeder reflex-dom password optics-th;
cabal2nix weeder reflex-dom password optics-th shh-extras;
} // makeHaskellScriptPackages p;
in {
myHaskellPackages = makeHaskellPackages master.haskellPackages;