Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #18

Merged
merged 8 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions .github/workflows/check-flake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: build-flake
on:
workflow_dispatch:
pull_request:
push:
branches: [main]

jobs:
lints:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: nix flake check
18 changes: 18 additions & 0 deletions .github/workflows/update-flake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 1,4' # Run twice a week

jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v23
with:
token: ${{ secrets.FLAKE_UPDATE_TOKEN }}
8 changes: 4 additions & 4 deletions modules/nixos/hw/razer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ in
config = mkIf cfg.enable {
services = {
razer-laptop-control.enable = true;
udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev"
''; # needed for correct permissions for razer-laptop-control
# udev.extraRules = ''
# KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev"
# ''; # needed for correct permissions for razer-laptop-control
};

environment.systemPackages = with pkgs; [ polychromatic ];

dotties.user.extraGroups = [ "plugdev" ];
# dotties.user.extraGroups = [ "plugdev" ];
};
}
42 changes: 42 additions & 0 deletions modules/nixos/system/firewall/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
pkgs,
namespace,
lib,
inputs,
config,
...
}:
let
inherit (lib) mkOption types mkIf;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.system.firewall;
in
{
options.${namespace}.system.firewall.wireguard = {
enable = mkBoolOpt false "whether to set rules to allow all traffic to be routed through a wireguard connection.";
ports = mkOption {
type = types.listOf types.port;
default = [ 58844 ];
description = "the allowed port numbers for wireguard to use.";
};
};

config = mkIf cfg.wireguard.enable {
networking.firewall = {
logReversePathDrops = true;
extraCommands = lib.concatStringsSep "\n" (
map (port: ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport ${toString port} -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport ${toString port} -j RETURN
'') cfg.wireguard.ports
);
extraStopCommands = lib.concatStringsSep "\n" (
map (port: ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport ${toString port} -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport ${toString port} -j RETURN || true
'') cfg.wireguard.ports
);
};
};
}
3 changes: 3 additions & 0 deletions systems/x86_64-linux/blade/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ in
nixHelper = true;
};
security.polkit = enabled;
firewall = {
wireguard = enabled;
};
};

cli = {
Expand Down