From 8ed99daa2496399c89ff914e30d1388d9e0fa057 Mon Sep 17 00:00:00 2001 From: alsaiduq-lab Date: Sun, 30 Mar 2025 03:33:32 -0600 Subject: [PATCH] updates --- flake.lock | 24 +++++----- home-manager/modules/lazygit.nix | 10 +++++ home-manager/modules/polybar.nix | 12 +---- hosts/local-packages.nix | 44 ++++++++++++++++--- modules/audio.nix | 6 +-- pkgs/default.nix | 40 ++++++++--------- pkgs/python-nginx-language-server/default.nix | 37 ++++++++++++++++ 7 files changed, 117 insertions(+), 56 deletions(-) create mode 100644 pkgs/python-nginx-language-server/default.nix diff --git a/flake.lock b/flake.lock index e79f8d6..e1cd970 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1742670145, - "narHash": "sha256-xQ2F9f+ICAGBp/nNv3ddD2U4ZvzuLOci0u/5lyMXPvk=", + "lastModified": 1743295846, + "narHash": "sha256-hKKz07d4RV9gzxzE5Qu3RQWX8a7XpzRrP5timoxoGRQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "63e77d09a133ac641a0c204e7cfb0c97e133706d", + "rev": "717030011980e9eb31eb8ce011261dd532bce92c", "type": "github" }, "original": { @@ -44,11 +44,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1742607855, - "narHash": "sha256-lUF/tpSON29qNIqhECX/Ue4qVmI3FOvMaW4iUnK49C4=", + "lastModified": 1743299372, + "narHash": "sha256-vFuxkHPd+Xpi5Bx1VCyZwYl/BbF83C+KmlbPBNVJvNU=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "9818734e2117dac703767585d48b805fad3e7a5e", + "rev": "2ab0a37308559926bddb0009dfcf16a2a5b34e2b", "type": "github" }, "original": { @@ -59,11 +59,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741865919, - "narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=", + "lastModified": 1743076231, + "narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a", + "rev": "6c5963357f3c1c840201eda129a99d455074db04", "type": "github" }, "original": { @@ -90,11 +90,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1742512142, - "narHash": "sha256-8XfURTDxOm6+33swQJu/hx6xw1Tznl8vJJN5HwVqckg=", + "lastModified": 1743231893, + "narHash": "sha256-tpJsHMUPEhEnzySoQxx7+kA+KUtgWqvlcUBqROYNNt0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7105ae3957700a9646cc4b766f5815b23ed0c682", + "rev": "c570c1f5304493cafe133b8d843c7c1c4a10d3a6", "type": "github" }, "original": { diff --git a/home-manager/modules/lazygit.nix b/home-manager/modules/lazygit.nix index df3baf7..e11459f 100644 --- a/home-manager/modules/lazygit.nix +++ b/home-manager/modules/lazygit.nix @@ -5,4 +5,14 @@ home.packages = with pkgs; [ lazygit ]; + + programs.git = { + enable = true; + includes = [ + { path = "./.secrets/.git-config"; } + ]; + extraConfig = { + credential.helper = "store --file ./.secrets/.git-credentials"; + }; + }; } diff --git a/home-manager/modules/polybar.nix b/home-manager/modules/polybar.nix index 22007c0..b97de47 100644 --- a/home-manager/modules/polybar.nix +++ b/home-manager/modules/polybar.nix @@ -2,15 +2,5 @@ pkgs, ... }: { - home.packages = with pkgs; [ - (polybar.override { - alsaSupport = false; - curlSupport = true; - i3Support = true; - mpdSupport = true; - pulseSupport = true; - nlSupport = true; - iwSupport = true; - }) - ]; + home.packages = pkgs.polybar.all; } diff --git a/hosts/local-packages.nix b/hosts/local-packages.nix index 0075528..1ec5fba 100644 --- a/hosts/local-packages.nix +++ b/hosts/local-packages.nix @@ -5,12 +5,6 @@ }: let customPkgs = import ../pkgs {inherit pkgs lib;}; in { - imports = [ - ../modules/python.nix - ]; - - python.enable = true; - environment.systemPackages = with pkgs; [ brave # TODO: make a module to save browser stuff vesktop @@ -48,7 +42,6 @@ in { htop btop nvtopPackages.full - ripgrep fd fzf jq @@ -95,5 +88,42 @@ in { nodePackages.pnpm zlib.dev udiskie + + rust-analyzer + clang-tools + vscode-langservers-extracted + nodePackages.eslint + gopls + lua-language-server + marksman + nil + ruff + taplo + yaml-language-server + alejandra + nodePackages.prettier + stylua + shfmt + nodePackages.sql-formatter + yamlfmt + luaPackages.luacheck + nodePackages.markdownlint-cli + nodePackages.stylelint + nodePackages.htmlhint + yamllint + nodePackages.jsonlint + hadolint + shellcheck + cppcheck + go-tools + rubocop + phpPackages.php-codesniffer + phpPackages.phpstan + checkstyle + tflint + sqlfluff + rustc + python3Packages.debugpy + customPkgs.python-ngx-lsp ]; } diff --git a/modules/audio.nix b/modules/audio.nix index 5a2ffff..e1451fe 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -10,13 +10,11 @@ pulse.enable = true; # If you want to use JACK applications, uncomment this #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; }; environment.systemPackages = with pkgs; [ cava + pulseaudio + ffmpeg ]; } diff --git a/pkgs/default.nix b/pkgs/default.nix index a95682c..e89c270 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,42 +9,34 @@ inherit version; sha256 = "0410j6jfz1yzm5s0v0yrc1j0q6ih4322357and7arr0jxnlsn0ia"; }; - meta.priority = -1; }); - customPackages = pkgs.python311Packages.override { + customPydantic = pkgs.python311Packages.override { overrides = self: super: { numpy = numpy-1; + pydantic = super.pydantic.overridePythonAttrs (oldAttrs: rec { + version = "1.10.18"; + src = pkgs.fetchPypi { + pname = "pydantic"; + inherit version; + sha256 = "uuvf8ZB9HZahOcJRNqm7fRfhGPEzp2ou87hF6DHjQDo="; + }; + nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ self.setuptools ]; + }); }; }; in { fish-rust = pkgs.callPackage ./fish-rust {}; - python-pymatting = pkgs.callPackage ./python-pymatting { - inherit lib; - fetchPypi = pkgs.fetchPypi; - python311Packages = customPackages; - }; - - python-opencv-headless = pkgs.callPackage ./python-opencv-headless { - inherit lib; - fetchPypi = pkgs.fetchPypi; - cmake = pkgs.cmake; - pkg-config = pkgs.pkg-config; - stdenv = pkgs.stdenv; - makeWrapper = pkgs.makeWrapper; - python311Packages = customPackages; - }; - python-rembg = pkgs.callPackage ./python-rembg { inherit lib; fetchPypi = pkgs.fetchPypi; - python311Packages = customPackages; + python311Packages = numpy-1; python-pymatting = pkgs.callPackage ./python-pymatting { inherit lib; fetchPypi = pkgs.fetchPypi; - python311Packages = customPackages; + python311Packages = numpy-1; }; python-opencv-headless = pkgs.callPackage ./python-opencv-headless { @@ -54,9 +46,13 @@ in { pkg-config = pkgs.pkg-config; stdenv = pkgs.stdenv; makeWrapper = pkgs.makeWrapper; - python311Packages = customPackages; + python311Packages = numpy-1; }; }; - pythonPackages = customPackages; + python-ngx-lsp = pkgs.callPackage ./python-nginx-language-server { + inherit lib; + fetchFromGitHub = pkgs.fetchFromGitHub; + python311Packages = customPydantic; + }; } diff --git a/pkgs/python-nginx-language-server/default.nix b/pkgs/python-nginx-language-server/default.nix new file mode 100644 index 0000000..03c2b2f --- /dev/null +++ b/pkgs/python-nginx-language-server/default.nix @@ -0,0 +1,37 @@ +{ lib, python311Packages, fetchFromGitHub }: + +let + customPydantic = python311Packages.pydantic.overridePythonAttrs (oldAttrs: { + doCheck = false; + }); +in +python311Packages.buildPythonPackage rec { + pname = "nginx-language-server"; + version = "0.8.0"; + format = "pyproject"; + src = fetchFromGitHub { + owner = "pappasam"; + repo = "nginx-language-server"; + rev = "v${version}"; + sha256 = "AXWrNt4f3jkAbidE1goDgFicu4sSBv08f/Igyh2bRII="; + }; + nativeBuildInputs = with python311Packages; [ + setuptools + poetry-core + ]; + propagatedBuildInputs = with python311Packages; [ + pygls + customPydantic + crossplane + lsprotocol + ]; + pythonImportsCheck = [ "nginx_language_server" ]; + doCheck = false; + meta = with lib; { + description = "A language server for nginx"; + homepage = "https://github.com/pappasam/nginx-language-server"; + license = licenses.gpl3Only; + platforms = platforms.all; + maintainers = with maintainers; [ "Cobray" ]; + }; +}