Add optional system modules

This commit is contained in:
ItsDrike 2024-03-19 08:30:04 +01:00
parent 58d9a3c908
commit ae1c7b257e
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
6 changed files with 64 additions and 8 deletions

View file

@ -3,9 +3,12 @@
in { in {
vboxnix = lib.nixosSystem { vboxnix = lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
../system
./vbox_nix ./vbox_nix
../system
../system/options/systemd-boot.nix
../system/options/cachix.nix
../system/options/oomd.nix
../modules/services/ssh.nix ../modules/services/ssh.nix
]; ];
}; };

View file

@ -1,11 +1,16 @@
{lib, ...}: { lib, pkgs, ...}:
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
boot.loader = { nix.settings = {
systemd-boot.enable = true; max-jobs = 6;
efi.canTouchEfiVariables = true; cores = 6;
timeout = 3; };
security.sudo.package = pkgs.sudo.override { withInsults = true; };
security.polkit.enable = true;
services = {
udisks2.enable = true;
}; };
networking.hostName = "vboxnix"; networking.hostName = "vboxnix";

View file

@ -9,5 +9,18 @@
}; };
}; };
services.resolved.enable = true; services.resolved = {
enable = true;
fallbackDns = [
"9.9.9.9"
"2620:fe::fe"
];
};
# don't wait for network to boot faster
# https://old.reddit.com/r/NixOS/comments/vdz86j/how_to_remove_boot_dependency_on_network_for_a
systemd = {
targets.network-online.wantedBy = lib.mkForce []; # default is [ "multi-user.target" ]
services.NetworkManager-wait-online.wantedBy = lib.mkForce []; # default is [ "network-online.target" ]
};
} }

14
system/options/cachix.nix Normal file
View file

@ -0,0 +1,14 @@
_: {
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://nixpkgs-wayland.cachix.org"
"https://viperml.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
"viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8="
];
};
}

9
system/options/oomd.nix Normal file
View file

@ -0,0 +1,9 @@
_: {
systemd.oomd = {
enable = true;
enableSystemSlice = true;
enableRootSlice = true;
enableUserSlices = true;
};
}

View file

@ -0,0 +1,12 @@
_: {
boot.loader = {
systemd-boot = {
enable = true;
memtest86.enable = true;
editor = true;
};
efi.canTouchEfiVariables = true;
timeout = 3;
};
}