Skip to content

Commit

Permalink
ci: we nix now (#26)
Browse files Browse the repository at this point in the history
poggers

---------

Co-authored-by: isabelroses <[email protected]>
Co-authored-by: nullishamy <[email protected]>
  • Loading branch information
3 people authored May 31, 2024
1 parent 7f535ba commit 5fbec96
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 16 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- name: Install dependencies
run: sudo apt update && sudo apt install -y inkscape x11-apps
- name: Generate cursors
run: just all
- name: Build zips
run: just zip
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build
run: nix build . -L
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: 'catppuccin-cursors-${{ steps.vars.outputs.sha_short }}'
path: releases/*.zip
path: result/*.zip
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- name: Install dependencies
run: sudo apt update && sudo apt install -y inkscape x11-apps
- name: Generate cursors
run: just all
- name: Build zips
run: just zip
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build
run: nix build . -Lv
- name: Add zips to release
run: gh release upload ${{ needs.release-please.outputs.tag_name }} releases/*.zip
run: gh release upload ${{ needs.release-please.outputs.tag_name }} result/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
pngs/
releases/
result
46 changes: 46 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ lib
, stdenvNoCC
, inkscape
, just
, xcursorgen
, hyprcursor
, zip
}:

stdenvNoCC.mkDerivation {
name = "catppuccin-cursors";
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.intersection
(lib.fileset.fromSource (lib.sources.cleanSource ./.))
(lib.fileset.unions [ ./src ./justfile ./build ./create_zips ./AUTHORS ./LICENSE ]);
};
nativeBuildInputs = [
just
xcursorgen
inkscape
hyprcursor
zip
];
buildPhase = ''
runHook preBuild
patchShebangs .
just all
just zip
runHook postBuild
'';
installPhase = ''
# $out is an automatically generated filepath by nix,
# but it's up to you to make it what you need. We'll create a directory at
# that filepath, then copy our sources into it.
mkdir $out
cp -rv ./releases/* $out
'';
meta = {
description = "Catppuccin cursor theme based on Volantes";
homepage = "https://github.com/catppuccin/cursors";
license = lib.licenses.gpl2;
};
}
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

outputs =
{ nixpkgs, ... }:
let
systems = ["aarch64-linux" "x86_64-linux"];
forAllSystems =
function:
nixpkgs.lib.genAttrs systems (
system: function nixpkgs.legacyPackages.${system}
);
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.callPackage ./shell.nix { };
});

packages = forAllSystems (pkgs: rec {
default = catppuccin-cursors;
catppuccin-cursors= pkgs.callPackage ./default.nix { };
});
};
}
13 changes: 13 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
name = "dev-shell";
buildInputs = with pkgs; [
just
hyprcursor
inkscape
xorg.xcursorgen
zip
];
}

0 comments on commit 5fbec96

Please sign in to comment.