-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0d17924
Showing
6 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: "Build ISO" | ||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
plattform: [x86_64-linux] | ||
include: | ||
- plattform: x86_64-linux | ||
type: iso | ||
attrPath: config.system.build.isoImage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v23 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-23.05 | ||
extra_nix_config: | | ||
system-features = aarch64-linux arm-linux | ||
- run: | | ||
DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update -q -y && sudo apt-get install -q -y tree qemu-system-aarch64 qemu-efi binfmt-support qemu-user-static | ||
- run: nix-build '<nixpkgs/nixos>' -A ${{ matrix.attrPath }} -I nixos-config=${{ matrix.type }}.nix --argstr system ${{ matrix.plattform }} | ||
- run: tree result | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.plattform }}-${{ matrix.type }} | ||
path: result/${{ matrix.type }}/ | ||
if-no-files-found: error | ||
retention-days: 5 | ||
|
||
|
||
create_release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v3 | ||
- name: Display structure of artifacts | ||
run: ls -R | ||
- name: Create Release & Upload Release Assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
# Note: If there is no release name specified, releases created in | ||
# the GitHub UI do not trigger a failure and are modified instead. | ||
draft: false | ||
prerelease: false | ||
# Note: Release notes are only auto-generated if the release was | ||
# created by the Github Action and was not created in the Github UI. | ||
generate_release_notes: true | ||
files: | | ||
./*/*.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# network-setup-mode-trigger-os | ||
|
||
|
||
## Usage | ||
|
||
1. Downaload the provided ISO | ||
2. Copy it onto an USB Stick (for example https://etcher.balena.io/ could be used) | ||
3. Interrupt your normal Boot and instead boot from the USB | ||
4. once booted type `sudo send-network-request enp1s0` to start sending the reset packages on the specified interface | ||
5. connect the wired Network Port of your PC to the unpowered side of an PoE Injector (please do at least a tripple check) | ||
6. connect your AP to the powered side of the PoE Injector, wait a few seconds | ||
7. press Ctrl+C to abort sending the packages | ||
8. (optional) after a while you should be able to ssh into your device with `ssh root@192.168.1.1`. You can terminate the connection with `exit` | ||
9. type "systemctl poweroff" to turn your PC off | ||
10. remove the USB stick and start your PC as you normaly would | ||
11. until the AP loses power it's in the Setup/Config Mode and can be accessed as any other Freifunk Router via 192.168.1.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
{ config, pkgs, lib, ... }: | ||
{ | ||
#isoImage.squashfsCompression = "gzip -Xcompression-level 1"; | ||
|
||
services.openssh.enable = lib.mkForce false; | ||
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password"; | ||
|
||
time.timeZone = "Europe/Berlin"; | ||
|
||
networking.hostName = "setup-mode-trigger"; | ||
|
||
console = { | ||
font = "Lat2-Terminus16"; | ||
keyMap = lib.mkForce "de"; | ||
useXkbConfig = true; | ||
}; | ||
|
||
environment.systemPackages = with pkgs; [ | ||
htop | ||
nano | ||
wget | ||
curl | ||
tcpdump | ||
ethtool | ||
tmux | ||
(import ./ffda-network-setup-mode.nix) | ||
]; | ||
|
||
networking = { | ||
useNetworkd = true; | ||
usePredictableInterfaceNames = true; | ||
useDHCP = false; | ||
}; | ||
|
||
services.getty.helpLine = lib.mkForce '' | ||
##################################################################### | ||
# # | ||
# Run `sudo send-network-request enp1s0` to start sending requests. # | ||
# # | ||
##################################################################### | ||
''; | ||
|
||
systemd.network = { | ||
networks = { | ||
"99-default" = { | ||
matchConfig.Name = "*"; | ||
networkConfig = { | ||
IPv6AcceptRA = true; | ||
DHCP = "yes"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
let | ||
pkgs = import <nixpkgs> {}; | ||
in | ||
|
||
with pkgs; | ||
|
||
stdenv.mkDerivation { | ||
pname = "ffda-network-setup-mode"; | ||
version = "0.1"; | ||
|
||
src = fetchgit { | ||
url = "https://github.com/freifunk-gluon/community-packages.git"; | ||
rev = "ca08c5446221cee0fc3d65b7dff2f12101a3ca59"; | ||
sha256 = "sha256-c2gXp1JFBU2NgGlfuyVj9PkK8Y/+5Iq6BahxxS//V2o="; | ||
sparseCheckout = [ | ||
"ffda-network-setup-mode/src" | ||
]; | ||
deepClone = false; | ||
}; | ||
|
||
buildPhase = '' | ||
gcc ffda-network-setup-mode/src/send-network-request.c | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp a.out $out/bin/send-network-request | ||
''; | ||
|
||
meta = with lib; { | ||
description = "send network setup mode packages over specified interface"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ config, pkgs, ... }: | ||
{ | ||
imports = [ | ||
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix> | ||
|
||
# Provide an initial copy of the NixOS channel so that the user | ||
# doesn't need to run "nix-channel --update" first. | ||
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix> | ||
|
||
./configuration.nix | ||
]; | ||
} |