diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..506dadd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Emil Lerch + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9575f6c --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +Nix flake for Chawan web browser +================================ + +Uses [Chawan app image](https://git.lerch.org/chawan-appimage) + +I do not believe this flake will work on NixOS proper. Appimages use a wrapper +there that do not work outside of NixOS. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6a8f1fa --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1736344531, + "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a8ab36b --- /dev/null +++ b/flake.nix @@ -0,0 +1,56 @@ +{ + description = "Chawan AppImage"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: { + packages.x86_64-linux.default = + let + pkgs = import nixpkgs { system = "x86_64-linux"; }; + shorthash = "80e4a90"; # This is the shorthash of the appimage builder repo + upstreamShorthash = "d9ddc31"; # This is the shorthash of the Chawan repo itself + appimagename = "Chawan-x86_64-${upstreamShorthash}.AppImage"; + exename = "cha"; + in + pkgs.stdenv.mkDerivation { + pname = "cha"; + version = "0.1+${upstreamShorthash}"; + + src = pkgs.fetchurl { + url = "https://git.lerch.org/api/packages/lobo/generic/chawan-appimage/${shorthash}/${appimagename}"; + hash = "sha256-Egh7SX3nMBXprHNiXwP4sU2sHyp4xOZOizj2DJZQP9I="; + }; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + buildInputs = [ + pkgs.appimage-run + ]; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out/bin $out/share/applications + + cp $src $out/share/${appimagename} + chmod +x $out/share/${appimagename} + + # Create desktop entry + cat > $out/share/applications/Chawan.desktop <