From 49295ab57338de36d1f9b72e02c25d632e85eea3 Mon Sep 17 00:00:00 2001 From: "Chris (wolcen) Thompson" Date: Wed, 13 Nov 2024 20:52:15 -0500 Subject: [PATCH] Make nix do things --- README.md | 10 ++++++++++ shell.nix | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 shell.nix diff --git a/README.md b/README.md index 9d34490..19abc58 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,14 @@ NOTE: Instructions are written with the assumption that the command `python` poi ### NixOS +``` +nix-shell +python pomodoroprompt.py +``` +...or: +`alias pom="nix-shell --command 'python pomodoroprompt.py'` + +You need not install Python (and it is not recommended). Should you insist, this may be correct: ``` python python311Packages.playsound @@ -20,6 +28,8 @@ python311Packages.pycairo python311Packages.pygobject3 python311Packages.pytz python311Packages.tzlocal +wrapGAppsHook +gobject-introspection ``` (And skip the last two lines below, the pip install, as the above is the Nix way of doing that.) diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..484bf23 --- /dev/null +++ b/shell.nix @@ -0,0 +1,22 @@ +# shell.nix +let + # We pin to a specific nixpkgs commit for reproducibility. + # Last updated: 2024-04-29. Check for new commits at https://status.nixos.org. + pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/aebe249544837ce42588aa4b2e7972222ba12e8f.tar.gz") {}; +in pkgs.mkShell { + packages = [ + (pkgs.python3.withPackages (python-pkgs: with python-pkgs; [ + # select Python packages here + playsound + pycairo + pytz + tzlocal + # For Qt: + # pyside6 + # Using GTK: + pygobject3 + ])) + pkgs.wrapGAppsHook + pkgs.gobject-introspection + ]; +}