chore: formatting

This commit is contained in:
Malte Tammena 2023-09-10 21:33:56 +02:00
parent 99e71beded
commit 190eba591b
4 changed files with 43 additions and 42 deletions

View file

@ -1,8 +1,4 @@
{
modulesPath,
...
}:
{
{modulesPath, ...}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
# === Boot options ===

View file

@ -1,7 +1,4 @@
{
pkgs,
...
}: {
{pkgs, ...}: {
imports = [
../hardware/intel-nuc.nix
];

View file

@ -53,7 +53,13 @@ in {
(builtins.readFile ../secrets/ca.crt)
];
system.nixos.label = let rev = if builtins.hasAttr "dirtyShortRev" inputs.self then inputs.self.dirtyShortRev else inputs.self.shortRev; in (builtins.concatStringsSep "-" (builtins.sort (x: y: x < y) config.system.nixos.tags)) + config.system.nixos.version + "-SHA:${rev}";
system.nixos.label = let
rev =
if builtins.hasAttr "dirtyShortRev" inputs.self
then inputs.self.dirtyShortRev
else inputs.self.shortRev;
in
(builtins.concatStringsSep "-" (builtins.sort (x: y: x < y) config.system.nixos.tags)) + config.system.nixos.version + "-SHA:${rev}";
# Use some binary caches
nix.settings = {

View file

@ -6,37 +6,39 @@
inputs,
build ? inputs.self.nixosConfigurations.chrysomallon-squamiferum.config.system.build,
...
}: let
netboot = writeShellApplication {
name = "netboot";
runtimeInputs = [pixiecore];
text = ''
exec pixiecore boot \
${build.kernel}/bzImage \
${build.netbootRamdisk}/initrd \
--cmdline "init=${build.toplevel}/init loglevel=4" \
--dhcp-no-bind \
--debug \
--port 64172 \
--status-port 64172 \
"$@"
'';
}; in writeShellApplication {
name = "run-netboot-server";
runtimeInputs = [
netboot
nix
iptables
];
text = ''
# Open required firewall ports
sudo iptables -w -I nixos-fw -p udp -m multiport --dports 67,69,4011 -j ACCEPT
sudo iptables -w -I nixos-fw -p tcp -m tcp --dport 64172 -j ACCEPT
}: let
netboot = writeShellApplication {
name = "netboot";
runtimeInputs = [pixiecore];
text = ''
exec pixiecore boot \
${build.kernel}/bzImage \
${build.netbootRamdisk}/initrd \
--cmdline "init=${build.toplevel}/init loglevel=4" \
--dhcp-no-bind \
--debug \
--port 64172 \
--status-port 64172 \
"$@"
'';
};
in
writeShellApplication {
name = "run-netboot-server";
runtimeInputs = [
netboot
nix
iptables
];
text = ''
# Open required firewall ports
sudo iptables -w -I nixos-fw -p udp -m multiport --dports 67,69,4011 -j ACCEPT
sudo iptables -w -I nixos-fw -p tcp -m tcp --dport 64172 -j ACCEPT
sudo netboot || echo "Closed netboot"
sudo netboot || echo "Closed netboot"
# Close ports
sudo iptables -w -D nixos-fw -p udp -m multiport --dports 67,69,4011 -j ACCEPT
sudo iptables -w -D nixos-fw -p tcp -m tcp --dport 64172 -j ACCEPT
'';
}
# Close ports
sudo iptables -w -D nixos-fw -p udp -m multiport --dports 67,69,4011 -j ACCEPT
sudo iptables -w -D nixos-fw -p tcp -m tcp --dport 64172 -j ACCEPT
'';
}