mirror of
https://github.com/kmein/niveum
synced 2026-03-30 01:01:10 +02:00
Compare commits
5 Commits
4871d8d0d8
...
2e13dfe565
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e13dfe565 | |||
| edf26867b1 | |||
| ad1d36cd0b | |||
| d51ffe9735 | |||
| 527439cf9d |
@@ -4,7 +4,18 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (import ../lib) defaultApplications theme;
|
inherit (import ../lib) defaultApplications theme;
|
||||||
|
sgr = code: string: ''\u001b[${code}m${string}\u001b[0m'';
|
||||||
in {
|
in {
|
||||||
|
environment.systemPackages = [
|
||||||
|
(pkgs.writers.writeDashBin "notifications" ''
|
||||||
|
${pkgs.dunst}/bin/dunstctl history \
|
||||||
|
| ${pkgs.jq}/bin/jq -r '
|
||||||
|
.data[]
|
||||||
|
| map("${sgr "90" ''\(.appname.data)''} ${sgr "1" ''\(.summary.data)''} ${sgr "31" ''\(.body.data | gsub("\n"; " | "))''}")
|
||||||
|
| join("\n")'
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.users.me.services.dunst = {
|
home-manager.users.me.services.dunst = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconTheme = (theme pkgs).icon;
|
iconTheme = (theme pkgs).icon;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ in {
|
|||||||
obsidian
|
obsidian
|
||||||
anki-bin # flashcards
|
anki-bin # flashcards
|
||||||
jbofihe # lojbanic software
|
jbofihe # lojbanic software
|
||||||
zoom-us # video conferencing
|
unstablePackages.zoom-us # video conferencing
|
||||||
alejandra # nix formatter
|
alejandra # nix formatter
|
||||||
pdfgrep # search in pdf
|
pdfgrep # search in pdf
|
||||||
pdftk # pdf toolkit
|
pdftk # pdf toolkit
|
||||||
|
|||||||
@@ -174,6 +174,7 @@
|
|||||||
config.allowUnfreePredicate = pkg:
|
config.allowUnfreePredicate = pkg:
|
||||||
builtins.elem (nixpkgs-unstable.lib.getName pkg) [
|
builtins.elem (nixpkgs-unstable.lib.getName pkg) [
|
||||||
"obsidian"
|
"obsidian"
|
||||||
|
"zoom"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
User = "panoptikon";
|
User = "panoptikon";
|
||||||
Group = "panoptikon";
|
Group = "panoptikon";
|
||||||
WorkingDirectory = "/var/lib/panoptikon";
|
WorkingDirectory = "/var/lib/panoptikon";
|
||||||
RestartSec = "60";
|
RestartSec = toString (60 * 60);
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
LoadCredential = watcherOptions.loadCredential;
|
LoadCredential = watcherOptions.loadCredential;
|
||||||
};
|
};
|
||||||
@@ -124,16 +124,16 @@
|
|||||||
|
|
||||||
${watcherOptions.script} > ${watcherName}
|
${watcherOptions.script} > ${watcherName}
|
||||||
|
|
||||||
if [ -n "$(${pkgs.git}/bin/git diff -- ${watcherName})" ]; then
|
diff_output=$(${pkgs.diffutils}/bin/diff --new-file ${watcherName}.old ${watcherName})
|
||||||
|
|
||||||
|
if [ -n "$diff_output" ]; then
|
||||||
${lib.strings.concatMapStringsSep "\n" (reporter: ''
|
${lib.strings.concatMapStringsSep "\n" (reporter: ''
|
||||||
${pkgs.git}/bin/git diff HEAD^ -- ${watcherName} | ${reporter}
|
echo "$diff_output" | ${reporter}
|
||||||
'')
|
'') watcherOptions.reporters}
|
||||||
watcherOptions.reporters}
|
|
||||||
:
|
:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${pkgs.git}/bin/git add ${watcherName}
|
mv ${watcherName} ${watcherName}.old
|
||||||
${pkgs.git}/bin/git commit --message "${watcherName} / $(${pkgs.coreutils}/bin/date -Is)" || :
|
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
cfg.watchers;
|
cfg.watchers;
|
||||||
|
|||||||
Reference in New Issue
Block a user