chore: formatting
This commit is contained in:
parent
99e71beded
commit
190eba591b
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
{modulesPath, ...}: {
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
|
||||
# === Boot options ===
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{pkgs, ...}: {
|
||||
imports = [
|
||||
../hardware/intel-nuc.nix
|
||||
];
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue