Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4bfbb80
refactor: put shutdown scripts in own files
tomeon Feb 16, 2024
c50b14e
chore: use (more-)portable shebangs
tomeon Feb 16, 2024
d04e04f
chore: fix shellcheck violations
tomeon Feb 16, 2024
a7920d0
feat(installers): use sudo only if necessary
tomeon Feb 16, 2024
f0a84ff
fix: do not assume `sleep` is `/bin/sleep`
tomeon Feb 16, 2024
a321566
fix: remove unnecessary `sudo` uses
tomeon Feb 16, 2024
20aec1b
feat(shutdownchec.sh): POSIX compatibility
tomeon Feb 16, 2024
18287f7
chore: use shutdowncheck.sh on OpenELEC
tomeon Feb 16, 2024
77d3192
chore: enable shell "strict mode" (`set -eu`)
tomeon Feb 16, 2024
2680a66
feat: do not require whiptail for prompts
tomeon Feb 16, 2024
978f5d5
feat(shutdownchecksetup.sh): support OpenELEC
tomeon Feb 16, 2024
9b7df29
chore: backcompat link for OpenELEC setup script
tomeon Feb 16, 2024
bcb3b85
feat: support `wget` for fetching scripts
tomeon Feb 17, 2024
33ed57f
feat: support specifying source URL components
tomeon Feb 17, 2024
6c9aeb9
fix: add `raw.` to `githubusercontent.com`
tomeon Feb 17, 2024
ae20e7c
feat: support specifying script installation path
tomeon Feb 17, 2024
987f712
fix: only modify /etc/rc.local if it exists
tomeon Feb 17, 2024
511b2e7
feat: support chardev GPIO interface
tomeon Mar 3, 2024
722a057
refactor(shutdownirq): support libgpiod
tomeon Mar 25, 2025
532ef9f
feat: ATX_RASPI_* env vars for configuration
tomeon Mar 25, 2025
2291d4a
feat: support dry-run mode
tomeon Mar 25, 2025
c6fd4cd
chore: shell style
tomeon Mar 25, 2025
b159c0c
feat: init Nix flake
tomeon Feb 17, 2024
b266625
feat: enable additional linters/formatters
tomeon Mar 25, 2025
5af2abb
fix(shutdownirq): no bare `except`
tomeon Mar 25, 2025
88a1698
chore: apply formatters
tomeon Mar 25, 2025
f3f60bb
feat(ci): add GitHub actions config
tomeon Mar 25, 2025
c9caf2c
feat: add .actrc that uses `runner-*` image
tomeon Mar 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-P ubuntu-latest=catthehacker/ubuntu:runner-latest
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2

[*.md]
max_line_length = off
trim_trailing_whitespace = false
indent_size = unset

[*.py]
indent_size = 4

[*.sh]
indent_style = space
indent_size = 4
binary_next_line = true
switch_case_indent = true
space_redirects = false
keep_padding = true
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run ATX-Raspi tests
on:
pull_request:
push:
workflow_dispatch:
jobs:
flake:
name: Run Nix flake checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize Nix store paths
run: |
sudo mkdir -p /nix/store
sudo chmod -R 777 /nix
# https://github.com/cachix/install-nix-action/issues/56#issuecomment-1030697681
- name: Configure Nix store cache
uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ runner.arch }}-nix-store
# See https://github.com/actions/cache/pull/726 and
# https://github.com/actions/cache/issues/494 for caveats on negative
# patterns.
path: |
/nix/store/**
/nix/var/nix/*/*
/nix/var/nix/db/*
/nix/var/nix/db/*/**
!/nix/var/nix/daemon-socket/socket
!/nix/var/nix/userpool/*
!/nix/var/nix/gc.lock
!/nix/var/nix/db/big-lock
!/nix/var/nix/db/reserved
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
system-features = benchmark big-parallel kvm nixos-test uid-range
- name: Run Nix flake checks
run: |
nix flake check -L
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# VM disk images
*.qcow2

# Nix build results
result
result-*
repl-result-*

# NixOS test driver REPL history
.nixos-test-history

# Binary executable.
/nix/pkgs/gpiosimtest/gpiosimtest
206 changes: 206 additions & 0 deletions doc/nixos-modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
## services\.atx-raspi-shutdown\.enable



Whether to enable the ATX-Raspi shutdown daemon\.



*Type:*
boolean



*Default:*
` false `



*Example:*
` true `

*Declared by:*
- [flake\.nix](/flake.nix)



## services\.atx-raspi-shutdown\.package



Package providing the ATX-Raspi daemon\.



*Type:*
package



*Default:*
` <derivation atx-raspi-shutdownirq> `

*Declared by:*
- [flake\.nix](/flake.nix)



## services\.atx-raspi-shutdown\.chip

The path to the GPIO chip\.



*Type:*
null or absolute path



*Default:*
` null `



*Example:*
` "/dev/gpiochip42" `

*Declared by:*
- [flake\.nix](/flake.nix)



## services\.atx-raspi-shutdown\.implementation



GPIO daemon implementation\. “irq” selects the
edge-triggered Python implementation\. “check” selects
the polling-based shell implementation\.



*Type:*
one of “check”, “irq”



*Default:*
` "irq" `



*Example:*
` "check" `

*Declared by:*
- [flake\.nix](/flake.nix)



## services\.atx-raspi-shutdown\.pins\.boot



Pin on ` chip ` to set high upon ATX-Raspi
service startup\.



*Type:*
null or (unsigned integer, meaning >=0)



*Default:*
` null `



*Example:*
` 8 `

*Declared by:*
- [flake\.nix](/flake.nix)



## services\.atx-raspi-shutdown\.pins\.shutdown



Pin on ` chip ` to watch for the shutdown or
reboot button press\.



*Type:*
null or (unsigned integer, meaning >=0)



*Default:*
` null `



*Example:*
` 7 `

*Declared by:*
- [flake\.nix](/flake.nix)



## services\.atx-raspi-shutdown\.pulses\.reboot



Minimum duration of high state on
` pins.shutdown ` to trigger reboot\.



*Type:*
null or floating point number



*Default:*
` null `



*Example:*
` 0.2 `

*Declared by:*
- [flake\.nix](/flake.nix)



## services\.atx-raspi-shutdown\.pulses\.shutdown



Minimum duration of high state on
` pins.shutdown ` to trigger shutdown\.



*Type:*
null or floating point number



*Default:*
` null `



*Example:*
` 0.6 `

*Declared by:*
- [flake\.nix](/flake.nix)


103 changes: 103 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading