From 01d72eac5b7aeafd5af0a0c3d2a6c75d7f533b5d Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 10 Jul 2025 12:27:25 +0200 Subject: [PATCH] feat: use garnix --- .github/workflows/update-nix.yaml | 40 ------------------------------- .gitignore | 4 ++++ README.md | 8 +++---- flake.lock | 22 ++++++++++++++--- flake.nix | 16 +++++++++++-- packages/winapps/default.nix | 26 ++++++++++---------- 6 files changed, 55 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/update-nix.yaml create mode 100644 .gitignore diff --git a/.github/workflows/update-nix.yaml b/.github/workflows/update-nix.yaml deleted file mode 100644 index a1585a8..0000000 --- a/.github/workflows/update-nix.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: "Update Flake Packages" - -permissions: - contents: write - pull-requests: write - -on: - pull_request: - branches: [main] - types: [labeled] - schedule: - - cron: "0 10 * * 0" # https://crontab.guru/#0_10_*_*_0 - -jobs: - build: - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'rebuild nix') - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - with: - trust-runner-user: true - - - name: Set up cache - uses: cachix/cachix-action@v15 - with: - name: winapps - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - - name: Update flake packages - uses: winapps-org/nix-update-action@v1.4.0 - with: - extra-args: --version=branch - skip-pr: "${{ github.event_name == 'pull_request' }}" - - - name: Build packages - run: nix build .#winapps .#winapps-launcher diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..907f156 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/.idea +/.vscode +/result + diff --git a/README.md b/README.md index 0244532..83b704b 100644 --- a/README.md +++ b/README.md @@ -590,8 +590,8 @@ In your `~/.config/nix/nix.conf`: ``` experimental-features = nix-command flakes # specify to use binary cache (optional) -extra-substituters = https://winapps.cachix.org/ -extra-trusted-public-keys = winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g= +extra-substituters = https://cache.garnix.io/ +extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= extra-trusted-users = # replace with your username ``` @@ -641,8 +641,8 @@ nix profile install github:winapps-org/winapps#winapps-launcher # optional { # set up binary cache (optional) nix.settings = { - substituters = [ "https://winapps.cachix.org/" ]; - trusted-public-keys = [ "winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g=" ]; + substituters = [ "https://cache.garnix.io/" ]; + trusted-public-keys = [ "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" ]; }; environment.systemPackages = [ diff --git a/flake.lock b/flake.lock index dc621f0..ea03fc4 100644 --- a/flake.lock +++ b/flake.lock @@ -32,13 +32,28 @@ "type": "github" } }, + "nix-filter": { + "locked": { + "lastModified": 1731533336, + "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1724819573, - "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", + "lastModified": 1751984180, + "narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", + "rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", "type": "github" }, "original": { @@ -52,6 +67,7 @@ "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", + "nix-filter": "nix-filter", "nixpkgs": "nixpkgs" } }, diff --git a/flake.nix b/flake.nix index bc63944..86ec7d7 100644 --- a/flake.nix +++ b/flake.nix @@ -1,17 +1,29 @@ { - description = "WinApps Nix packages & NixOS module"; + description = "WinApps Nix packages"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; flake-utils.url = "github:numtide/flake-utils"; + nix-filter.url = "github:numtide/nix-filter"; + }; + + nixConfig = { + extra-substituters = [ + "https://cache.garnix.io" + ]; + + extra-trusted-public-keys = [ + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + ]; }; outputs = { nixpkgs, flake-utils, + nix-filter, ... }: flake-utils.lib.eachDefaultSystem ( @@ -22,7 +34,7 @@ { formatter = pkgs.nixfmt-rfc-style; - packages.winapps = pkgs.callPackage ./packages/winapps { }; + packages.winapps = pkgs.callPackage ./packages/winapps { inherit nix-filter; }; packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher { }; } ); diff --git a/packages/winapps/default.nix b/packages/winapps/default.nix index 8e2c354..75b7b64 100644 --- a/packages/winapps/default.nix +++ b/packages/winapps/default.nix @@ -1,33 +1,35 @@ { stdenv, lib, - fetchFromGitHub, makeWrapper, - freerdp3, + freerdp, dialog, libnotify, netcat, iproute2, + writeShellScriptBin, + nix-filter ? throw "Pass github:numtide/nix-filter as an argument!", ... }: -let - rev = "ce9a84dc5294c45a4b69847f5164628f7d6a4ae1"; - hash = "sha256-SsyJy9mCwBjKex8mfCnKrzKUM/+xws0EltI2aSkKTuM="; -in stdenv.mkDerivation rec { pname = "winapps"; version = "0-unstable-2025-07-02"; - src = fetchFromGitHub { - owner = "winapps-org"; - repo = "winapps"; - - inherit rev hash; + src = nix-filter { + root = ./../..; + include = [ + "apps" + "install" + "bin" + "LICENSE.md" + "COPYRIGHT.md" + "setup.sh" + ]; }; nativeBuildInputs = [ makeWrapper ]; buildInputs = [ - freerdp3 + (writeShellScriptBin "xfreerdp3" ''${lib.getExe' freerdp "xfreerdp"} "$@"'') libnotify dialog netcat