From f33f3f19a87e65e14daa72cf6b4f01476c44ed49 Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Sat, 21 Feb 2026 21:27:41 +0100 Subject: [PATCH] nix --- flake.nix | 96 +++++++++++++++++++++++++--------------------- nix/zshell-cli.nix | 25 ++++++++++++ 2 files changed, 78 insertions(+), 43 deletions(-) create mode 100644 nix/zshell-cli.nix diff --git a/flake.nix b/flake.nix index 8ee31a4..2ec3dac 100644 --- a/flake.nix +++ b/flake.nix @@ -9,51 +9,61 @@ }; }; - outputs = { - self, - nixpkgs, - ... - } @ inputs: let - forAllSystems = fn: nixpkgs.lib.genAttrs nixpkgs.lib.platforms.linux (system: fn nixpkgs.legacyPackages.${system}); - in { - formatter = forAllSystems (pkgs: pkgs.nixfmt); + outputs = + { + self, + nixpkgs, + ... + }@inputs: + let + forAllSystems = + fn: nixpkgs.lib.genAttrs nixpkgs.lib.platforms.linux (system: fn nixpkgs.legacyPackages.${system}); + in + { + formatter = forAllSystems (pkgs: pkgs.nixfmt); - packages = forAllSystems (pkgs: let - pythonEnv = pkgs.python3.withPackages (ps: [ - ps.pillow - ps.materialyoucolor - ]); - in rec { - zshell = pkgs.callPackage ./nix { - rev = self.rev or self.dirtyRev; - stdenv = pkgs.clangStdenv; - quickshell = inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default.override { - withX11 = false; - withI3 = false; - }; - app2unit = pkgs.callPackage ./nix/app2unit.nix {inherit pkgs;}; + packages = forAllSystems ( + pkgs: + let + pythonEnv = pkgs.python3.withPackages (ps: [ + ps.pillow + ps.materialyoucolor + ]); + in + rec { + zshell = pkgs.callPackage ./nix { + rev = self.rev or self.dirtyRev; + stdenv = pkgs.clangStdenv; + quickshell = inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default.override { + withX11 = false; + withI3 = false; + }; + app2unit = pkgs.callPackage ./nix/app2unit.nix { inherit pkgs; }; + zshell-cli = pkgs.callPackage ./nix/zshell-cli.nix { inherit pkgs; }; - inherit pythonEnv; - }; + inherit pythonEnv; + }; - default = zshell; - }); + default = zshell; + } + ); - devShells = forAllSystems (pkgs: { - default = let - shell = self.packages.${pkgs.stdenv.hostPlatform.system}.zshell; - in - pkgs.mkShell.override {stdenv = shell.stdenv;} { - inputsFrom = [ - shell - shell.Plugins - ]; - packages = with pkgs; [ - material-symbols - rubik - nerd-fonts.caskaydia-cove - ]; - }; - }); - }; + devShells = forAllSystems (pkgs: { + default = + let + shell = self.packages.${pkgs.stdenv.hostPlatform.system}.zshell; + in + pkgs.mkShell.override { stdenv = shell.stdenv; } { + inputsFrom = [ + shell + shell.Plugins + ]; + packages = with pkgs; [ + material-symbols + rubik + nerd-fonts.caskaydia-cove + ]; + }; + }); + }; } diff --git a/nix/zshell-cli.nix b/nix/zshell-cli.nix new file mode 100644 index 0000000..c533f2d --- /dev/null +++ b/nix/zshell-cli.nix @@ -0,0 +1,25 @@ +{ + python3, +}: +python3.pkgs.buildPythonApplication { + pname = "zshell-cli"; + version = "0.1.0"; + src = ./cli/.; + pyproject = true; + + build-system = with python3.pkgs; [ + hatch-vcs + hatchling + ]; + + dependencies = with python3.pkgs; [ + materialyoucolor + pillow + ]; + + pythonImportsCheck = [ "zshell" ]; + + nativeBuildInputs = [ installShellFiles ]; + + SETUPTOOLS_SCM_PRETEND_VERSION = 1; +}