Update Nix shell and add envrc
This commit is contained in:
parent
cf6776dfd1
commit
b1f8684b21
10 changed files with 94352 additions and 53 deletions
|
@ -1,15 +1,10 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
# https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
|
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -6,7 +6,7 @@ on:
|
|||
|
||||
jobs:
|
||||
shellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
@ -16,4 +16,4 @@ jobs:
|
|||
- name: Enable magic Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- 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:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
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_EMAIL=<${{ inputs.git-committer-email }}>" >> $GITHUB_ENV
|
||||
- name: Run update-flake-lock.sh
|
||||
run: $GITHUB_ACTION_PATH/update-flake-lock.sh
|
||||
shell: bash
|
||||
env:
|
||||
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 }}
|
||||
runs:
|
||||
using: node20
|
||||
main: dist/index.js
|
||||
- name: Save PR Body as file
|
||||
uses: DamianReeves/write-file-action@v1.3
|
||||
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": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1696604326,
|
||||
"narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=",
|
||||
"rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64",
|
||||
"revCount": 533189,
|
||||
"lastModified": 1713537308,
|
||||
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=",
|
||||
"rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f",
|
||||
"revCount": 614481,
|
||||
"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": {
|
||||
"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": {
|
||||
|
|
30
flake.nix
30
flake.nix
|
@ -1,30 +1,24 @@
|
|||
{
|
||||
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 =
|
||||
{ self
|
||||
, nixpkgs
|
||||
}:
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
nameValuePair = name: value: { inherit name value; };
|
||||
genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
|
||||
|
||||
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
forAllSystems = f: genAttrs allSystems
|
||||
(system: f {
|
||||
inherit system;
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "aarch64-linux" "x86_64-darwin" ];
|
||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
});
|
||||
in
|
||||
{
|
||||
devShell = forAllSystems
|
||||
({ system, pkgs, ... }:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "update-flake-lock-devshell";
|
||||
buildInputs = [ pkgs.shellcheck ];
|
||||
src = self;
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
shellcheck
|
||||
nodejs_latest
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue