diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5490069 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1740126099, + "narHash": "sha256-ozoOtE2hGsqh4XkTJFsrTkNxkRgShxpQxDynaPZUGxk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "32fb99ba93fea2798be0e997ea331dd78167f814", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..afa0b49 --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + systems.url = "github:nix-systems/default"; + }; + + outputs = { self, nixpkgs, systems }: + let + perSystem = callback: nixpkgs.lib.genAttrs (import systems) (system: callback (initPkgs system)); + initPkgs = system: nixpkgs.legacyPackages.${system}; + in + { + packages = perSystem (pkgs: rec { + # Run ilia in the project repo with: + # + # $ nix run + # + # or run without cloning the repo with: + # + # $ nix run github:regolith-linux/ilia + # + default = ilia; + ilia = pkgs.callPackage ./nix/ilia.nix { source = ./.; }; + }); + }; +} diff --git a/nix/ilia.nix b/nix/ilia.nix new file mode 100644 index 0000000..bde657b --- /dev/null +++ b/nix/ilia.nix @@ -0,0 +1,51 @@ +{ source # source must be given explicitly when calling callPackage + + # callPackage automatically populates all of these arguments from nixpkgs +, atk +, cairo +, gobject-introspection +, gtk3 +, gtk-layer-shell +, json-glib +, lib +, libgee +, meson +, ninja +, pkg-config +, stdenv +, tinysparql +, uncrustify +, vala +, wrapGAppsHook3 +}: + +stdenv.mkDerivation { + name = "ilia"; + src = source; + postPatch = '' + patchShebangs meson_scripts + ''; + nativeBuildInputs = [ + meson + ninja + pkg-config + uncrustify + vala + wrapGAppsHook3 # wraps the executable to register gsettings-schemas files + ]; + buildInputs = [ + atk + cairo + gobject-introspection # avoids error, "Package Gtk-3.0 not found in Vala API directories or Ggobject-introspection GIR directories" + gtk3 + gtk-layer-shell + json-glib + libgee + tinysparql + ]; + meta = { + homepage = "https://github.com/regolith-linux/ilia?tab=readme-ov-file"; + license = [ lib.licenses.asl20 ]; + }; +} +