Skip to content

Commit

Permalink
Nix maintenance (#201)
Browse files Browse the repository at this point in the history
* Nix maintenance

- stdenv.lib has been deprecated (NixOS/nixpkgs#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 <[email protected]>
  • Loading branch information
siraben and Eeems authored Jan 25, 2023
1 parent f08b8c8 commit aaa46ca
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```
12 changes: 6 additions & 6 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nix-inclusive": {
Expand All @@ -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/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
8 changes: 4 additions & 4 deletions oxide.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, inclusive, qt512, remarkable-toolchain }:
{ stdenv, lib, fetchFromGitHub, inclusive, qt512, remarkable-toolchain }:

stdenv.mkDerivation {
name = "oxide";
Expand All @@ -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 ];
Expand Down

0 comments on commit aaa46ca

Please sign in to comment.