1
0
Fork 0
mirror of https://git.madhouse-project.org/actions/nix.git synced 2025-05-09 21:59:53 +02:00

Add a nix/shell action

Since it's basically the same as `nix/develop`, with only the nix
command changed, leverage the existing script.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This commit is contained in:
Gergely Nagy 2023-09-22 21:43:51 +02:00
parent 63e7eb4047
commit 18b41c0333
6 changed files with 109 additions and 1 deletions

25
shell/action.yml Normal file
View file

@ -0,0 +1,25 @@
---
name: nix-shell
author: Gergely Nagy
description: "Run commands within a Nix development environment"
inputs:
flake:
description: "The flake to use for the development environment"
default: "."
required: true
package:
description: "The package to use for the development environment"
required: false
run:
description: "Commands to run within the development environment"
required: false
runs:
using: "composite"
steps:
- id: nix-shell
shell: bash
run: $GITHUB_ACTION_PATH/bin/nix-shell
env:
INPUT_FLAKE: ${{ inputs.flake }}
INPUT_PACKAGE: ${{ inputs.package }}
INPUT_RUN: ${{ inputs.run }}

1
shell/bin/nix-shell Symbolic link
View file

@ -0,0 +1 @@
../../develop/bin/nix-develop

27
shell/test/flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1685566663,
"narHash": "sha256-btHN1czJ6rzteeCuE/PNrdssqYD2nIA4w48miQAFloM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4ecab3273592f27479a583fb6d975d4aba3486fe",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

11
shell/test/flake.nix Normal file
View file

@ -0,0 +1,11 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/23.05";
};
outputs = { self, nixpkgs }:
let pkgs = nixpkgs.legacyPackages.x86_64-linux;
in {
packages.x86_64-linux.hello = pkgs.hello;
};
}