Based on ones in https://github.com/rwxrob/dot.
This commit is contained in:
parent
9d8cacf2e3
commit
c79e19efe5
2 changed files with 67 additions and 0 deletions
35
modules/scripts/hnow.nix
Normal file
35
modules/scripts/hnow.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ lib, withSystem, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
name = "hnow";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
psArgs@{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
now = withSystem pkgs.system (psArgs: psArgs.config.packages.now);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.${name} = pkgs.writeShellApplication {
|
||||||
|
inherit name;
|
||||||
|
|
||||||
|
runtimeInputs = [
|
||||||
|
psArgs.config.packages.now
|
||||||
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
# Based on https://github.com/rwxrob/dot/blob/main/scripts/hnow.
|
||||||
|
|
||||||
|
echo "== $(${lib.getExe now})"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.homeManager.base =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
32
modules/scripts/now.nix
Normal file
32
modules/scripts/now.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ withSystem, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
name = "now";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
packages.${name} = pkgs.writeShellApplication {
|
||||||
|
inherit name;
|
||||||
|
|
||||||
|
runtimeInputs = with pkgs; [ coreutils ];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
# Based on https://github.com/rwxrob/dot/blob/main/scripts/now.
|
||||||
|
|
||||||
|
out=$(date "+%A, %B %e, %Y, %R %Z")
|
||||||
|
|
||||||
|
echo "''${out// / }"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.modules.homeManager.base =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue