diff --git a/flake.lock b/flake.lock index f6bb750..90d2b3e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,83 @@ { "nodes": { + "czkawka-master": { + "inputs": { + "czkawka-src": "czkawka-src", + "naersk": "naersk", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1766316793, + "narHash": "sha256-ztYm8+juiptYvtU6V4FDj/k9CFD/OIIz7O5BdJfGVSs=", + "path": "/etc/nixos/flakes/czkawka-master", + "type": "path" + }, + "original": { + "path": "/etc/nixos/flakes/czkawka-master", + "type": "path" + } + }, + "czkawka-src": { + "flake": false, + "locked": { + "lastModified": 1764796329, + "narHash": "sha256-legzp0mmNgKz9dw7rpnkAXXYjW3BFur8e+W7289bHI8=", + "owner": "qarmin", + "repo": "czkawka", + "rev": "6296b06f3a6798f07f78cd771ed95d75639f7bbb", + "type": "github" + }, + "original": { + "owner": "qarmin", + "repo": "czkawka", + "type": "github" + } + }, + "fenix": { + "inputs": { + "nixpkgs": [ + "czkawka-master", + "naersk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1752475459, + "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "naersk": { + "inputs": { + "fenix": "fenix", + "nixpkgs": [ + "czkawka-master", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763384566, + "narHash": "sha256-r+wgI+WvNaSdxQmqaM58lVNvJYJ16zoq+tKN20cLst4=", + "owner": "nix-community", + "repo": "naersk", + "rev": "d4155d6ebb70fbe2314959842f744aa7cabbbf6a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, "nix-flatpak": { "locked": { "lastModified": 1754777568, @@ -16,6 +94,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1766070988, + "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1766254170, "narHash": "sha256-Svhx9lHB3wvxDu9UtxilofG3PZqKvfwUzarSIvuGO5g=", @@ -33,8 +127,26 @@ }, "root": { "inputs": { + "czkawka-master": "czkawka-master", "nix-flatpak": "nix-flatpak", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1752428706, + "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index aff4df8..31f9d29 100644 --- a/flake.nix +++ b/flake.nix @@ -6,12 +6,15 @@ url = "github:gmodena/nix-flatpak"; inputs.nixpkgs.follows = "nixpkgs"; }; + + czkawka-master.url = "path:/etc/nixos/flakes/czkawka-master"; }; - outputs = { self, nixpkgs, nix-flatpak, ... }: { + outputs = { self, nixpkgs, nix-flatpak, czkawka-master, ... }: { nixosConfigurations = { epiquev2 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { inherit czkawka-master; }; modules = [ ./configuration.nix nix-flatpak.nixosModules.nix-flatpak diff --git a/flakes/czkawka-master/flake.nix b/flakes/czkawka-master/flake.nix new file mode 100644 index 0000000..c50fa9a --- /dev/null +++ b/flakes/czkawka-master/flake.nix @@ -0,0 +1,69 @@ +{ + description = "Czkawka (Master) - Built with Naersk"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + # The source code from GitHub + czkawka-src = { + url = "github:qarmin/czkawka"; + flake = false; # The upstream repo doesn't have a flake.nix + }; + + # Naersk: Builds Rust crates without needing a manual cargoHash + naersk = { + url = "github:nix-community/naersk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, czkawka-src, naersk }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + naersk-lib = pkgs.callPackage naersk { }; + + # Czkawka requires these system libraries + nativeBuildInputs = with pkgs; [ + pkg-config + wrapGAppsHook4 + gobject-introspection + cargo + rustc + ]; + + buildInputs = with pkgs; [ + glib + gtk4 + cairo + pango + gdk-pixbuf + atk + # Optional: libadwaita if the master branch has switched to it + ]; + + in { + packages.${system}.default = naersk-lib.buildPackage { + pname = "czkawka"; + version = "master"; + src = czkawka-src; + + # Add the dependencies + inherit nativeBuildInputs buildInputs; + + # We need to manually install the desktop files/icons because Naersk + # only installs the binaries by default. + postInstall = '' + install -Dm444 -t $out/share/applications data/com.github.qarmin.czkawka.desktop + install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/com.github.qarmin.czkawka.svg + install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/com.github.qarmin.czkawka-symbolic.svg + install -Dm444 -t $out/share/metainfo data/com.github.qarmin.czkawka.metainfo.xml + ''; + }; + + # For 'nix develop' - gives you a shell with cargo/rustc ready + devShells.${system}.default = pkgs.mkShell { + inherit nativeBuildInputs buildInputs; + }; + }; +} \ No newline at end of file diff --git a/modules/packages.nix b/modules/packages.nix index 9ab7961..19df25e 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -2,6 +2,7 @@ config, pkgs, lib, + czkawka-master, ... }: @@ -25,7 +26,7 @@ bzip2 ccache curl - czkawka-full + czkawka-master.packages.${pkgs.system}.default ddcutil discord distrobox