mirror of
https://github.com/DeterminateSystems/update-flake-lock.git
synced 2024-08-17 01:20:21 +03:00
Update Nix shell and add envrc
This commit is contained in:
parent
cf6776dfd1
commit
b1f8684b21
@ -1,15 +1,10 @@
|
|||||||
# EditorConfig helps developers define and maintain consistent
|
# https://editorconfig.org
|
||||||
# coding styles between different editors and IDEs
|
|
||||||
# editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
[*.{yml,yaml}]
|
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
shellcheck:
|
shellcheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -16,4 +16,4 @@ jobs:
|
|||||||
- name: Enable magic Nix cache
|
- name: Enable magic Nix cache
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
- name: Shellcheck
|
- name: Shellcheck
|
||||||
run: nix-shell --run 'shellcheck $(find . -type f -name "*.sh" -executable)'
|
run: nix develop --command shellcheck $(find . -type f -name "*.sh" -executable)
|
||||||
|
2
.github/workflows/validate.yml
vendored
2
.github/workflows/validate.yml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
14
action.yml
14
action.yml
@ -143,17 +143,9 @@ runs:
|
|||||||
echo "GIT_COMMITTER_NAME=${{ inputs.git-committer-name }}" >> $GITHUB_ENV
|
echo "GIT_COMMITTER_NAME=${{ inputs.git-committer-name }}" >> $GITHUB_ENV
|
||||||
echo "GIT_COMMITTER_EMAIL=<${{ inputs.git-committer-email }}>" >> $GITHUB_ENV
|
echo "GIT_COMMITTER_EMAIL=<${{ inputs.git-committer-email }}>" >> $GITHUB_ENV
|
||||||
- name: Run update-flake-lock.sh
|
- name: Run update-flake-lock.sh
|
||||||
run: $GITHUB_ACTION_PATH/update-flake-lock.sh
|
runs:
|
||||||
shell: bash
|
using: node20
|
||||||
env:
|
main: dist/index.js
|
||||||
GIT_AUTHOR_NAME: ${{ env.GIT_AUTHOR_NAME }}
|
|
||||||
GIT_AUTHOR_EMAIL: ${{ env.GIT_AUTHOR_EMAIL }}
|
|
||||||
GIT_COMMITTER_NAME: ${{ env.GIT_COMMITTER_NAME }}
|
|
||||||
GIT_COMMITTER_EMAIL: ${{ env.GIT_COMMITTER_EMAIL }}
|
|
||||||
NIX_OPTIONS: ${{ inputs.nix-options }}
|
|
||||||
TARGETS: ${{ inputs.inputs }}
|
|
||||||
COMMIT_MSG: ${{ inputs.commit-msg }}
|
|
||||||
PATH_TO_FLAKE_DIR: ${{ inputs.path-to-flake-dir }}
|
|
||||||
- name: Save PR Body as file
|
- name: Save PR Body as file
|
||||||
uses: DamianReeves/write-file-action@v1.3
|
uses: DamianReeves/write-file-action@v1.3
|
||||||
with:
|
with:
|
||||||
|
94281
dist/index.js
vendored
94281
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["function main(): void {}\n\nmain();\n"],"mappings":";AAAA,SAAS,OAAa;AAAC;AAEvB,KAAK;","names":[]}
|
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { ActionOptions, IdsToolbox, inputs } from \"detsys-ts\";\n\nclass UpdateFlakeLockAction {\n idslib: IdsToolbox;\n private nixOptions: string;\n private targets: string;\n private commitMessage: string;\n private pathToFlakeDir: string;\n\n constructor() {\n const options: ActionOptions = {\n name: \"update-flake-lock\",\n // We don't\n fetchStyle: \"universal\",\n requireNix: \"fail\",\n };\n\n this.idslib = new IdsToolbox(options);\n\n this.nixOptions = inputs.getString(\"nix-options\");\n this.targets = inputs.getString(\"inputs\");\n this.commitMessage = inputs.getString(\"commit-msg\");\n this.pathToFlakeDir = inputs.getString(\"path-to-flake-dir\");\n }\n\n async update(): Promise<void> {}\n}\n\nfunction main(): void {\n const updateFlakeLock = new UpdateFlakeLockAction();\n\n updateFlakeLock.idslib.onMain(async () => {\n await updateFlakeLock.update();\n });\n\n updateFlakeLock.idslib.execute();\n}\n\nmain();\n"],"mappings":";AAAA,SAAwB,YAAY,cAAc;AAElD,IAAM,wBAAN,MAA4B;AAAA,EAO1B,cAAc;AACZ,UAAM,UAAyB;AAAA,MAC7B,MAAM;AAAA;AAAA,MAEN,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAEA,SAAK,SAAS,IAAI,WAAW,OAAO;AAEpC,SAAK,aAAa,OAAO,UAAU,aAAa;AAChD,SAAK,UAAU,OAAO,UAAU,QAAQ;AACxC,SAAK,gBAAgB,OAAO,UAAU,YAAY;AAClD,SAAK,iBAAiB,OAAO,UAAU,mBAAmB;AAAA,EAC5D;AAAA,EAEA,MAAM,SAAwB;AAAA,EAAC;AACjC;AAEA,SAAS,OAAa;AACpB,QAAM,kBAAkB,IAAI,sBAAsB;AAElD,kBAAgB,OAAO,OAAO,YAAY;AACxC,UAAM,gBAAgB,OAAO;AAAA,EAC/B,CAAC;AAED,kBAAgB,OAAO,QAAQ;AACjC;AAEA,KAAK;","names":[]}
|
12
flake.lock
12
flake.lock
@ -2,16 +2,16 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696604326,
|
"lastModified": 1713537308,
|
||||||
"narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=",
|
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=",
|
||||||
"rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64",
|
"rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f",
|
||||||
"revCount": 533189,
|
"revCount": 614481,
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.533189%2Brev-87828a0e03d1418e848d3dd3f3014a632e4a4f64/018b0dc8-e84f-7c59-b5d6-16849c3b2074/source.tar.gz"
|
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.614481%2Brev-5c24cf2f0a12ad855f444c30b2421d044120c66f/018efa00-a443-7f41-b371-ce568b5c7e9f/source.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.533189.tar.gz"
|
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
36
flake.nix
36
flake.nix
@ -1,30 +1,24 @@
|
|||||||
{
|
{
|
||||||
description = "update-flake-lock";
|
description = "update-flake-lock";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.533189.tar.gz";
|
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
|
||||||
|
|
||||||
outputs =
|
outputs = { self, nixpkgs }:
|
||||||
{ self
|
|
||||||
, nixpkgs
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
nameValuePair = name: value: { inherit name value; };
|
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "aarch64-linux" "x86_64-darwin" ];
|
||||||
genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
|
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
});
|
||||||
forAllSystems = f: genAttrs allSystems
|
|
||||||
(system: f {
|
|
||||||
inherit system;
|
|
||||||
pkgs = import nixpkgs { inherit system; };
|
|
||||||
});
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShell = forAllSystems
|
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||||
({ system, pkgs, ... }:
|
default = pkgs.mkShell {
|
||||||
pkgs.stdenv.mkDerivation {
|
packages = with pkgs; [
|
||||||
name = "update-flake-lock-devshell";
|
shellcheck
|
||||||
buildInputs = [ pkgs.shellcheck ];
|
nodejs_latest
|
||||||
src = self;
|
nodePackages_latest.pnpm
|
||||||
});
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
38
src/index.ts
38
src/index.ts
@ -1,3 +1,39 @@
|
|||||||
function main(): void {}
|
import { ActionOptions, IdsToolbox, inputs } from "detsys-ts";
|
||||||
|
|
||||||
|
class UpdateFlakeLockAction {
|
||||||
|
idslib: IdsToolbox;
|
||||||
|
private nixOptions: string;
|
||||||
|
private targets: string;
|
||||||
|
private commitMessage: string;
|
||||||
|
private pathToFlakeDir: string;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
const options: ActionOptions = {
|
||||||
|
name: "update-flake-lock",
|
||||||
|
// We don't
|
||||||
|
fetchStyle: "universal",
|
||||||
|
requireNix: "fail",
|
||||||
|
};
|
||||||
|
|
||||||
|
this.idslib = new IdsToolbox(options);
|
||||||
|
|
||||||
|
this.nixOptions = inputs.getString("nix-options");
|
||||||
|
this.targets = inputs.getString("inputs");
|
||||||
|
this.commitMessage = inputs.getString("commit-msg");
|
||||||
|
this.pathToFlakeDir = inputs.getString("path-to-flake-dir");
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(): Promise<void> {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function main(): void {
|
||||||
|
const updateFlakeLock = new UpdateFlakeLockAction();
|
||||||
|
|
||||||
|
updateFlakeLock.idslib.onMain(async () => {
|
||||||
|
await updateFlakeLock.update();
|
||||||
|
});
|
||||||
|
|
||||||
|
updateFlakeLock.idslib.execute();
|
||||||
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
Loading…
Reference in New Issue
Block a user