Skip to content

Commit

Permalink
feat: support for time tracker and refactored pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarrio committed Nov 21, 2024
1 parent ecc6bac commit b611cbd
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 17 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions home-manager/mixins/console/tmux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ let
comment_grey = "#5c6370";
};
};
themeFile = pkgs.templateFile "onedark-theme.tmux" ./tmux/theme.tmux.tpl theme;
tmuxConfig = pkgs.templateFile "tmux.conf" ./tmux/tmux.conf.tpl { theme.path = "${themeFile}"; };
themeFile = pkgs.mustacheTemplate "onedark-theme.tmux" ./tmux/theme.tmux.tpl theme;
tmuxConfig = pkgs.mustacheTemplate "tmux.conf" ./tmux/tmux.conf.tpl { theme.path = "${themeFile}"; };
in
{
home.file.".tmux.conf".source = "${tmuxConfig}";
Expand Down
5 changes: 5 additions & 0 deletions home-manager/mixins/console/zeit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ pkgs, config, ... }: {
home.sessionVariables.ZEIT_DB = "${config.xdg.configHome}/zeit/zeit.db";

home.packages = with pkgs; [ zeit ];
}
2 changes: 1 addition & 1 deletion home-manager/mixins/desktop/skhd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let
};
};

skhdConfig = pkgs.templateFile "skhdrc" ./skhd/skhd.conf.tpl templateValues;
skhdConfig = pkgs.mustacheTemplate "skhdrc" ./skhd/skhd.conf.tpl templateValues;
in
{
home.file.".config/skhd/skhdrc".source = "${skhdConfig}";
Expand Down
3 changes: 2 additions & 1 deletion home-manager/mixins/users/tcarrio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ in
imports =
[
../../console/charm-freeze.nix
../../console/zeit.nix
../../desktop/discord.nix
]
++ lib.optional (builtins.pathExists (./. + "/hosts/${hostname}.nix")) ./hosts/${hostname}.nix
Expand Down Expand Up @@ -36,7 +37,7 @@ Host glass
packages = with pkgs; [
git-absorb
thefuck
tte
cmatrix
];
};

Expand Down
4 changes: 2 additions & 2 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
additions = final: prev:
(import ../pkgs { pkgs = final; })
// rec {
templateFile = name: template: data:
mustacheTemplate = name: template: data:
prev.stdenv.mkDerivation {
name = "${name}";

Expand All @@ -29,7 +29,7 @@
'';
};

templateFileContent = n: t: d: builtins.readFile "${templateFile n t d}";
mustacheTemplateContent = n: t: d: builtins.readFile "${mustacheTemplate n t d}";
};

# This one contains whatever you want to overlay
Expand Down
9 changes: 1 addition & 8 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,5 @@

{ pkgs ? (import ../nixpkgs.nix) { } }: {
ente-photos-desktop = pkgs.callPackage ./ente.nix { };
tte = pkgs.callPackage
(pkgs.fetchFromGitHub {
owner = "ChrisBuilds";
repo = "terminaltexteffects";
rev = "7fd566567cdf3bafe8bf8b8866ca84afc8704ebd";
hash = "sha256-33Gp5dkAtbdmqyeLDKKiCF9735GM4YX/tY+S/p7+KMA=";
})
{ };
zeit = pkgs.callPackage ./zeit.nix { };
}
7 changes: 7 additions & 0 deletions pkgs/tte.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DEPRECATED: This package is now part of Nixpkgs unstable as of 24.11.
{ pkgs }: pkgs.fetchFromGitHub {
owner = "ChrisBuilds";
repo = "terminaltexteffects";
rev = "7fd566567cdf3bafe8bf8b8866ca84afc8704ebd";
hash = "sha256-33Gp5dkAtbdmqyeLDKKiCF9735GM4YX/tY+S/p7+KMA=";
}
26 changes: 26 additions & 0 deletions pkgs/zeit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
pname = "zeit";
version = "0.0.8";

src = fetchFromGitHub {
owner = "mrusme";
repo = "zeit";
rev = "v${version}";
hash = "sha256-6zRHEaa7mwM077pFbNMEuNuTr6xy0C7YJBeF047juoo=";
};

vendorHash = "sha256-60vc5kv2oelgROeWOueDGdiIBk6cAI1NMWDOzzlKHs8=";

ldflags = [ "-X github.com/mrusme/zeit/z.VERSION=${version}" ];

meta = with lib; {
description = "Zeit, erfassen. A command line tool for tracking time spent on activities.";
mainProgram = "zeit";
homepage = "https://github.com/mrusme/zeit";
changelog = "https://github.com/mrusme/zeit/releases/tag/v${version}";
license = licenses.gpl3;
maintainers = with maintainers; [ tcarrio ];
};
}

0 comments on commit b611cbd

Please sign in to comment.