Add ActivityWatch
This commit is contained in:
parent
c02af259e2
commit
546bc7e2e7
7 changed files with 89 additions and 24 deletions
19
flake.lock
generated
19
flake.lock
generated
|
|
@ -35,22 +35,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1663067291,
|
|
||||||
"narHash": "sha256-1BTrqhLMamWf53sJobtMiUDI91PEw6xF8YEwg2VE8w4=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "d86a4619b7e80bddb6c01bc01a954f368c56d1df",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-22.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1662996720,
|
"lastModified": 1662996720,
|
||||||
|
|
@ -70,8 +54,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2"
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
./users
|
./users
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
|
nixpkgs.overlays = [ (import ./overlay.nix { }) ];
|
||||||
networking.hostName = "nixos-desktop";
|
networking.hostName = "nixos-desktop";
|
||||||
# Allow to externally control MPD
|
# Allow to externally control MPD
|
||||||
networking.firewall.allowedTCPPorts = [ 6600 ];
|
networking.firewall.allowedTCPPorts = [ 6600 ];
|
||||||
|
|
@ -40,6 +41,7 @@
|
||||||
./users
|
./users
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
|
nixpkgs.overlays = [ (import ./overlay.nix { }) ];
|
||||||
networking.hostName = "froidmpa-laptop";
|
networking.hostName = "froidmpa-laptop";
|
||||||
|
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
|
|
|
||||||
17
overlay.nix
Normal file
17
overlay.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{}:
|
||||||
|
final: prev:
|
||||||
|
{
|
||||||
|
ncmpcpp = prev.ncmpcpp.override { visualizerSupport = true; };
|
||||||
|
firefox = prev.firefox.override { pkcs11Modules = [ prev.eid-mw ]; };
|
||||||
|
exodus = prev.exodus.overrideDerivation (old: {
|
||||||
|
src = prev.fetchurl {
|
||||||
|
url = "https://downloads.exodus.com/releases/${old.pname}-linux-x64-${old.version}.zip";
|
||||||
|
sha256 = "sha256-rizVb3Yckd0ionRunT7VRq+wJvtNffkk3QzxTYQgvnY=";
|
||||||
|
};
|
||||||
|
unpackCmd = ''
|
||||||
|
${prev.unzip}/bin/unzip "$src" -x "Exodus*/lib*so"
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
activitywatch-bin = prev.callPackage ./packages/activitywatch.nix { };
|
||||||
|
}
|
||||||
37
packages/activitywatch.nix
Normal file
37
packages/activitywatch.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchzip
|
||||||
|
, autoPatchelfHook
|
||||||
|
, libGL
|
||||||
|
, freetype
|
||||||
|
, libdrm
|
||||||
|
, fontconfig
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "activitywatch-bin";
|
||||||
|
version = "0.11.0";
|
||||||
|
|
||||||
|
src = fetchzip {
|
||||||
|
url =
|
||||||
|
"https://github.com/ActivityWatch/activitywatch/releases/download/v${version}/activitywatch-v${version}-linux-x86_64.zip";
|
||||||
|
sha256 = "CYLhSxlKMHuIEMmqtN8o/lhwTfcR+DInFxVjZOJ1fHc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ autoPatchelfHook libGL freetype libdrm fontconfig ];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp -r * $out/
|
||||||
|
ln -s $out/aw-qt $out/bin/aw-qt
|
||||||
|
ln -s $out/aw-server/aw-server $out/bin/aw-server
|
||||||
|
ln -s $out/aw-watcher-afk/aw-watcher-afk $out/bin/aw-watcher-afk
|
||||||
|
ln -s $out/aw-watcher-window/aw-watcher-window $out/bin/aw-watcher-window
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://activitywatch.net/";
|
||||||
|
description = "The best free and open-source automated time tracker. Cross-platform, extensible, privacy-focused.";
|
||||||
|
license = licenses.mpl20;
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -14,11 +14,10 @@
|
||||||
./froidmpa/vscode.nix
|
./froidmpa/vscode.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config = {
|
nixpkgs = {
|
||||||
|
overlays = [ (import ../overlay.nix { }) ];
|
||||||
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
packageOverrides = pkgs: {
|
|
||||||
ncmpcpp = pkgs.ncmpcpp.override { visualizerSupport = true; };
|
|
||||||
firefox = pkgs.firefox.override { pkcs11Modules = [ pkgs.eid-mw ]; };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -215,5 +214,31 @@
|
||||||
dolphinEmu
|
dolphinEmu
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
systemd.user.services.activitywatch = {
|
||||||
|
Unit.Description = "Start ActivityWatch";
|
||||||
|
Service.Type = "simple";
|
||||||
|
Service.ExecStart = "${pkgs.activitywatch-bin}/bin/aw-server";
|
||||||
|
Install.WantedBy = [ "default.target" ];
|
||||||
|
Service.Restart = "on-failure";
|
||||||
|
Service.RestartSec = 5;
|
||||||
|
};
|
||||||
|
systemd.user.services.activitywatch-afk = {
|
||||||
|
Unit.Description = "Start ActivityWatch AFK";
|
||||||
|
Service.Type = "simple";
|
||||||
|
Service.ExecStart = "${pkgs.activitywatch-bin}/bin/aw-watcher-afk";
|
||||||
|
Install.WantedBy = [ "default.target" ];
|
||||||
|
Service.Restart = "on-failure";
|
||||||
|
Service.RestartSec = 5;
|
||||||
|
};
|
||||||
|
systemd.user.services.activitywatch-window = {
|
||||||
|
Unit.Description = "Start ActivityWatch Window";
|
||||||
|
Service.Type = "simple";
|
||||||
|
Service.ExecStart = "${pkgs.activitywatch-bin}/bin/aw-watcher-window";
|
||||||
|
Install.WantedBy = [ "default.target" ];
|
||||||
|
Service.Restart = "on-failure";
|
||||||
|
Service.RestartSec = 5;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ myFocusFollowsMouse = True
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
xmproc <- spawnPipe "xmobar .xmonad/xmobarrc"
|
xmproc <- spawnPipe "xmobar .xmonad/xmobarrc"
|
||||||
xmonad $ docks $ myConfig xmproc
|
xmonad $ ewmh . docks $ myConfig xmproc
|
||||||
|
|
||||||
myConfig xmproc = azertyConfig {
|
myConfig xmproc = azertyConfig {
|
||||||
terminal = myTerminal,
|
terminal = myTerminal,
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
window = {
|
window = {
|
||||||
|
title = "Alacritty";
|
||||||
padding = {
|
padding = {
|
||||||
x = 5;
|
x = 5;
|
||||||
y = 5;
|
y = 5;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue