This commit is contained in:
Chloe Bethel 2025-02-10 14:51:16 +00:00
parent 24b41c4faf
commit 7036f5db2a
7 changed files with 1316 additions and 121 deletions

View file

@ -1,5 +1,6 @@
{...} : { { ... }:
networking.hostName = "nixos"; {
networking.hostName = "nixos";
services.openssh.enable = true; services.openssh.enable = true;
users.users.stary = { users.users.stary = {

View file

@ -1,73 +1,109 @@
{...}: { { lib, ... }:
{
# who needs security lmao # who needs security lmao
systemd.services.systemd-journald = { systemd.services.systemd-journald = {
serviceConfig = { serviceConfig = {
DeviceAllow = ""; DeviceAllow = lib.mkForce "";
IPAddressDeny = ""; IPAddressDeny = lib.mkForce "";
LockPersonality = "no"; LockPersonality = lib.mkForce "no";
MemoryDenyWriteExecute = "no"; MemoryDenyWriteExecute = lib.mkForce "no";
NoNewPrivileges = "no"; NoNewPrivileges = lib.mkForce "no";
ProtectClock = "no"; ProtectClock = lib.mkForce "no";
RestrictAddressFamilies = ""; RestrictAddressFamilies = lib.mkForce "";
RestrictNamespaces = ""; RestrictNamespaces = lib.mkForce "";
RestrictRealtime = "no"; RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = "no"; RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
}; };
}; };
systemd.services.systemd-udevd = { systemd.services.systemd-udevd = {
serviceConfig = { serviceConfig = {
DeviceAllow = ""; DeviceAllow = lib.mkForce "";
IPAddressDeny = ""; IPAddressDeny = lib.mkForce "";
LockPersonality = "no"; LockPersonality = lib.mkForce "no";
MemoryDenyWriteExecute = "no"; MemoryDenyWriteExecute = lib.mkForce "no";
NoNewPrivileges = "no"; NoNewPrivileges = lib.mkForce "no";
ProtectClock = "no"; ProtectClock = lib.mkForce "no";
RestrictAddressFamilies = ""; RestrictAddressFamilies = lib.mkForce "";
RestrictNamespaces = ""; RestrictNamespaces = lib.mkForce "";
RestrictRealtime = "no"; RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = "no"; RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
}; };
}; };
systemd.services.systemd-oomd = { systemd.services.systemd-oomd = {
serviceConfig = { serviceConfig = {
DeviceAllow = ""; DeviceAllow = lib.mkForce "";
IPAddressDeny = ""; IPAddressDeny = lib.mkForce "";
LockPersonality = "no"; LockPersonality = lib.mkForce "no";
MemoryDenyWriteExecute = "no"; MemoryDenyWriteExecute = lib.mkForce "no";
NoNewPrivileges = "no"; NoNewPrivileges = lib.mkForce "no";
ProtectClock = "no"; ProtectClock = lib.mkForce "no";
RestrictAddressFamilies = ""; RestrictAddressFamilies = lib.mkForce "";
RestrictNamespaces = ""; RestrictNamespaces = lib.mkForce "";
RestrictRealtime = "no"; RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = "no"; RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
}; };
}; };
systemd.services.systemd-timesyncd = { systemd.services.systemd-timesyncd = {
serviceConfig = { serviceConfig = {
DeviceAllow = ""; DeviceAllow = lib.mkForce "";
IPAddressDeny = ""; IPAddressDeny = lib.mkForce "";
LockPersonality = "no"; LockPersonality = lib.mkForce "no";
MemoryDenyWriteExecute = "no"; MemoryDenyWriteExecute = lib.mkForce "no";
NoNewPrivileges = "no"; NoNewPrivileges = lib.mkForce "no";
ProtectClock = "no"; ProtectClock = lib.mkForce "no";
RestrictAddressFamilies = ""; RestrictAddressFamilies = lib.mkForce "";
RestrictNamespaces = ""; RestrictNamespaces = lib.mkForce "";
RestrictRealtime = "no"; RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = "no"; RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
};
};
systemd.services.systemd-timedated = {
serviceConfig = {
DeviceAllow = lib.mkForce "";
IPAddressDeny = lib.mkForce "";
LockPersonality = lib.mkForce "no";
MemoryDenyWriteExecute = lib.mkForce "no";
NoNewPrivileges = lib.mkForce "no";
ProtectClock = lib.mkForce "no";
RestrictAddressFamilies = lib.mkForce "";
RestrictNamespaces = lib.mkForce "";
RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
};
};
systemd.services.systemd-hostnamed = {
serviceConfig = {
DeviceAllow = lib.mkForce "";
IPAddressDeny = lib.mkForce "";
LockPersonality = lib.mkForce "no";
MemoryDenyWriteExecute = lib.mkForce "no";
NoNewPrivileges = lib.mkForce "no";
ProtectClock = lib.mkForce "no";
RestrictAddressFamilies = lib.mkForce "";
RestrictNamespaces = lib.mkForce "";
RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
}; };
}; };
systemd.services.systemd-logind = { systemd.services.systemd-logind = {
serviceConfig = { serviceConfig = {
DeviceAllow = ""; DeviceAllow = lib.mkForce "";
IPAddressDeny = ""; IPAddressDeny = lib.mkForce "";
LockPersonality = "no"; LockPersonality = lib.mkForce "no";
MemoryDenyWriteExecute = "no"; MemoryDenyWriteExecute = lib.mkForce "no";
NoNewPrivileges = "no"; NoNewPrivileges = lib.mkForce "no";
ProtectClock = "no"; ProtectClock = lib.mkForce "no";
RestrictAddressFamilies = ""; RestrictAddressFamilies = lib.mkForce "";
RestrictNamespaces = ""; RestrictNamespaces = lib.mkForce "";
RestrictRealtime = "no"; RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = "no"; RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
}; };
}; };
systemd.services.dhcpcd = { systemd.services.dhcpcd = {
@ -82,6 +118,7 @@
RestrictNamespaces = lib.mkForce ""; RestrictNamespaces = lib.mkForce "";
RestrictRealtime = lib.mkForce "no"; RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = lib.mkForce "no"; RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
}; };
}; };
systemd.services.nginx = { systemd.services.nginx = {
@ -96,6 +133,7 @@
RestrictNamespaces = lib.mkForce ""; RestrictNamespaces = lib.mkForce "";
RestrictRealtime = lib.mkForce "no"; RestrictRealtime = lib.mkForce "no";
RestrictSUIDSGID = lib.mkForce "no"; RestrictSUIDSGID = lib.mkForce "no";
SystemCallFilter = lib.mkForce "";
}; };
}; };
} }

