about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-05-04 13:41:42 -0700
committerFranck Cuny <franck@fcuny.net>2024-05-04 13:41:42 -0700
commitfe3cf4812657ee972315e0bd0d6e5b0c1e8774c0 (patch)
treee4b5e7be716bb64e69c4d32d43cb85e67c918252
parentdon't install the script for pizza (diff)
downloadworld-fe3cf4812657ee972315e0bd0d6e5b0c1e8774c0.tar.gz
move the slocalc under `src`
-rw-r--r--nix/flake/packages.nix4
-rw-r--r--nix/profiles/home-manager/shell.nix1
-rw-r--r--packages/slocalc/default.nix25
-rw-r--r--pyproject.toml1
-rwxr-xr-xsrc/cli/slocalc.py (renamed from packages/slocalc/slocalc.py)4
5 files changed, 3 insertions, 32 deletions
diff --git a/nix/flake/packages.nix b/nix/flake/packages.nix
index 10c003f..3bfbec5 100644
--- a/nix/flake/packages.nix
+++ b/nix/flake/packages.nix
@@ -6,8 +6,7 @@
   perSystem = { config, pkgs, ... }: {
     overlayAttrs = {
       inherit (config.packages)
-        seqstat
-        slocalc;
+        seqstat;
     };
 
     packages = {
@@ -16,7 +15,6 @@
       ipconverter = pkgs.callPackage "${self}/packages/ipconverter" { };
       robloxenv = pkgs.callPackage "${self}/packages/robloxenv" { };
       seqstat = pkgs.callPackage "${self}/packages/seqstat" { };
-      slocalc = pkgs.callPackage "${self}/packages/slocalc" { };
     };
   };
 }
diff --git a/nix/profiles/home-manager/shell.nix b/nix/profiles/home-manager/shell.nix
index a95558c..2c3734c 100644
--- a/nix/profiles/home-manager/shell.nix
+++ b/nix/profiles/home-manager/shell.nix
@@ -32,7 +32,6 @@
     self.packages.${pkgs.system}.git-broom
     self.packages.${pkgs.system}.ipconverter
     self.packages.${pkgs.system}.seqstat
-    self.packages.${pkgs.system}.slocalc
   ];
 
   xdg = {
diff --git a/packages/slocalc/default.nix b/packages/slocalc/default.nix
deleted file mode 100644
index 114120e..0000000
--- a/packages/slocalc/default.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ lib, python3, stdenvNoCC }:
-
-stdenvNoCC.mkDerivation rec {
-  pname = "slocalc";
-  src = ./slocalc.py;
-  version = "0.1.0";
-
-  buildInputs = [ python3 ];
-  propagatedBuildInputs = [ python3 ];
-
-  dontUnpack = true;
-  dontBuild = true;
-
-  installPhase = ''
-    mkdir -p $out/bin
-    cp $src $out/bin/${pname}
-  '';
-
-  meta = with lib; {
-    description = "Calculate SLO uptime.";
-    license = with licenses; [ mit ];
-    platforms = platforms.unix;
-    maintainers = with maintainers; [ fcuny ];
-  };
-}
diff --git a/pyproject.toml b/pyproject.toml
index 7783aab..63545be 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -65,3 +65,4 @@ known-first-party = ["rbx_nomad"]
 
 [project.scripts]
 pizza = "cli.pizza:main"
+slocalc = "cli.slocalc:cli"
diff --git a/packages/slocalc/slocalc.py b/src/cli/slocalc.py
index e13e850..bc4def8 100755
--- a/packages/slocalc/slocalc.py
+++ b/src/cli/slocalc.py
@@ -10,12 +10,10 @@ quarterly: 0 days, 0 hours, 12 minutes, 57 seconds
 yearly:    0 days, 0 hours, 52 minutes, 33 seconds
 """
 
+import sys
 from typing import Optional
 from datetime import timedelta
 
-import sys
-
-
 seconds_in_hour = 60 * 60