modularize time-tracking
This commit is contained in:
		
							parent
							
								
									4e86eedc2d
								
							
						
					
					
						commit
						4ca2440280
					
				
							
								
								
									
										36
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										36
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							@ -241,11 +241,11 @@
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1736373539,
 | 
			
		||||
        "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
 | 
			
		||||
        "lastModified": 1739757849,
 | 
			
		||||
        "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
 | 
			
		||||
        "owner": "nix-community",
 | 
			
		||||
        "repo": "home-manager",
 | 
			
		||||
        "rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
 | 
			
		||||
        "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
@ -420,11 +420,11 @@
 | 
			
		||||
    },
 | 
			
		||||
    "nixos-hardware": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1737359802,
 | 
			
		||||
        "narHash": "sha256-utplyRM6pqnN940gfaLFBb9oUCSzkan86IvmkhsVlN8=",
 | 
			
		||||
        "lastModified": 1739798439,
 | 
			
		||||
        "narHash": "sha256-GyipmjbbQEaosel/+wq1xihCKbv0/e1LU00x/8b/fP4=",
 | 
			
		||||
        "owner": "NixOS",
 | 
			
		||||
        "repo": "nixos-hardware",
 | 
			
		||||
        "rev": "61c79181e77ef774ab0468b28a24bc2647d498d6",
 | 
			
		||||
        "rev": "3e2ea8a49d4d76276b0f4e2041df8ca5c0771371",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
@ -452,11 +452,11 @@
 | 
			
		||||
    },
 | 
			
		||||
    "nixpkgs": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1737299813,
 | 
			
		||||
        "narHash": "sha256-Qw2PwmkXDK8sPQ5YQ/y/icbQ+TYgbxfjhgnkNJyT1X8=",
 | 
			
		||||
        "lastModified": 1739923778,
 | 
			
		||||
        "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=",
 | 
			
		||||
        "owner": "nixos",
 | 
			
		||||
        "repo": "nixpkgs",
 | 
			
		||||
        "rev": "107d5ef05c0b1119749e381451389eded30fb0d5",
 | 
			
		||||
        "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
@ -530,11 +530,11 @@
 | 
			
		||||
    },
 | 
			
		||||
    "nixpkgs_2": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1737062831,
 | 
			
		||||
        "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=",
 | 
			
		||||
        "lastModified": 1739866667,
 | 
			
		||||
        "narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
 | 
			
		||||
        "owner": "nixos",
 | 
			
		||||
        "repo": "nixpkgs",
 | 
			
		||||
        "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c",
 | 
			
		||||
        "rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
@ -551,11 +551,11 @@
 | 
			
		||||
        "treefmt-nix": "treefmt-nix"
 | 
			
		||||
      },
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1737379832,
 | 
			
		||||
        "narHash": "sha256-BLdFffOLNsh02U9RUFxr3LeQAAsIr8NDrILIpV3te4c=",
 | 
			
		||||
        "lastModified": 1740048753,
 | 
			
		||||
        "narHash": "sha256-2t/4U/39d8kvon9g+qqHd2Mjo5uu2T4r+CMHWX1oU+M=",
 | 
			
		||||
        "owner": "nix-community",
 | 
			
		||||
        "repo": "NUR",
 | 
			
		||||
        "rev": "4cb6b90dd6d4a74d9ffb372fef7749c77e6538f3",
 | 
			
		||||
        "rev": "37f8ad3ed97ec483592c40a1d816f0e3b80cbdcf",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
@ -677,11 +677,11 @@
 | 
			
		||||
    },
 | 
			
		||||
    "unstable": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1737264083,
 | 
			
		||||
        "narHash": "sha256-6QqSrHPN+ZD+7HuadVLuFNUaM8XnmZF3EO7QViM1b80=",
 | 
			
		||||
        "lastModified": 1739863612,
 | 
			
		||||
        "narHash": "sha256-UbtgxplOhFcyjBcNbTVO8+HUHAl/WXFDOb6LvqShiZo=",
 | 
			
		||||
        "owner": "nixos",
 | 
			
		||||
        "repo": "nixpkgs",
 | 
			
		||||
        "rev": "aa6ae0afa6adeb5c202a168e51eda1d3da571117",
 | 
			
		||||
        "rev": "632f04521e847173c54fa72973ec6c39a371211c",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
 | 
			
		||||
@ -20,6 +20,8 @@
 | 
			
		||||
 | 
			
		||||
  profiles.games.enable = true;
 | 
			
		||||
 | 
			
		||||
  profiles.timetracking.enable = true;
 | 
			
		||||
 | 
			
		||||
  home.packages = [
 | 
			
		||||
      pkgs.unstable.osu-lazer-bin
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
@ -18,31 +18,14 @@
 | 
			
		||||
  profiles.xsession.enable = true;
 | 
			
		||||
  profiles.zsh.enable = true;
 | 
			
		||||
 | 
			
		||||
  profiles.games.enable = true;
 | 
			
		||||
 | 
			
		||||
  profiles.timetracking.enable = true;
 | 
			
		||||
  
 | 
			
		||||
  services.gammastep =  {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    dawnTime = "7:00-8:15";
 | 
			
		||||
    duskTime = "21:30-22:30";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  services.activitywatch = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    watchers = {
 | 
			
		||||
      aw-watcher-afk = {
 | 
			
		||||
        package = pkgs.activitywatch;
 | 
			
		||||
        settings = {
 | 
			
		||||
          timeout = 300;
 | 
			
		||||
          poll_time = 2;
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      aw-watcher-window = {
 | 
			
		||||
        package = pkgs.activitywatch;
 | 
			
		||||
        settings = {
 | 
			
		||||
          poll_time = 1;
 | 
			
		||||
          # exclude_title = true;
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  profiles.games.enable = true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -7,5 +7,6 @@
 | 
			
		||||
    ./gui.nix
 | 
			
		||||
    ./non-nixos.nix
 | 
			
		||||
    ./games
 | 
			
		||||
    ./timetracking
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										30
									
								
								home/profiles/timetracking/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								home/profiles/timetracking/default.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,30 @@
 | 
			
		||||
{ config, lib, pkgs, overlays, ... }:
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.profiles.timetracking;
 | 
			
		||||
in {
 | 
			
		||||
  options.profiles.timetracking = {
 | 
			
		||||
    enable = lib.mkEnableOption "doin timetracking";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = lib.mkIf cfg.enable {  
 | 
			
		||||
    services.activitywatch = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      watchers = {
 | 
			
		||||
        aw-watcher-afk = {
 | 
			
		||||
          package = pkgs.activitywatch;
 | 
			
		||||
          settings = {
 | 
			
		||||
            timeout = 300;
 | 
			
		||||
            poll_time = 2;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
        aw-watcher-window = {
 | 
			
		||||
          package = pkgs.activitywatch;
 | 
			
		||||
          settings = {
 | 
			
		||||
            poll_time = 1;
 | 
			
		||||
            # exclude_title = true;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user