summaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorSoramane <61896496+soramanew@users.noreply.github.com>2025-07-15 17:16:53 +1000
committerSoramane <61896496+soramanew@users.noreply.github.com>2025-07-15 17:16:53 +1000
commitca93616da717f865cf708d1cf26d6964e4231d90 (patch)
treeefc8a110b8dd50881356e7a65a217660a39694a8 /default.nix
parenttheme: use dconf instead of gsettings (diff)
downloadcaelestia-cli-ca93616da717f865cf708d1cf26d6964e4231d90.tar.gz
caelestia-cli-ca93616da717f865cf708d1cf26d6964e4231d90.tar.bz2
caelestia-cli-ca93616da717f865cf708d1cf26d6964e4231d90.zip
feat: add nix flake
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix82
1 files changed, 82 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..904b22d
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,82 @@
+{
+ rev,
+ lib,
+ python3,
+ installShellFiles,
+ swappy,
+ libnotify,
+ slurp,
+ wl-clipboard,
+ cliphist,
+ app2unit,
+ dart-sass,
+ grim,
+ fuzzel,
+ wl-screenrec,
+ dconf,
+ killall,
+ discordBin ? "discord",
+ qtctStyle ? "Fusion",
+}:
+python3.pkgs.buildPythonApplication {
+ pname = "caelestia-cli";
+ version = "${rev}";
+ src = ./.;
+ pyproject = true;
+
+ build-system = with python3.pkgs; [
+ hatch-vcs
+ hatchling
+ ];
+
+ dependencies = with python3.pkgs; [
+ materialyoucolor
+ pillow
+ ];
+
+ pythonImportsCheck = ["caelestia"];
+
+ nativeBuildInputs = [installShellFiles];
+ propagatedBuildInputs = [
+ swappy
+ libnotify
+ slurp
+ wl-clipboard
+ cliphist
+ app2unit
+ dart-sass
+ grim
+ fuzzel
+ wl-screenrec
+ dconf
+ killall
+ ];
+
+ SETUPTOOLS_SCM_PRETEND_VERSION = 1;
+
+ patchPhase = ''
+ # Replace qs config call with nix shell pkg bin
+ substituteInPlace src/caelestia/subcommands/shell.py \
+ --replace-fail '"qs", "-c", "caelestia"' '"caelestia-shell"'
+ substituteInPlace src/caelestia/subcommands/screenshot.py \
+ --replace-fail '"qs", "-c", "caelestia"' '"caelestia-shell"'
+
+ # Use config bin instead of discord
+ substituteInPlace src/caelestia/subcommands/toggle.py \
+ --replace-fail 'discord' ${discordBin}
+
+ # Use config style instead of fusion
+ substituteInPlace src/caelestia/data/templates/qtct.conf \
+ --replace-fail 'Fusion' '${qtctStyle}'
+ '';
+
+ postInstall = "installShellCompletion completions/caelestia.fish";
+
+ meta = {
+ description = "The main control script for the Caelestia dotfiles";
+ homepage = "https://github.com/caelestia-dots/cli";
+ license = lib.licenses.gpl3Only;
+ mainProgram = "caelestia";
+ platforms = lib.platforms.all;
+ };
+}