Skip to content

Commit 3802a9d

Browse files
template: add guile project
1 parent 596a576 commit 3802a9d

File tree

10 files changed

+133
-0
lines changed

10 files changed

+133
-0
lines changed

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
path = ./template/go;
5050
description = "Setup Go Project";
5151
};
52+
guile = {
53+
path = ./template/guile;
54+
description = "Setup Guile Project";
55+
};
5256
java = {
5357
path = ./template/java;
5458
description = "Setup Java Project";

template/guile/.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; https://editorconfig.org
2+
root = true
3+
4+
; default configuration
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_style = unset
11+
12+
[{*.nix,flake.lock}]
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.{yml,yaml}]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[*.md]
21+
indent_style = space
22+
indent_size = 2
23+
24+
[*.scm]
25+
indent_style = space
26+
indent_size = 2

template/guile/.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: main
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches: [main]
7+
env:
8+
CI_NIX_FLAKE: .#default
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Setup Nix
16+
uses: DeterminateSystems/nix-installer-action@main
17+
- name: Cache Nix
18+
uses: DeterminateSystems/magic-nix-cache-action@main
19+
- name: Lint
20+
run: |
21+
nix develop ${{ env.CI_NIX_FLAKE }} --command \
22+
editorconfig-checker && echo "ok"

template/guile/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# https://github.com/github/gitignore/blob/main/Scheme.gitignore
2+
3+
*.ss~
4+
*.ss#*
5+
.#*.ss
6+
7+
*.scm~
8+
*.scm#*
9+
.#*.scm

template/guile/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nixpkgs/update:
2+
@nix flake lock --override-input nixpkgs github:NixOS/nixpkgs/$(rev)
3+
4+
.PHONY: build test run clean
5+
6+
run:
7+
@guile main.scm

template/guile/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Guile Project

template/guile/flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

template/guile/flake.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
description = "Guile Project";
3+
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
5+
6+
outputs =
7+
{ nixpkgs, ... }:
8+
let
9+
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
10+
in
11+
{
12+
devShells = forAllSystems (
13+
system:
14+
let
15+
pkgs = nixpkgs.legacyPackages.${system};
16+
in
17+
{
18+
default = pkgs.mkShell {
19+
name = "guile-project";
20+
shellHook = ''
21+
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || git init
22+
git config pull.rebase true
23+
${pkgs.neo-cowsay}/bin/cowsay -f sage "Guile Project"
24+
'';
25+
buildInputs = with pkgs; [
26+
editorconfig-checker
27+
guile
28+
guile-lsp-server
29+
];
30+
};
31+
}
32+
);
33+
};
34+
}

template/guile/main.scm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(display "Hello, World!")
2+
(newline)

0 commit comments

Comments
 (0)