Compare commits
10 changed files with 204 additions and 174 deletions
|
|
@ -4,6 +4,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
|
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
name: Pull Request
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
runs-on: x86_64
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Check flake
|
|
||||||
run: |
|
|
||||||
source /etc/bashrc
|
|
||||||
nix flake check
|
|
||||||
|
|
||||||
list-packages:
|
|
||||||
runs-on: x86_64
|
|
||||||
outputs:
|
|
||||||
packages: ${{ steps.set-matrix.outputs.packages }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- id: set-matrix
|
|
||||||
run: |
|
|
||||||
source /etc/bashrc
|
|
||||||
ALL_PACKAGES=$(nix flake show --json | nix run nixpkgs#jq -- -r '.packages."x86_64-linux" | keys[]')
|
|
||||||
|
|
||||||
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
|
||||||
echo "Detecting changed packages for PR..."
|
|
||||||
BASE_REF="${{ github.base_ref }}"
|
|
||||||
# Ensure the base branch is available for diffing
|
|
||||||
git fetch origin "$BASE_REF" --depth=1
|
|
||||||
CHANGED_FILES=$(git diff --name-only "origin/$BASE_REF"...HEAD)
|
|
||||||
|
|
||||||
if echo "$CHANGED_FILES" | grep -qE 'flake.nix|flake.lock'; then
|
|
||||||
echo "Flake files changed, building all packages."
|
|
||||||
SELECTED_PACKAGES=$(echo "$ALL_PACKAGES" | nix run nixpkgs#jq -- -R . | nix run nixpkgs#jq -- -s -c .)
|
|
||||||
else
|
|
||||||
# Extract package names from pkgs/<name>/
|
|
||||||
CHANGED_PKGS=$(echo "$CHANGED_FILES" | grep '^pkgs/' | cut -d'/' -f2 | sort -u || true)
|
|
||||||
|
|
||||||
FINAL_PKGS=()
|
|
||||||
for pkg in $CHANGED_PKGS; do
|
|
||||||
if echo "$ALL_PACKAGES" | grep -q "^$pkg$"; then
|
|
||||||
FINAL_PKGS+=("$pkg")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ${#FINAL_PKGS[@]} -eq 0 ]; then
|
|
||||||
SELECTED_PACKAGES="[]"
|
|
||||||
else
|
|
||||||
SELECTED_PACKAGES=$(printf '%s\n' "${FINAL_PKGS[@]}" | nix run nixpkgs#jq -- -R . | nix run nixpkgs#jq -- -s -c .)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Push event, listing all packages."
|
|
||||||
SELECTED_PACKAGES=$(echo "$ALL_PACKAGES" | nix run nixpkgs#jq -- -R . | nix run nixpkgs#jq -- -s -c .)
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "packages=$SELECTED_PACKAGES" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: [check, list-packages]
|
|
||||||
runs-on: x86_64
|
|
||||||
if: ${{ fromJson(needs.list-packages.outputs.packages)[0] != null }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
package: ${{ fromJson(needs.list-packages.outputs.packages) }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build package
|
|
||||||
run: |
|
|
||||||
source /etc/bashrc
|
|
||||||
nix build .#${{ matrix.package }}
|
|
||||||
|
|
||||||
|
|
||||||
93
.forgejo/workflows/update-vscode-insiders.yml
Normal file
93
.forgejo/workflows/update-vscode-insiders.yml
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
name: Update VSCode Insiders
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: x86_64
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check for new vscode-insiders release
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
source /etc/bashrc
|
||||||
|
|
||||||
|
CURRENT_VERSION=$(grep 'version = ' pkgs/vscode-insiders/default.nix | head -1 | grep -oP '"[^"]+"' | tr -d '"')
|
||||||
|
echo "Current version: $CURRENT_VERSION"
|
||||||
|
|
||||||
|
LATEST_VERSION=$(curl -fsSL https://update.code.visualstudio.com/api/releases/insider | nix run nixpkgs#jq -- -r '.[0]')
|
||||||
|
echo "Latest version: $LATEST_VERSION"
|
||||||
|
|
||||||
|
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
|
||||||
|
echo "Already up to date."
|
||||||
|
echo "updated=false" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "New version found: $LATEST_VERSION"
|
||||||
|
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "updated=true" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Update version and sha256
|
||||||
|
if: steps.check.outputs.updated == 'true'
|
||||||
|
id: update
|
||||||
|
run: |
|
||||||
|
source /etc/bashrc
|
||||||
|
|
||||||
|
LATEST="${{ steps.check.outputs.latest_version }}"
|
||||||
|
URL="https://code.visualstudio.com/sha/download?build=insider&os=linux-x64"
|
||||||
|
|
||||||
|
echo "Fetching new sha256 for VSCode Insiders..."
|
||||||
|
NEW_SHA256=$(nix-prefetch-url --type sha256 "$URL" 2>/dev/null | tail -1)
|
||||||
|
NEW_SHA256_SRI=$(nix hash convert --hash-algo sha256 --to sri "$NEW_SHA256")
|
||||||
|
echo "New sha256 (SRI): $NEW_SHA256_SRI"
|
||||||
|
|
||||||
|
sed -i "s|version = \".*\";|version = \"${LATEST}\";|" pkgs/vscode-insiders/default.nix
|
||||||
|
sed -i "s|sha256 = \"sha256-.*\";|sha256 = \"${NEW_SHA256_SRI}\";|" pkgs/vscode-insiders/default.nix
|
||||||
|
|
||||||
|
echo "new_sha256=$NEW_SHA256_SRI" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Verify build
|
||||||
|
if: steps.check.outputs.updated == 'true'
|
||||||
|
run: |
|
||||||
|
source /etc/bashrc
|
||||||
|
NIXPKGS_ALLOW_UNFREE=1 nix build .#vscode-insiders
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
if: steps.check.outputs.updated == 'true'
|
||||||
|
env:
|
||||||
|
API_FORGEJO_TOKEN: ${{ secrets.API_FORGEJO_TOKEN }}
|
||||||
|
run: |
|
||||||
|
source /etc/bashrc
|
||||||
|
|
||||||
|
LATEST="${{ steps.check.outputs.latest_version }}"
|
||||||
|
BRANCH="update/vscode-insiders-${LATEST}"
|
||||||
|
|
||||||
|
git config user.name "mizuki"
|
||||||
|
git config user.email "akiyama@mizuki.guru"
|
||||||
|
|
||||||
|
git checkout -b "$BRANCH"
|
||||||
|
git add pkgs/vscode-insiders/default.nix
|
||||||
|
git commit -m "pkgs/vscode-insiders: update to ${LATEST}"
|
||||||
|
|
||||||
|
REPO_URL=$(git remote get-url origin | sed 's|https://||')
|
||||||
|
git push "https://oauth2:${API_FORGEJO_TOKEN}@${REPO_URL}" "$BRANCH"
|
||||||
|
|
||||||
|
FORGEJO_HOST=$(echo "$REPO_URL" | cut -d'/' -f1)
|
||||||
|
REPO_PATH=$(echo "$REPO_URL" | cut -d'/' -f2-)
|
||||||
|
|
||||||
|
curl -fsSL -X POST \
|
||||||
|
-H "Authorization: token ${API_FORGEJO_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"https://${FORGEJO_HOST}/api/v1/repos/${REPO_PATH}/pulls" \
|
||||||
|
-d "{
|
||||||
|
\"title\": \"pkgs/vscode-insiders: update to ${LATEST}\",
|
||||||
|
\"head\": \"${BRANCH}\",
|
||||||
|
\"base\": \"main\",
|
||||||
|
\"body\": \"Automated update of VSCode Insiders to version \`${LATEST}\`.\n\nNew SRI Hash: \`${{ steps.update.outputs.new_sha256 }}\`\"
|
||||||
|
}"
|
||||||
32
README.md
32
README.md
|
|
@ -3,8 +3,8 @@ imnyang's custom nixpkgs overlay.
|
||||||
|
|
||||||
## Included Packages
|
## Included Packages
|
||||||
- `helium`: Helium AppImage wrapper
|
- `helium`: Helium AppImage wrapper
|
||||||
- `figma-linux`: Figma Desktop for Linux
|
|
||||||
- `helium-sync`: Helium Sync utility
|
- `helium-sync`: Helium Sync utility
|
||||||
|
- `vscode-insiders`: VSCode Insiders
|
||||||
- `waterfox-bin`: Waterfox Browser
|
- `waterfox-bin`: Waterfox Browser
|
||||||
- `xcursor-mizuki`: Custom cursor
|
- `xcursor-mizuki`: Custom cursor
|
||||||
- `pjsk-cursor`: Custom cursor
|
- `pjsk-cursor`: Custom cursor
|
||||||
|
|
@ -42,3 +42,33 @@ Add the following to your nix configuration:
|
||||||
```
|
```
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
|
### helium-sync
|
||||||
|
|
||||||
|
#### NixOS
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs.imnyang.url = "git+https://git.mizuki.guru/imnyang/nix-packages.git";
|
||||||
|
outputs = { self, nixpkgs, imnyang }: {
|
||||||
|
nixosConfigurations.my-host = nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
imnyang.nixosModules.helium-sync
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Home Manager
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs.imnyang.url = "git+https://git.mizuki.guru/imnyang/nix-packages.git";
|
||||||
|
outputs = { self, home-manager, imnyang, ... }: {
|
||||||
|
homeConfigurations.my-user = home-manager.lib.homeManagerConfiguration {
|
||||||
|
modules = [
|
||||||
|
imnyang.homeManagerModules.helium-sync
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779508470,
|
"lastModified": 1778443072,
|
||||||
"narHash": "sha256-Ap9KJX+5xHIn3bPIpfNgT6MEXdAECECwo4/rmlQD74M=",
|
"narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "29916453413845e54a65b8a1cf996842300cd299",
|
"rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
33
flake.nix
33
flake.nix
|
|
@ -7,45 +7,40 @@
|
||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs }:
|
||||||
let
|
let
|
||||||
supportedSystems = [
|
system = "x86_64-linux";
|
||||||
"x86_64-linux"
|
|
||||||
"aarch64-darwin"
|
|
||||||
"x86_64-darwin"
|
|
||||||
];
|
|
||||||
|
|
||||||
|
# Overlay 정의
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
waterfox-bin = final.callPackage ./pkgs/waterfox-bin/default.nix { };
|
waterfox-bin = final.callPackage ./pkgs/waterfox-bin/default.nix { };
|
||||||
xcursor-mizuki = final.callPackage ./pkgs/xcursor-mizuki/default.nix { };
|
xcursor-mizuki = final.callPackage ./pkgs/xcursor-mizuki/default.nix { };
|
||||||
pjsk-cursor = final.callPackage ./pkgs/pjsk-cursor/default.nix { };
|
pjsk-cursor = final.callPackage ./pkgs/pjsk-cursor/default.nix { };
|
||||||
helium = final.callPackage ./pkgs/helium/default.nix { };
|
helium = final.callPackage ./pkgs/helium/default.nix { };
|
||||||
figma-linux = final.callPackage ./pkgs/figma-linux/default.nix { };
|
helium-sync = final.callPackage ./pkgs/helium-sync/default.nix { };
|
||||||
|
vscode-insiders = final.callPackage ./pkgs/vscode-insiders/default.nix { };
|
||||||
};
|
};
|
||||||
|
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f (
|
pkgs = import nixpkgs {
|
||||||
import nixpkgs {
|
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [ overlay ];
|
overlays = [ overlay ];
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
}
|
};
|
||||||
));
|
|
||||||
in {
|
in {
|
||||||
overlays.default = overlay;
|
overlays.default = overlay;
|
||||||
|
|
||||||
packages = forAllSystems (pkgs:
|
nixosModules.helium-sync = import ./modules/helium-sync.nix;
|
||||||
let
|
homeManagerModules.helium-sync = import ./modules/helium-sync-hm.nix;
|
||||||
allPkgs = {
|
|
||||||
|
packages.${system} = {
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
waterfox-bin
|
waterfox-bin
|
||||||
xcursor-mizuki
|
xcursor-mizuki
|
||||||
pjsk-cursor
|
pjsk-cursor
|
||||||
helium
|
helium
|
||||||
figma-linux;
|
helium-sync
|
||||||
|
vscode-insiders;
|
||||||
|
|
||||||
|
default = pkgs.helium; # 예시로 하나를 기본값으로 지정
|
||||||
};
|
};
|
||||||
in
|
|
||||||
nixpkgs.lib.filterAttrs (name: pkg:
|
|
||||||
nixpkgs.lib.elem pkgs.stdenv.hostPlatform.system (pkg.meta.platforms or [ "x86_64-linux" ])
|
|
||||||
) allPkgs
|
|
||||||
);
|
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
extra-substituters = [
|
extra-substituters = [
|
||||||
|
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
{
|
|
||||||
appimageTools,
|
|
||||||
fetchurl,
|
|
||||||
lib,
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
pname = "figma-linux";
|
|
||||||
version = "126.5.6";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://github.com/IliyaBrook/figma-linux/releases/download/${version}/figma-desktop-${version}-amd64.AppImage";
|
|
||||||
hash = "sha256-SLn4y+NVCcBDZrGqIpmpIEQavY7xngt5JMI8yG1g6/0=";
|
|
||||||
};
|
|
||||||
|
|
||||||
appimageContents = appimageTools.extract {
|
|
||||||
inherit pname version src;
|
|
||||||
|
|
||||||
# The upstream AppImage registers an AppImage-specific desktop entry at
|
|
||||||
# runtime. That bypasses this package's FHS wrapper when a figma:// URL is
|
|
||||||
# opened, so Electron cannot find libraries such as libnspr4.so.
|
|
||||||
postExtract = ''
|
|
||||||
substituteInPlace $out/AppRun \
|
|
||||||
--replace-fail 'integrate_desktop 2>/dev/null || true' \
|
|
||||||
'true # Desktop integration is provided by the Nix package'
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in
|
|
||||||
appimageTools.wrapAppImage {
|
|
||||||
inherit pname version;
|
|
||||||
src = appimageContents;
|
|
||||||
|
|
||||||
extraInstallCommands = ''
|
|
||||||
install -Dm444 ${appimageContents}/usr/share/applications/io.github.nickvdp.figma-desktop-linux.desktop \
|
|
||||||
-t $out/share/applications
|
|
||||||
substituteInPlace $out/share/applications/io.github.nickvdp.figma-desktop-linux.desktop \
|
|
||||||
--replace-fail 'Exec=AppRun' 'Exec=${pname}'
|
|
||||||
|
|
||||||
install -Dm444 ${appimageContents}/io.github.nickvdp.figma-desktop-linux.png \
|
|
||||||
$out/share/icons/hicolor/256x256/apps/io.github.nickvdp.figma-desktop-linux.png
|
|
||||||
'';
|
|
||||||
|
|
||||||
extraPkgs = pkgs: with pkgs; [
|
|
||||||
libappindicator-gtk3
|
|
||||||
libnotify
|
|
||||||
libsecret
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Figma Desktop for Linux";
|
|
||||||
homepage = "https://github.com/IliyaBrook/figma-linux";
|
|
||||||
license = lib.licenses.unfree;
|
|
||||||
mainProgram = "figma-linux";
|
|
||||||
platforms = [ "x86_64-linux" ];
|
|
||||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
27
pkgs/helium-sync/default.nix
Normal file
27
pkgs/helium-sync/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildGoModule,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
buildGoModule rec {
|
||||||
|
pname = "helium-sync";
|
||||||
|
version = "0.4.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "imnyang";
|
||||||
|
repo = "helium-sync";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-ARd2S9c5iFVvSwFTyZjEB2w1l54vvYBXKZTESWpCqvw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendorHash = "sha256-sWi8QV1uMjfgRMATjXb/qCp6IvBQojtLI3Gr2BHS9Hs=";
|
||||||
|
|
||||||
|
subPackages = [ "cmd/helium-sync" ];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Synchronize selected Helium browser profile data across devices using Amazon S3";
|
||||||
|
homepage = "https://github.com/imnyang/helium-sync";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
mainProgram = "helium-sync";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -8,11 +8,11 @@
|
||||||
pkgs.appimageTools.wrapType2 rec {
|
pkgs.appimageTools.wrapType2 rec {
|
||||||
|
|
||||||
pname = "helium";
|
pname = "helium";
|
||||||
version = "0.12.4.1";
|
version = "0.12.3.1";
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
src = pkgs.fetchurl {
|
||||||
url = "https://github.com/imputnet/helium-linux/releases/download/${version}/${pname}-${version}-x86_64.AppImage";
|
url = "https://github.com/imputnet/helium-linux/releases/download/${version}/${pname}-${version}-x86_64.AppImage";
|
||||||
sha256 = "sha256-OgS8HkLBseFrEhNFJxMwp1bg0gzPdfY1VaySAAp7vq0=";
|
sha256 = "sha256-VnOhzhAulvFNBB/0AD1d+K/TzfFL9Zwtk/vcm5vWl+I=";
|
||||||
};
|
};
|
||||||
|
|
||||||
_enableFeatures =
|
_enableFeatures =
|
||||||
|
|
|
||||||
22
pkgs/vscode-insiders/default.nix
Normal file
22
pkgs/vscode-insiders/default.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = fetchTarball {
|
||||||
|
url = "https://code.visualstudio.com/sha/download?build=insider&os=linux-x64";
|
||||||
|
sha256 = "09dk54da3kwjnvnr2hvwblcba0big2pb1a3bsvgdfhl0sl24p4i1";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
(pkgs.vscode.override {
|
||||||
|
isInsiders = true;
|
||||||
|
}).overrideAttrs (oldAttrs: {
|
||||||
|
pname = "vscode-insiders";
|
||||||
|
version = "1.121.0-insider";
|
||||||
|
isInsiders = true;
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
buildInputs = oldAttrs.buildInputs ++ [ pkgs.krb5 pkgs.libsoup_3 pkgs.webkitgtk_4_1 ];
|
||||||
|
|
||||||
|
meta = oldAttrs.meta // {
|
||||||
|
mainProgram = "code-insiders";
|
||||||
|
};
|
||||||
|
})
|
||||||
Loading…
Reference in a new issue