Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: we nix now #26

Merged
merged 4 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ]);
sgoudham marked this conversation as resolved.
Show resolved Hide resolved
};
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
];
}

Loading