mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 17:17:22 +01:00
feat: add time conversion scripts
This commit is contained in:
parent
02adc13792
commit
86de91c6e3
5 changed files with 66 additions and 0 deletions
|
|
@ -1466,6 +1466,8 @@ Note: The structure of generating the packages was changed in commit =2cf03a3 re
|
||||||
"github-notifications"
|
"github-notifications"
|
||||||
"screenshare"
|
"screenshare"
|
||||||
"bootstrap"
|
"bootstrap"
|
||||||
|
"t2ts"
|
||||||
|
"ts2t"
|
||||||
];
|
];
|
||||||
mkPackages = names: builtins.listToAttrs (map (name: {
|
mkPackages = names: builtins.listToAttrs (map (name: {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
@ -2208,6 +2210,46 @@ This program sets up a new NixOS host.
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
**** t2ts
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: h:5ad99997-e54c-4f0b-9ab7-15f76b1e16e1
|
||||||
|
:END:
|
||||||
|
|
||||||
|
This script allows for quick git branch switching.
|
||||||
|
|
||||||
|
#+begin_src nix :tangle pkgs/t2ts/default.nix
|
||||||
|
{ writeShellApplication }:
|
||||||
|
|
||||||
|
writeShellApplication {
|
||||||
|
name = "t2ts";
|
||||||
|
runtimeInputs = [ ];
|
||||||
|
text = ''
|
||||||
|
date -d"$1" +%s
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
**** ts2t
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: h:5ad99997-e54c-4f0b-9ab7-15f76b1e16e1
|
||||||
|
:END:
|
||||||
|
|
||||||
|
This script allows for quick git branch switching.
|
||||||
|
|
||||||
|
#+begin_src nix :tangle pkgs/ts2t/default.nix
|
||||||
|
{ writeShellApplication }:
|
||||||
|
|
||||||
|
writeShellApplication {
|
||||||
|
name = "ts2t";
|
||||||
|
runtimeInputs = [ ];
|
||||||
|
text = ''
|
||||||
|
date -d @"$1" 2>/dev/null || date -r "$1"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** Overlays (additions, overrides, nixpkgs-stable)
|
*** Overlays (additions, overrides, nixpkgs-stable)
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: h:5e3e21e0-57af-4dad-b32f-6400af9b7aab
|
:CUSTOM_ID: h:5e3e21e0-57af-4dad-b32f-6400af9b7aab
|
||||||
|
|
@ -6785,6 +6827,8 @@ This is just a separate container for derivations defined in [[#h:64a5cc16-6b16-
|
||||||
github-notifications
|
github-notifications
|
||||||
screenshare
|
screenshare
|
||||||
hm-specialisation
|
hm-specialisation
|
||||||
|
t2ts
|
||||||
|
ts2t
|
||||||
|
|
||||||
(pkgs.writeScriptBin "project" ''
|
(pkgs.writeScriptBin "project" ''
|
||||||
#! ${pkgs.bash}/bin/bash
|
#! ${pkgs.bash}/bin/bash
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ let
|
||||||
"github-notifications"
|
"github-notifications"
|
||||||
"screenshare"
|
"screenshare"
|
||||||
"bootstrap"
|
"bootstrap"
|
||||||
|
"t2ts"
|
||||||
|
"ts2t"
|
||||||
];
|
];
|
||||||
mkPackages = names: builtins.listToAttrs (map
|
mkPackages = names: builtins.listToAttrs (map
|
||||||
(name: {
|
(name: {
|
||||||
|
|
|
||||||
9
pkgs/t2ts/default.nix
Normal file
9
pkgs/t2ts/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ writeShellApplication }:
|
||||||
|
|
||||||
|
writeShellApplication {
|
||||||
|
name = "t2ts";
|
||||||
|
runtimeInputs = [ ];
|
||||||
|
text = ''
|
||||||
|
date -d"$1" +%s
|
||||||
|
'';
|
||||||
|
}
|
||||||
9
pkgs/ts2t/default.nix
Normal file
9
pkgs/ts2t/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ writeShellApplication }:
|
||||||
|
|
||||||
|
writeShellApplication {
|
||||||
|
name = "ts2t";
|
||||||
|
runtimeInputs = [ ];
|
||||||
|
text = ''
|
||||||
|
date -d @"$1" 2>/dev/null || date -r "$1"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
github-notifications
|
github-notifications
|
||||||
screenshare
|
screenshare
|
||||||
hm-specialisation
|
hm-specialisation
|
||||||
|
t2ts
|
||||||
|
ts2t
|
||||||
|
|
||||||
(pkgs.writeScriptBin "project" ''
|
(pkgs.writeScriptBin "project" ''
|
||||||
#! ${pkgs.bash}/bin/bash
|
#! ${pkgs.bash}/bin/bash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue