Rename repo, add Nil and Alejandra inputs and macOS support (maybe?)

Signed-off-by: Federico Damián Schonborn <fdschonborn@gmail.com>
main
parent 1bd26214c2
commit b9507bdeb5
No known key found for this signature in database
GPG Key ID: 193F70F15C9AB0A0

@ -9,8 +9,8 @@ on:
- main
jobs:
push:
name: Push
inputs:
name: Push Inputs
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -28,8 +28,50 @@ jobs:
- name: Push Flake inputs
run: nix flake archive --json | jq -r '.path,(.inputs | to_entries[].value.path)' | cachix push ablescript
packages-x86_64-linux:
name: Push Packages (x86_64-linux)
runs-on: ubuntu-latest
needs:
- inputs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v17
- name: Setup Cachix
uses: cachix/cachix-action@v10
with:
name: ablescript
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Push packages
run: |
for package in $(nix flake show --json | jq -r '.packages."x86_64-linux" | to_entries[].key'); do
nix build --print-build-logs --json ".#${package}" | jq -r '.[].outputs | to_entries[].value' | cachix push ablescript
done
packages-x86_64-darwin:
name: Push Packages (x86_64-darwin)
runs-on: macos-latest
needs:
- inputs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v17
- name: Setup Cachix
uses: cachix/cachix-action@v10
with:
name: ablescript
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Push packages
run: |
for package in $(nix flake show --json | jq -r '.packages."x86_64-darwin" | to_entries[].key'); do
nix build --print-build-logs --json ".#${package}" | jq -r '.[].outputs | to_entries[].value' | cachix push ablescript
done

@ -1,6 +1,6 @@
# AbleScript for Nix
[![Cachix](https://github.com/FedericoSchonborn/nix-ablescript/actions/workflows/cachix.yaml/badge.svg)](https://github.com/FedericoSchonborn/nix-ablescript/actions/workflows/cachix.yaml)
[![Cachix](https://github.com/FedericoSchonborn/ablescript-nix/actions/workflows/cachix.yaml/badge.svg)](https://github.com/FedericoSchonborn/ablescript-nix/actions/workflows/cachix.yaml)
Nix Flake for AbleScript.
@ -9,7 +9,7 @@ Nix Flake for AbleScript.
### Using `nix run`
```sh
$ nix run github:FedericoSchonborn/nix-ablescript#ablescript
$ nix run github:FedericoSchonborn/ablescript-nix#ablescript
Hi [AbleScript 0.5.2]
:: /*Hello, AbleScript!*/ print;
Hello, AbleScript!
@ -19,7 +19,7 @@ Hello, AbleScript!
### Inside a `nix shell`
```sh
$ nix shell github:FedericoSchonborn/nix-ablescript#ablescript
$ nix shell github:FedericoSchonborn/ablescript-nix#ablescript
[nix-shell] $ ablescript_cli
Hi [AbleScript 0.5.2]
:: /*Hello, AbleScript!*/ print;
@ -35,7 +35,7 @@ Hello, AbleScript!
# Provides:
# packages.${system}.default (-> packages.${system}.ablescript)
# overlays.default (-> overlays.ablescript)
ablescript.url = "github:FedericoSchonborn/nix-ablescript";
ablescript.url = "github:FedericoSchonborn/ablescript-nix";
# ablescript.inputs.nixpkgs.url = "...";
# ablescript.inputs.flake-utils.url = "...";
};
@ -53,7 +53,7 @@ Hello, AbleScript!
# overlays.default (-> overlays.ablescript)
let
ablescript = fetchTarball {
url = "https://github.com/FedericoSchonborn/nix-ablescript/archive/${commitHash}.zip";
url = "https://github.com/FedericoSchonborn/ablescript-nix/archive/${commitHash}.zip";
sha256 = lib.fakeSha256;
};
in

@ -1,6 +1,81 @@
{
"nodes": {
"alejandra": {
"inputs": {
"fenix": "fenix",
"flakeCompat": "flakeCompat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1668317688,
"narHash": "sha256-wC04cwcKyV2TUYXqMibFWkq7WOMIXHw5DrfAJrWHzgI=",
"owner": "kamadorueda",
"repo": "alejandra",
"rev": "378cde949be70caea431682756b36552a58e965d",
"type": "github"
},
"original": {
"owner": "kamadorueda",
"repo": "alejandra",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"alejandra",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1668234453,
"narHash": "sha256-FmuZThToBvRsqCauYJ3l8HJoGLAY5cMULeYEKIaGrRw=",
"owner": "nix-community",
"repo": "fenix",
"rev": "8f219f6b36e8d0d56afa7f67e6e3df63ef013cdb",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakeCompat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
@ -16,27 +91,93 @@
"type": "github"
}
},
"nil": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1668625881,
"narHash": "sha256-cWPlB/gqR30BWKRaeQoToL7vCxTFZNNz1lt0M/fj+ds=",
"owner": "oxalica",
"repo": "nil",
"rev": "bea40f71fc2b918ad6cf2154bcc12521ac664dc2",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "nil",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1668505710,
"narHash": "sha256-DulcfsGjpSXL9Ma0iQIsb3HRbARCDcA+CNH67pPyMQ0=",
"lastModified": 1668650906,
"narHash": "sha256-JuiYfDO23O8oxUUOmhQflmOoJovyC5G4RjcYQMQjrRE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "85d6b3990def7eef45f4502a82496de02a02b6e8",
"rev": "3a86856a13c88c8c64ea32082a851fefc79aa700",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"alejandra": "alejandra",
"flake-compat": "flake-compat",
"nil": "nil",
"nixpkgs": "nixpkgs"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1668182250,
"narHash": "sha256-PYGaOCiFvnJdVz+ZCaKF8geGdffXjJUNcMwaBHv0FT4=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "45ec315e01dc8dd1146dfeb65f0ef6e5c2efed78",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"nil",
"flake-utils"
],
"nixpkgs": [
"nil",
"nixpkgs"
]
},
"locked": {
"lastModified": 1667789120,
"narHash": "sha256-Yid92tEY2CeS8VUiexjSw0hsjfQbRLbUCpqkdVLaEnI=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "528499f67169671e931cf1ba63601803e58abd2a",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",

@ -1,6 +1,16 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nil = {
url = "github:oxalica/nil";
inputs.nixpkgs.follows = "nixpkgs";
};
alejandra = {
url = "github:kamadorueda/alejandra";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat = {
url = "github:edolstra/flake-compat";
@ -8,13 +18,18 @@
};
};
outputs = {nixpkgs, ...}: let
# TODO: macOS support?
forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"];
in rec {
outputs = {
self,
nixpkgs,
nil,
alejandra,
...
}: let
forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
in {
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
in {
ablescript0_5_2 = pkgs.callPackage ./packages/ablescript {
version = "0.5.2";
sha256 = "3AvAqeZmH5foGS0blKbMdQbXgnAY6lNxNnYJhF9GAys=";
@ -53,17 +68,17 @@
cargoSha256 = "172i2RW7CFT5t139hkdLZbsalp9mB+5udKDceXTHOqI=";
};
ablescript = ablescript0_5_2;
default = ablescript;
ablescript = self.packages.${system}.ablescript0_5_2;
default = self.packages.${system}.ablescript;
});
overlays = rec {
ablescript = self: super: {
ablescript = packages.${super.system}.ablescript;
ablescript-unstable = packages.${super.system}.ablescript-unstable;
overlays = {
ablescript = _: super: {
ablescript = self.packages.${super.system}.ablescript;
ablescript-unstable = self.packages.${super.system}.ablescript-unstable;
};
default = ablescript;
default = self.overlays.ablescript;
};
devShells = forAllSystems (system: let
@ -71,20 +86,23 @@
in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nil.packages.${system}.default
just
];
};
});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
formatter = forAllSystems (system: alejandra.packages.${system}.default);
};
nixConfig = {
extra-substituters = [
"https://ablescript.cachix.org"
"https://ablescript.cachix.org/"
"https://alejandra.cachix.org/"
];
extra-trusted-public-keys = [
"ablescript.cachix.org-1:ohFVmuceKGwQHeCRRxP8bZeaPX9c+Yl0wU+yHy7NM4M="
"alejandra.cachix.org-1:NjZ8kI0mf4HCq8yPnBfiTurb96zp1TBWl8EC54Pzjm0="
];
};
}

Loading…
Cancel
Save