diff --git a/flake.nix b/flake.nix index a9d5b3d..7029ca3 100644 --- a/flake.nix +++ b/flake.nix @@ -5,20 +5,18 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; hyprland.url = "github:hyprwm/Hyprland"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; dankMaterialShell = { url = "github:AvengeMedia/DankMaterialShell"; inputs.nixpkgs.follows = "nixpkgs"; }; - - quickshell = { - url = "github:quickshell-mirror/quickshell"; + focus-editor = { + url = "path:./pkgs/focus"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - hyprsysteminfo = { url = "github:hyprwm/hyprsysteminfo"; }; @@ -29,6 +27,10 @@ url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; + quickshell = { + url = "github:quickshell-mirror/quickshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, hyprland, ... }@inputs: @@ -40,12 +42,13 @@ config.allowUnfree = true; overlays = [ (final: prev: { + focus = inputs.focus-editor.packages.${system}; hyprland = inputs.hyprland.packages.${system}.hyprland; hyprsysteminfo = inputs.hyprsysteminfo.packages.${system}.hyprsysteminfo; hyprpwcenter = inputs.hyprpwcenter.packages.${system}.hyprpwcenter; - xdg-desktop-portal-hyprland = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; - quickshell = inputs.quickshell.packages.${system}.quickshell; hyprPluginPkgs = inputs.hyprland-plugins.packages.${system}; + quickshell = inputs.quickshell.packages.${system}.quickshell; + xdg-desktop-portal-hyprland = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; }) ]; }; diff --git a/hosts/graphical/pkgs.nix b/hosts/graphical/pkgs.nix index f6ba12c..644cac0 100644 --- a/hosts/graphical/pkgs.nix +++ b/hosts/graphical/pkgs.nix @@ -22,6 +22,7 @@ ffmpeg filezilla floorp-bin + focus fuzzel fzf genymotion @@ -34,7 +35,7 @@ hyprpicker hyprpwcenter imagemagick - # hyprsysteminfo + hyprsysteminfo kdePackages.kdenlive kdePackages.polkit-kde-agent-1 keepassxc diff --git a/pkgs/focus/flake.nix b/pkgs/focus/flake.nix new file mode 100644 index 0000000..b86f744 --- /dev/null +++ b/pkgs/focus/flake.nix @@ -0,0 +1,61 @@ +{ + description = "Focus editor – binary flake"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + + focus = pkgs.stdenv.mkDerivation rec { + pname = "focus"; + version = "0.3.8"; + + src = pkgs.fetchurl { + url = "https://github.com/focus-editor/focus/releases/download/${version}/focus-linux"; + # Run once → Nix will tell you the correct hash and you paste it here + hash = "sha256-rjA8TtXL+hJSmIVsv24M3wC1vBMFZURGTIVauzueaZE="; + executable = true; + }; + + nativeBuildInputs = with pkgs; [ autoPatchelfHook makeWrapper ]; + + buildInputs = with pkgs; [ + libxkbcommon + xorg.libxcb + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXi + libGL + vulkan-loader + wayland + ]; + + unpackPhase = "true"; + + installPhase = '' + mkdir -p $out/bin + cp $src $out/bin/focus + chmod +x $out/bin/focus + + wrapProgram $out/bin/focus \ + --prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath buildInputs} + ''; + + meta = with pkgs.lib; { + description = "Focus – a simple, fast, privacy-friendly text editor"; + homepage = "https://github.com/focus-editor/focus"; + license = licenses.mit; + platforms = platforms.linux; + mainProgram = "focus"; + }; + }; + in { + packages.${system} = { + default = focus; + focus = focus; + }; + }; +}