Skip to content

Commit

Permalink
feat(modules): use package set for port sources (#384)
Browse files Browse the repository at this point in the history
* feat: init package set

* feat(pkgs): add fetchCatppuccinPort

* feat(pkgs): add catppuccinInstallHook

* feat(pkgs): add buildCatppuccinPort

* feat(pkgs): add catwalk

* feat(pkgs): add whiskers

* feat(pkgs): add paws.py script

* feat(pkgs): add all current ports

* feat(modules): use package set for port sources

* docs: update 'adding a port' guide

* chore: set nixfmt as formatter in root flake

* chore: add dev shell

* ci: use renovate to update flake.lock

* refactor: merge subflake back into main flake

this is annoying to maintain

• Added input 'catppuccin-v1_1':
    'https://api.flakehub.com/f/pinned/catppuccin/nix/1.1.1/0193bdc0-b045-7eed-bbec-95611a8ecdf5/source.tar.gz?narHash=sha256-pCWJgwo77KD7EJpwynwKrWPZ//dwypHq2TfdzZWqK68%3D' (2024-12-13)
• Added input 'catppuccin-v1_2':
    'https://api.flakehub.com/f/pinned/catppuccin/nix/1.2.0/0193e5e0-33b7-7149-a362-bfe56b20f64e/source.tar.gz?narHash=sha256-Let3uJo4YDyfqbqaw66dpZxhJB2TrDyZWSFd5rpPLJA%3D' (2024-12-20)
• Added input 'home-manager':
    'github:nix-community/home-manager/1395379a7a36e40f2a76e7b9936cc52950baa1be?narHash=sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI%3D' (2024-12-19)
• Added input 'home-manager/nixpkgs':
    follows 'nixpkgs'
• Added input 'home-manager-stable':
    'github:nix-community/home-manager/80b0fdf483c5d1cb75aaad909bd390d48673857f?narHash=sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw%3D' (2024-12-16)
• Added input 'home-manager-stable/nixpkgs':
    follows 'nixpkgs-stable'
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367?narHash=sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w%3D' (2024-11-19)
  → 'github:NixOS/nixpkgs/d3c42f187194c26d9f0309a8ecc469d6c878ce33?narHash=sha256-cHar1vqHOOyC7f1%2BtVycPoWTfKIaqkoe1Q6TnKzuti4%3D' (2024-12-17)
• Added input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/b47fd6fa00c6afca88b8ee46cfdb00e104f50bca?narHash=sha256-nbG9TijTMcfr%2Bau7ZVbKpAhMJzzE2nQBYmRvSdXUD8g%3D' (2024-12-19)
• Added input 'nuscht-search':
    'github:NuschtOS/search/3051be7f403bff1d1d380e4612f0c70675b44fc9?narHash=sha256-Y47y%2BLesOCkJaLvj%2BdI/Oa6FAKj/T9sKVKDXLNsViPw%3D' (2024-12-09)
• Added input 'nuscht-search/flake-utils':
    'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D' (2024-11-13)
• Added input 'nuscht-search/flake-utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D' (2023-04-09)
• Added input 'nuscht-search/ixx':
    'github:NuschtOS/ixx/9fd01aad037f345350eab2cd45e1946cc66da4eb?narHash=sha256-EiOq8jF4Z/zQe0QYVc3%2BqSKxRK//CFHMB84aYrYGwEs%3D' (2024-10-26)
• Added input 'nuscht-search/ixx/flake-utils':
    follows 'nuscht-search/flake-utils'
• Added input 'nuscht-search/ixx/nixpkgs':
    follows 'nuscht-search/nixpkgs'
• Added input 'nuscht-search/nixpkgs':
    follows 'nixpkgs'

* ci: split format job

* ci: build package set

* ci: use cachix

* ci: run ci when workflow files change

* chore(tests): move to modules folder

* revert: "ci: remove backport workflow"

Refs: 630b559.
  • Loading branch information
getchoo authored Dec 27, 2024
1 parent 58d020d commit 115c3de
Show file tree
Hide file tree
Showing 101 changed files with 1,465 additions and 1,075 deletions.
12 changes: 0 additions & 12 deletions .github/checkSources.nix

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Based on https://github.com/NixOS/nixpkgs/blob/c81ecdf95b3a0f73ded448f14416cd66beeb5e1a/.github/workflows/backport.yml
name: Backport

on:
pull_request_target:
types: [closed, labeled]

# WARNING:
# When extending this action, be aware that $GITHUB_TOKEN allows write access to
# the GitHub repository. This means that it should not evaluate user input in a
# way that allows code injection.

jobs:
backport:
name: Backport Pull Request

if: ${{ github.repository_owner == 'catppuccin' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name)) }}

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Create backport PRs
uses: korthout/backport-action@v3
with:
pull_description: |-
Bot-based backport to `${target_branch}`, triggered by a label in #${pull_number}.
88 changes: 36 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,56 @@ name: CI

