swatch/flake.nix

43 regels
1.2 KiB
Nix

2020-10-03 04:37:21 -04:00
{
description = "swatch beat internet time";
2020-10-03 06:01:39 -04:00
2020-10-03 04:37:21 -04:00
inputs.nixpkgs.url = github:Nixos/nixpkgs/nixos-20.03;
2020-10-03 06:01:39 -04:00
2020-10-04 19:23:30 -04:00
outputs = { self, nixpkgs }:
2020-10-03 06:01:39 -04:00
let
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems =
f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
version = "1.0.0";
in {
overlay = final: prev: {
2020-10-04 19:25:00 -04:00
swatch = with final; stdenv.mkDerivation {
2020-10-03 06:01:39 -04:00
name = "swatch-${version}";
buildInputs = [ gawk utillinux ];
src = self;
installPhase = ''
mkdir -p $out/bin
cp ./swatch.sh $out/bin/swatch
chmod +x $out/bin/swatch
2020-10-03 04:37:21 -04:00
'';
2020-10-03 06:01:39 -04:00
meta = {
description = "Display the current swatch beats";
longDescription = ''
Prints the current Swatch Internet Time.
Optional short form.
'';
homepage = https://github.com/techieAgnostic/swatch;
maintainers = [ "Shaun Kerr - s@p7.co.nz" ];
2021-04-08 20:34:25 -04:00
platforms = lib.platforms.all;
2020-10-03 06:01:39 -04:00
};
2020-10-03 04:37:21 -04:00
};
};
2020-10-03 06:01:39 -04:00
defaultPackage =
forAllSystems (system: (import nixpkgs {
inherit system;
2020-10-04 19:23:30 -04:00
overlays = [ self.overlay ];
2020-10-03 06:01:39 -04:00
}).swatch);
2020-10-03 04:37:21 -04:00
};
}