summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoramane <61896496+soramanew@users.noreply.github.com>2025-07-15 17:12:27 +1000
committerSoramane <61896496+soramanew@users.noreply.github.com>2025-07-15 17:12:27 +1000
commite15d9b79beedad2e77ad1f265c766e61a6cd6681 (patch)
tree4b6f1ca47d1d513e41c9b99dde327795b1208f31
parentlauncher: better launch terminal apps (diff)
downloadcaelestia-shell-e15d9b79beedad2e77ad1f265c766e61a6cd6681.tar.gz
caelestia-shell-e15d9b79beedad2e77ad1f265c766e61a6cd6681.tar.bz2
caelestia-shell-e15d9b79beedad2e77ad1f265c766e61a6cd6681.zip
feat: add nix flake
-rw-r--r--.gitignore1
-rw-r--r--default.nix84
-rw-r--r--flake.lock69
-rw-r--r--flake.nix67
4 files changed, 221 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c4a847d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/result
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..9f440be
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,84 @@
+{
+ rev,
+ lib,
+ stdenv,
+ makeWrapper,
+ makeFontsConf,
+ fish,
+ ddcutil,
+ brightnessctl,
+ app2unit,
+ cava,
+ networkmanager,
+ lm_sensors,
+ grim,
+ swappy,
+ wl-clipboard,
+ libqalculate,
+ inotify-tools,
+ bluez,
+ bash,
+ hyprland,
+ material-symbols,
+ gcc,
+ quickshell,
+ aubio,
+ pipewire,
+}: let
+ runtimeDeps = [
+ fish
+ ddcutil
+ brightnessctl
+ app2unit
+ cava
+ networkmanager
+ lm_sensors
+ grim
+ swappy
+ wl-clipboard
+ libqalculate
+ inotify-tools
+ bluez
+ bash
+ hyprland
+ ];
+ fontconfig = makeFontsConf {
+ fontDirectories = [material-symbols];
+ };
+in
+ stdenv.mkDerivation {
+ pname = "caelestia-shell";
+ version = "${rev}";
+ src = ./.;
+
+ nativeBuildInputs = [gcc makeWrapper];
+ buildInputs = [quickshell aubio pipewire];
+ propogatedBuildInputs = runtimeDeps;
+
+ buildPhase = ''
+ mkdir -p bin
+ g++ -std=c++17 -Wall -Wextra \
+ -I${pipewire.dev}/include/pipewire-0.3 \
+ -I${pipewire.dev}/include/spa-0.2 \
+ -I${aubio}/include/aubio \
+ assets/beat_detector.cpp \
+ -o bin/beat_detector \
+ -lpipewire-0.3 -laubio
+ '';
+
+ installPhase = ''
+ install -Dm755 bin/beat_detector $out/bin/beat_detector
+ makeWrapper ${quickshell}/bin/qs $out/bin/caelestia-shell \
+ --prefix PATH : "${lib.makeBinPath runtimeDeps}" \
+ --set FONTCONFIG_FILE "${fontconfig}" \
+ --set CAELESTIA_BD_PATH $out/bin/beat_detector \
+ --add-flags '-p ${./.}'
+ '';
+
+ meta = {
+ description = "A very segsy desktop shell";
+ homepage = "https://github.com/caelestia-dots/shell";
+ license = lib.licenses.gpl3Only;
+ mainProgram = "caelestia-shell";
+ };
+ }
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..accd66a
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,69 @@
+{
+ "nodes": {
+ "app2unit": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1752557494,
+ "narHash": "sha256-GIcH+k321WBUl//gBypaJkLRMrKDemcSpzADJoyUdec=",
+ "owner": "soramanew",
+ "repo": "app2unit",
+ "rev": "574d764446997e30218a29a6b9871fb1b9c6554d",
+ "type": "github"
+ },
+ "original": {
+ "owner": "soramanew",
+ "repo": "app2unit",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1752480373,
+ "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "quickshell": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1752486994,
+ "narHash": "sha256-/11zPRDdPPn61GXDyvDes9otFTP5lLqmETAtwMdeYWI=",
+ "ref": "refs/heads/master",
+ "rev": "5ac9096c1c63f6940c6b95f1118b540dfe029278",
+ "revCount": 632,
+ "type": "git",
+ "url": "https://git.outfoxxed.me/outfoxxed/quickshell"
+ },
+ "original": {
+ "type": "git",
+ "url": "https://git.outfoxxed.me/outfoxxed/quickshell"
+ }
+ },
+ "root": {
+ "inputs": {
+ "app2unit": "app2unit",
+ "nixpkgs": "nixpkgs",
+ "quickshell": "quickshell"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..78418fa
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,67 @@
+{
+ description = "Desktop shell for Caelestia dots";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+
+ quickshell = {
+ url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ app2unit = {
+ url = "github:soramanew/app2unit";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = {
+ self,
+ nixpkgs,
+ ...
+ } @ inputs: let
+ forAllSystems = fn:
+ nixpkgs.lib.genAttrs nixpkgs.lib.platforms.linux (
+ system: fn nixpkgs.legacyPackages.${system}
+ );
+ in {
+ formatter = forAllSystems (pkgs: pkgs.alejandra);
+
+ packages = forAllSystems (pkgs: rec {
+ caelestia-shell = pkgs.callPackage ./default.nix {
+ rev = self.rev or self.dirtyRev;
+ quickshell = inputs.quickshell.packages.${pkgs.system}.default.override {
+ withX11 = false;
+ withI3 = false;
+ };
+ app2unit = inputs.app2unit.packages.${pkgs.system}.default;
+ };
+ default = caelestia-shell;
+ });
+
+ # devShells = forAllSystems (pkgs: {
+ # default = let
+ # qtDeps = with pkgs.kdePackages; [
+ # inputs.quickshell.packages.${pkgs.system}.default
+ # qtbase
+ # qtdeclarative
+ # ];
+ # qmlPath = pkgs.lib.makeSearchPath "lib/qt-6/qml" qtDeps;
+ # in
+ # pkgs.mkShellNoCC {
+ # inputsFrom = [self.packages.${pkgs.system}.caelestia-shell];
+ # packages =
+ # qtDeps
+ # ++ [
+ # (inputs.caelestia-cli.packages.${pkgs.system}.default.override {
+ # discordBin = "equibop";
+ # qtctStyle = "Breeze";
+ # })
+ # ];
+ # shellHook = ''
+ # export QML2_IMPORT_PATH="$QML2_IMPORT_PATH:${qmlPath}"
+ # '';
+ # };
+ # });
+ };
+}