forked from Shinonome/caelestia-cli
feat: add nix flake
This commit is contained in:
+82
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user