organize modules
This commit is contained in:
parent
d7453265a1
commit
d0d4bf9ddb
21 changed files with 54 additions and 69 deletions
21
modules/system/core/bootloader.nix
Normal file
21
modules/system/core/bootloader.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ pkgs, legacy-boot, ... }: {
|
||||
boot = {
|
||||
plymouth.enable = true;
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot = {
|
||||
enable = !legacy-boot;
|
||||
configurationLimit = 3;
|
||||
sortKey = "z-nixos";
|
||||
editor = false;
|
||||
};
|
||||
grub = {
|
||||
enable = legacy-boot;
|
||||
device = "/dev/sda";
|
||||
useOSProber = true;
|
||||
default = "saved";
|
||||
theme = "${pkgs.libsForQt5.breeze-grub}/grub/themes/breeze";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
23
modules/system/core/filesystem.nix
Normal file
23
modules/system/core/filesystem.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ swapfile, ... }:
|
||||
{
|
||||
boot.supportedFilesystems = [
|
||||
"ext4"
|
||||
"btrfs"
|
||||
"vfat"
|
||||
"ntfs"
|
||||
"exfat"
|
||||
];
|
||||
|
||||
swapDevices =
|
||||
if swapfile == 0 then
|
||||
[ ]
|
||||
else
|
||||
[
|
||||
{
|
||||
device = "/swapfile";
|
||||
size = swapfile;
|
||||
}
|
||||
];
|
||||
|
||||
services.fstrim.enable = true;
|
||||
}
|
||||
12
modules/system/core/kernel.nix
Normal file
12
modules/system/core/kernel.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ ... }: {
|
||||
boot = {
|
||||
kernelParams = [
|
||||
#"quiet"
|
||||
"boot.shell_on_fail"
|
||||
"loglevel=3"
|
||||
"rd.systemd.show_status=true"
|
||||
#"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
};
|
||||
}
|
||||
52
modules/system/core/network.nix
Normal file
52
modules/system/core/network.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{ pkgs, wol, ... }: {
|
||||
boot = {
|
||||
kernelModules = [
|
||||
"rndis_host"
|
||||
"cdc_ether"
|
||||
];
|
||||
kernel.sysctl = {
|
||||
"net.ipv4.ip_forward" = 1;
|
||||
"net.ipv6.conf.all.forwarding" = 1;
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
nameservers = [
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."wol" = {
|
||||
enable = wol != "";
|
||||
description = "Wake-on-LAN for ${wol}";
|
||||
requires = [ "network.target" ];
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.ethtool}/bin/ethtool -s ${wol} wol g";
|
||||
Type = "oneshot";
|
||||
};
|
||||
wantedBy = [
|
||||
# just in case
|
||||
"multi-user.target"
|
||||
"sleep.target"
|
||||
"suspend.target"
|
||||
"hibernate.target"
|
||||
"hybrid-sleep.target"
|
||||
"shutdown.target"
|
||||
"reboot.target"
|
||||
"halt.target"
|
||||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
};
|
||||
cloudflare-warp.enable = true;
|
||||
resolved.enable = true;
|
||||
};
|
||||
}
|
||||
21
modules/system/core/virtualization.nix
Normal file
21
modules/system/core/virtualization.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ ... }: {
|
||||
virtualisation = {
|
||||
# waydroid.enable = true;
|
||||
docker.enable = true;
|
||||
# libvirtd = {
|
||||
# enable = true;
|
||||
# qemu = {
|
||||
# package = pkgs.qemu_kvm;
|
||||
# swtpm.enable = true;
|
||||
# runAsRoot = false;
|
||||
# ovmf = {
|
||||
# enable = false;
|
||||
# packages = [(pkgs.OVMF.override {
|
||||
# secureBoot = true;
|
||||
# tpmSupport = true;
|
||||
# }).fd];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue