From aaa46caf06d85aa144b3bd4659ad3940a8999c43 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Wed, 25 Jan 2023 13:49:27 -0600 Subject: [PATCH] Nix maintenance (#201) * Nix maintenance - stdenv.lib has been deprecated (https://github.com/NixOS/nixpkgs/issues/108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources * Add Nix workflow * Adjust Nix build to use oxide target * Use auth token for cachix Co-authored-by: Nathaniel van Diepen --- .github/workflows/nix.yml | 44 +++++++++++++++++++++++++++++++++++++++ README.md | 6 ++---- nix/sources.json | 12 +++++------ oxide.nix | 8 +++---- 4 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 000000000..edaead1e1 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,44 @@ +name: Build with Nix + +on: + push: + branches: + - master + paths: + - 'applications/**' + - 'shared/**' + - 'assets/**' + - 'interfaces/**' + - 'Makefile' + - '*.nix' + pull_request: + paths: + - 'applications/**' + - 'shared/**' + - 'assets/**' + - 'interfaces/**' + - 'Makefile' + - '*.nix' +jobs: + nix-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@v12 + with: + name: nix-remarkable + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Build + run: nix-build --argstr system 'x86_64-linux' + timeout-minutes: 15 + - run: | + mkdir output + cp -a result/. output/ + - name: Save Artifact + uses: actions/upload-artifact@v3 + with: + name: output + path: output diff --git a/README.md b/README.md index a55cf0b11..76cc70554 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,8 @@ Here is an outdated video of it in action: Install the reMarkable toolchain and then run `make release`. It will produce a folder named `release` containing all the output. ### Nix - -Works on x86_64-linux or macOS with -[linuxkit-nix](https://github.com/nix-community/linuxkit-nix). +Works on x86_64-linux or macOS via [nix-docker](https://github.com/LnL7/nix-docker). ```ShellSession -$ nix build +$ nix-build --argstr system 'x86_64-linux' ``` diff --git a/nix/sources.json b/nix/sources.json index 084bdeb6c..be881ad27 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://github.com/nmattia/niv", "owner": "nmattia", "repo": "niv", - "rev": "ba57d5a29b4e0f2085917010380ef3ddc3cf380f", - "sha256": "1kpsvc53x821cmjg1khvp1nz7906gczq8mp83664cr15h94sh8i4", + "rev": "5830a4dd348d77e39a0f3c4c762ff2663b602d4c", + "sha256": "1d3lsrqvci4qz2hwjrcnd8h5vfkg8aypq3sjd4g3izbc8frwz5sm", "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/ba57d5a29b4e0f2085917010380ef3ddc3cf380f.tar.gz", + "url": "https://github.com/nmattia/niv/archive/5830a4dd348d77e39a0f3c4c762ff2663b602d4c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nix-inclusive": { @@ -29,10 +29,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "db103e0f98d461f3e66cd68702492afca0810db5", - "sha256": "19gz926nqv7ggq281mv2qi1ah6a5slg2vvhsvc5jdnkp28m8f55k", + "rev": "77fda7f672726e1a95c8cd200f27bccfc86c870b", + "sha256": "07qj1d45pkqsmkahbhh7hilwwbvg8vlz1wg497hzjrlx1a57v4y5", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/db103e0f98d461f3e66cd68702492afca0810db5.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/77fda7f672726e1a95c8cd200f27bccfc86c870b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/oxide.nix b/oxide.nix index 3c952ebc3..8d0614453 100644 --- a/oxide.nix +++ b/oxide.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, inclusive, qt512, remarkable-toolchain }: +{ stdenv, lib, fetchFromGitHub, inclusive, qt512, remarkable-toolchain }: stdenv.mkDerivation { name = "oxide"; @@ -14,17 +14,17 @@ stdenv.mkDerivation { ]; preBuild = '' - source ${remarkable-toolchain}/environment-setup-cortexa9hf-neon-oe-linux-gnueabi + source ${remarkable-toolchain}/environment-setup-cortexa9hf-neon-remarkable-linux-gnueabi ''; enableParallelBuilding = true; makeFlags = [ "release" ]; installPhase = '' - cp -r release/. $out + cp -a release/. $out ''; - meta = with stdenv.lib; { + meta = with lib; { description = "A launcher application for the reMarkable tablet"; platform = [ "x86_64-linux" ]; maintainers = [ maintainers.siraben ];