split up no-rgb and secureboot
This commit is contained in:
parent
1ae9fc29bd
commit
1c904907d6
@ -16,6 +16,8 @@
|
|||||||
./impermanence.nix
|
./impermanence.nix
|
||||||
./usb-secrets.nix
|
./usb-secrets.nix
|
||||||
./age-secrets.nix
|
./age-secrets.nix
|
||||||
|
./secureboot.nix
|
||||||
|
./no-rgb.nix
|
||||||
|
|
||||||
./services/postgresql.nix
|
./services/postgresql.nix
|
||||||
./services/jellyfin.nix
|
./services/jellyfin.nix
|
||||||
@ -100,29 +102,6 @@
|
|||||||
compressor = "zstd";
|
compressor = "zstd";
|
||||||
supportedFilesystems = [ "f2fs" ];
|
supportedFilesystems = [ "f2fs" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
loader.systemd-boot.enable = lib.mkForce false;
|
|
||||||
|
|
||||||
lanzaboote = {
|
|
||||||
enable = true;
|
|
||||||
# needed to be in `/etc/secureboot` for sbctl to work
|
|
||||||
pkiBundle = "/etc/secureboot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
system.activationScripts = {
|
|
||||||
# extract secureboot keys from agenix-decrypted tar
|
|
||||||
"secureboot-keys" = {
|
|
||||||
deps = [ "agenix" ];
|
|
||||||
text = ''
|
|
||||||
#!/bin/sh
|
|
||||||
rm -fr ${config.boot.lanzaboote.pkiBundle} || true
|
|
||||||
mkdir -p ${config.boot.lanzaboote.pkiBundle}
|
|
||||||
${pkgs.gnutar}/bin/tar xf ${config.age.secrets.secureboot-tar.path} -C ${config.boot.lanzaboote.pkiBundle}
|
|
||||||
chown -R root:wheel ${config.boot.lanzaboote.pkiBundle}
|
|
||||||
chmod -R 500 ${config.boot.lanzaboote.pkiBundle}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
@ -197,48 +176,6 @@
|
|||||||
libatasmart
|
libatasmart
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.no-rgb =
|
|
||||||
let
|
|
||||||
no-rgb = (
|
|
||||||
pkgs.writeShellApplication {
|
|
||||||
name = "no-rgb";
|
|
||||||
runtimeInputs = with pkgs; [
|
|
||||||
openrgb
|
|
||||||
coreutils
|
|
||||||
gnugrep
|
|
||||||
];
|
|
||||||
|
|
||||||
text = ''
|
|
||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
NUM_DEVICES=$(openrgb --noautoconnect --list-devices | grep -cE '^[0-9]+: ')
|
|
||||||
|
|
||||||
for i in $(seq 0 $((NUM_DEVICES - 1))); do
|
|
||||||
openrgb --noautoconnect --device "$i" --mode direct --color 000000
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
description = "disable rgb";
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = lib.getExe no-rgb;
|
|
||||||
Type = "oneshot";
|
|
||||||
};
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.hardware.openrgb = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.openrgb-with-all-plugins;
|
|
||||||
motherboard = "amd";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.udev.packages = [ pkgs.openrgb-with-all-plugins ];
|
|
||||||
hardware.i2c.enable = true;
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
nameservers = [
|
nameservers = [
|
||||||
"1.1.1.1"
|
"1.1.1.1"
|
||||||
|
|||||||
49
no-rgb.nix
Normal file
49
no-rgb.nix
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
systemd.services.no-rgb =
|
||||||
|
let
|
||||||
|
no-rgb = (
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "no-rgb";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
openrgb
|
||||||
|
coreutils
|
||||||
|
gnugrep
|
||||||
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
NUM_DEVICES=$(openrgb --noautoconnect --list-devices | grep -cE '^[0-9]+: ')
|
||||||
|
|
||||||
|
for i in $(seq 0 $((NUM_DEVICES - 1))); do
|
||||||
|
openrgb --noautoconnect --device "$i" --mode direct --color 000000
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
description = "disable rgb";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = lib.getExe no-rgb;
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.hardware.openrgb = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.openrgb-with-all-plugins;
|
||||||
|
motherboard = "amd";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.udev.packages = [ pkgs.openrgb-with-all-plugins ];
|
||||||
|
hardware.i2c.enable = true;
|
||||||
|
}
|
||||||
33
secureboot.nix
Normal file
33
secureboot.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
boot = {
|
||||||
|
loader.systemd-boot.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
lanzaboote = {
|
||||||
|
enable = true;
|
||||||
|
# needed to be in `/etc/secureboot` for sbctl to work
|
||||||
|
pkiBundle = "/etc/secureboot";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
system.activationScripts = {
|
||||||
|
# extract secureboot keys from agenix-decrypted tar
|
||||||
|
"secureboot-keys" = {
|
||||||
|
deps = [ "agenix" ];
|
||||||
|
text = ''
|
||||||
|
#!/bin/sh
|
||||||
|
rm -fr ${config.boot.lanzaboote.pkiBundle} || true
|
||||||
|
mkdir -p ${config.boot.lanzaboote.pkiBundle}
|
||||||
|
${pkgs.gnutar}/bin/tar xf ${config.age.secrets.secureboot-tar.path} -C ${config.boot.lanzaboote.pkiBundle}
|
||||||
|
chown -R root:wheel ${config.boot.lanzaboote.pkiBundle}
|
||||||
|
chmod -R 500 ${config.boot.lanzaboote.pkiBundle}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user