From 3730719c2e5554b900b6dd637e92a73e8ea64995 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Mon, 9 Dec 2024 20:11:13 -0800 Subject: [PATCH] added nix flake taken from the McMojave-hyprcursor --- flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 29 +++++++++++++++++++++++++++++ nix/default.nix | 27 +++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nix/default.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8841a58 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1733581040, + "narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e253a92 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "The McMojave xcursor theme packages for NixOS"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + systems.url = "github:nix-systems/default-linux"; + }; + + outputs = + { + self, + nixpkgs, + systems, + ... + }@inputs: + let + pkgs = nixpkgs; + eachSystem = pkgs.lib.genAttrs (import systems); + in + { + packages = eachSystem (system: { + default = self.packages.${system}.mcmojave-xcursor; + + mcmojave-xcursor = inputs.nixpkgs.legacyPackages.${system}.callPackage ./nix {}; + }); + + formatter = eachSystem (system: nixpkgs.${system}.nixpkgs-format); + }; +} diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..2df6299 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,27 @@ +{ + lib, + stdenv, +}: +stdenv.mkDerivation { + pname = "mcmojave-xcursor"; + version = "0.1"; + src = ../.; + + # Shamelessly copied flake from https://github.com/Libadoxon/mcmojave-hyprcursor/blob/main/nix/default.nix + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/icons/ + mkdir -p $out/share/icons/McMojave-cursors + cp $src/dist/* -r $out/share/icons/McMojave-cursors + + runHook postInstall + ''; + + meta = with lib; { + description = "The McMojave xcursor theme packaged for NixOS"; + license = licenses.gpl3; + maintainers = with maintainers; [ Nickiel12 ]; + }; +}