on:
push:
branches: [main]
branches: [ main ]
paths:
- '.sources/**'
- '**.lock'
- '**.nix'
- 'flake.lock'

- '.github/workflows/ci.yml'
pull_request:
paths:
- '.sources/**'
- '**.lock'
- '**.nix'
- 'flake.lock'

- '.github/workflows/ci.yml'
workflow_dispatch:

jobs:
format:
name: Format Nix files
packages:
name: Build Packages

if: github.repository_owner == 'Catppuccin' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
os: [ macos-latest, macos-13, ubuntu-latest ]

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TOKEN }}

- name: Set Git user info
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Get short revision
id: rev
run:
echo "rev=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Install Nix
uses: cachix/install-nix-action@V27

- name: Format changes
run: |
nix run \
--inputs-from ./dev \
'nixpkgs#nixfmt-rfc-style' -- .
- name: Install Cachix
uses: cachix/cachix-action@v15
with:
name: catppuccin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Commit changes
- name: Run build
run: |
if ! git diff --color=always --exit-code; then
git commit -am "style: format ${{ steps.rev.outputs.rev }}"
git push
fi
nix run .#build-outputs -- 'packages'
test:
modules:
name: Test Modules
needs: packages

strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
os: [ macos-latest, ubuntu-latest ]

runs-on: ${{ matrix.os }}

Expand All @@ -71,30 +62,23 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@V27

- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Install Cachix
uses: cachix/cachix-action@v15
with:
name: catppuccin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Run tests
run: |
nix run \
--inputs-from ./dev \
github:Mic92/nix-fast-build -- \
--no-nom \
--flake "./dev#checks.$(nix eval --raw --impure --expr builtins.currentSystem)"
nix run .#build-outputs -- 'checks'
validate-sources:
name: Validate sources
release-gate:
name: Release Gate
needs: [ modules, packages ]

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@V27

- name: Check for external repositories
run: |
set -e
nix eval --file ./.github/checkSources.nix
- name: Exit with error
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
46 changes: 46 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Format

on:
push:
branches: [ main ]
paths:
- "**.nix"

- ".github/workflows/format.yml"
workflow_dispatch:

jobs:
nix:
name: Nix files

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TOKEN }}

- name: Set Git user info
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Get short revision
id: rev
run:
echo "rev=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Install Nix
uses: cachix/install-nix-action@V27

- name: Format changes
run: |
nix fmt
- name: Commit changes
run: |
if ! git diff --color=always --exit-code; then
git commit -am "style: format ${{ steps.rev.outputs.rev }}"
git push
fi
57 changes: 0 additions & 57 deletions .github/workflows/update-locks.yml

This file was deleted.

13 changes: 10 additions & 3 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ on:
- 'CHANGELOG.md'
- '**.lock'
- '**.nix'

- '.github/workflows/website.yml'
pull_request:
paths:
- 'docs/**'
- 'CHANGELOG.md'
- '**.lock'
- '**.nix'

- '.github/workflows/website.yml'
workflow_dispatch:

jobs:
Expand All @@ -29,15 +33,18 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@V27

- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Install Cachix
uses: cachix/cachix-action@v15
with:
name: catppuccin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Run build
run: |
nix build \
--print-build-logs \
--show-trace \
'./dev#site'
'.#site'
- name: Get artifact directory
id: find-path
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
result
result-*
repl-result-*

gcroot/
65 changes: 0 additions & 65 deletions .sources/default.nix

This file was deleted.

Loading

0 comments on commit 115c3de

Please sign in to comment.