From a293fab959bdef2593b82aaf02b7b2192e0907f3 Mon Sep 17 00:00:00 2001 From: Piotr Semenov Date: Thu, 9 May 2024 23:17:04 +0400 Subject: [PATCH] fix: nix flake build freezes in github action, so try magic nix cache + switch to nixos-stable --- .github/workflows/build-artifacts.yml | 2 +- Vagrantfile | 8 +++++--- flake.lock | 2 +- flake.nix | 2 +- nixpkgs.nix | 7 +++++++ shell.nix | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 nixpkgs.nix diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index f2a33a0..844dd03 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -10,7 +10,7 @@ on: paths-ignore: [ "*.md" ] jobs: - Build-VSIX: + Compile-All: runs-on: macos-12 steps: - uses: actions/checkout@v4 diff --git a/Vagrantfile b/Vagrantfile index 17c8546..0a17fa0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -16,9 +16,11 @@ Vagrant.configure("2") do |config| config.vm.provision "shell", privileged: false, inline: <<-'SHELL' cd /vagrant/ - echo "statix check &&\ - nix flake check --impure &&\ - cp \$(nix build --impure --no-link --print-out-paths)/parigp* ./syntaxes/" |\ + nix --version + df -h + echo "statix check && \ + nix flake check --impure && \ + cp \$(nix build --impure --no-link --print-out-paths)/parigp* ./syntaxes/" | \ nix-shell --run bash SHELL end diff --git a/flake.lock b/flake.lock index a5964e1..c1db0ae 100644 --- a/flake.lock +++ b/flake.lock @@ -11,7 +11,7 @@ }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixos-stable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 9c5fcff..3a772b2 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "Builds TextMate grammar for latest version of PARI/GP"; - inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-stable"; outputs = { self, nixpkgs }: let diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 0000000..b0652ee --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,7 @@ +let + lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; +in +import (fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; +}) diff --git a/shell.nix b/shell.nix index 4e43f44..595e18d 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -{ pkgs ? import {} }: +{ pkgs ? (import ./nixpkgs.nix) {} }: pkgs.mkShell { NIX_CONFIG = "experimental-features = nix-command flakes"; nativeBuildInputs = with pkgs; [