Skip to content

Commit 5bca2df

Browse files
authored
Merge pull request #12 from myuron/actrun
add Nix Flake package output for nix run / nix install support
2 parents ab3272e + 51d3400 commit 5bca2df

3 files changed

Lines changed: 68 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,36 @@ https://github.com/user-attachments/assets/7993019c-90af-4271-9516-04fe093f8738
1919
go install github.com/myuron/graftx@latest
2020
```
2121

22+
### Nix Flake
23+
24+
Add `graftx` to your flake inputs and include it in your packages.
25+
26+
```nix
27+
{
28+
inputs = {
29+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
30+
graftx.url = "github:myuron/graftx";
31+
};
32+
33+
outputs = { nixpkgs, graftx, ... }:
34+
let
35+
system = "x86_64-linux"; # or "aarch64-linux", "x86_64-darwin", "aarch64-darwin"
36+
in
37+
{
38+
# Example: NixOS configuration
39+
# environment.systemPackages = [ graftx.packages.${system}.default ];
40+
41+
# Example: home-manager
42+
# home.packages = [ graftx.packages.${system}.default ];
43+
44+
# Example: devShell
45+
devShells.${system}.default = nixpkgs.legacyPackages.${system}.mkShell {
46+
packages = [ graftx.packages.${system}.default ];
47+
};
48+
};
49+
}
50+
```
51+
2252
## Getting Started
2353

2454
```bash

README_ja.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,36 @@ https://github.com/user-attachments/assets/7993019c-90af-4271-9516-04fe093f8738
1919
go install github.com/myuron/graftx@latest
2020
```
2121

22+
### Nix Flake
23+
24+
flake の inputs に `graftx` を追加し、パッケージとして利用できます。
25+
26+
```nix
27+
{
28+
inputs = {
29+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
30+
graftx.url = "github:myuron/graftx";
31+
};
32+
33+
outputs = { nixpkgs, graftx, ... }:
34+
let
35+
system = "x86_64-linux"; # "aarch64-linux", "x86_64-darwin", "aarch64-darwin" も可
36+
in
37+
{
38+
# NixOS の場合
39+
# environment.systemPackages = [ graftx.packages.${system}.default ];
40+
41+
# home-manager の場合
42+
# home.packages = [ graftx.packages.${system}.default ];
43+
44+
# devShell の場合
45+
devShells.${system}.default = nixpkgs.legacyPackages.${system}.mkShell {
46+
packages = [ graftx.packages.${system}.default ];
47+
};
48+
};
49+
}
50+
```
51+
2252
## 起動
2353

2454
```bash

flake.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
};
4949
in
5050
{
51+
packages.default = pkgs.buildGoModule {
52+
pname = "graftx";
53+
version = "0.1.0";
54+
src = ./.;
55+
vendorHash = "sha256-herMHZOw1VTTrIGOhmDnygi2LfRcqDpXEZEX6KsYoWI=";
56+
# サンドボックス環境ではホームディレクトリが存在しないためテストをスキップ
57+
doCheck = false;
58+
};
5159
apps = {
5260
skills-install-local = {
5361
type = "app";

0 commit comments

Comments
 (0)