View file

@ -36,6 +36,11 @@
networking.hostName = "lancom"; networking.hostName = "lancom";
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./lancom-kernel.nix { }); boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./lancom-kernel.nix { });
system.boot.loader.kernelFile = "uImage"; system.boot.loader.kernelFile = "uImage";
fileSystems."/" = {
device = "/dev/nvme0n1p2";
fsType = "ext4";
};
} }
) )
]; ];
@ -50,14 +55,20 @@
(import ./ppc.nix) (import ./ppc.nix)
(import ./nginx.nix) (import ./nginx.nix)
(import ./config.nix) (import ./config.nix)
(import ./disable-systemd-security.nix)
( (
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
networking.hostName = "nixos"; networking.hostName = "nixos";
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./wiiu-kernel.nix { }); boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./wiiu-kernel-6.6.nix { });
system.boot.loader.kernelFile = "dtbImage.wiiu"; system.boot.loader.kernelFile = "dtbImage.wiiu";
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};
} }
) )
]; ];

View file

@ -32,9 +32,4 @@
# temp hack in config # temp hack in config
systemd.tpm2.enable = false; systemd.tpm2.enable = false;
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
} }

1100
stripped-config.nix Normal file

File diff suppressed because it is too large Load diff

41
wiiu-kernel-4.19.nix Normal file
View file

@ -0,0 +1,41 @@
# see https://discourse.nixos.org/t/port-nixos-to-ppc32/11965/13
{
buildLinux,
fetchFromGitLab,
fetchurl,
lib,
stdenv,
...
}@args:
lib.overrideDerivation
(buildLinux (
args
// {
version = "4.19.322-wiiu";
src = fetchFromGitLab {
owner = "linux-wiiu";
repo = "linux-wiiu";
rev = "18a5a3dd77d992da8b154a9f4d1787d8a3a8b20c"; # rewrite-4.19
hash = "sha256-uqH8IPK4wcGKLEFXlwG8FaSTcQ/LmKHT+LZSE2QEvpU=";
};
autoModules = false;
features = {
efiBootStub = false;
iwlwifi = false;
needsCifsUtils = false;
};
enableCommonConfig = false;
defconfig = "wiiu_defconfig";
}
))
(old: {
postInstall =
''
cp arch/powerpc/boot/dtbImage.wiiu $out/
''
+ old.postInstall;
})

View file

@ -28,6 +28,15 @@ lib.overrideDerivation
needsCifsUtils = false; needsCifsUtils = false;
}; };
enableCommonConfig = false;
#structuredExtraConfig = import ./stripped-config.nix {
# version = "6.6.75-wiiu";
# inherit lib stdenv ;
# rustAvailable = true;
# features = {}; # Ensure we know of all extra patches, etc.
#};
defconfig = "wiiu_defconfig"; defconfig = "wiiu_defconfig";
} }
)) ))