From 00f4a8b31e8a88206a170afba2e822beaba19b04 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Thu, 20 Jul 2023 09:08:36 +0800 Subject: [PATCH] improve action.yml --- action.yml | 16 ++++++++++------ flake.nix | 45 ++++++++++++++++++++------------------------- package.json | 1 - 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/action.yml b/action.yml index 8130d09..52018b3 100644 --- a/action.yml +++ b/action.yml @@ -1,22 +1,26 @@ -name: "attic" +name: "attic-action" +author: "Ryan Cao" description: "Cache Nix derivations with attic" +branding: + icon: "layers" + color: "blue" + inputs: endpoint: - description: "attic endpoint" + description: "Attic endpoint" required: true cache: - description: "attic cache" + description: "Attic cache name" required: true skip-push: - description: "set to true to disable pushing to the cache" + description: "Disable pushing to the cache automatically" required: false token: - description: "attic token" + description: "Attic authorization token" required: false runs: using: "node16" main: "dist/index.js" post: "dist/index.js" - post-if: "success()" diff --git a/flake.nix b/flake.nix index 516dc54..d49e135 100644 --- a/flake.nix +++ b/flake.nix @@ -5,32 +5,27 @@ nixpkgs.url = "nixpkgs/nixos-unstable"; }; - outputs = - { nixpkgs - , ... - }: - let - mkSystems = sys: builtins.map (arch: "${arch}-${sys}") [ "x86_64" "aarch64" ]; - systems = - mkSystems "linux" - ++ mkSystems "darwin"; + outputs = {nixpkgs, ...}: let + mkSystems = sys: builtins.map (arch: "${arch}-${sys}") ["x86_64" "aarch64"]; + systems = + mkSystems "linux" + ++ mkSystems "darwin"; - forAllSystems = nixpkgs.lib.genAttrs systems; - nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); + forAllSystems = nixpkgs.lib.genAttrs systems; + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); - forEachSystem = fn: - forAllSystems (s: fn nixpkgsFor.${s}); - in - { - devShells = forEachSystem (pkgs: { - default = pkgs.mkShell { - packages = with pkgs; [ - actionlint - nodePackages.pnpm - ]; - }; - }); + forEachSystem = fn: + forAllSystems (s: fn nixpkgsFor.${s}); + in { + devShells = forEachSystem (pkgs: { + default = pkgs.mkShell { + packages = with pkgs; [ + actionlint + nodePackages.pnpm + ]; + }; + }); - formatter = forEachSystem (p: p.nixpkgs-fmt); - }; + formatter = forEachSystem (p: p.nixpkgs-fmt); + }; } diff --git a/package.json b/package.json index 48c21ca..0c6a11f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "build": "esbuild src/index.ts --outdir=dist --platform=node --format=cjs --bundle --minify-whitespace --minify-syntax", "format": "prettier --write ." }, - "keywords": [], "author": "Ryan Cao ", "license": "MIT", "dependencies": {