From 8b07e190ed19240d99b09b1f63b2ea6ed5f63779 Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 10 Apr 2024 22:45:41 +0530 Subject: [PATCH] hosts/default/configuration.nix -> modules/nixos/{bootloader,kernel}/.default.nix --- .../default/configuration.nix | 15 --------------- .../default/hardware-configuration.nix | 0 home.nix => hosts/default/home.nix | 0 modules/nixos/bootloader/default.nix | 12 ++++++++++++ modules/nixos/kernel/default.nix | 14 ++++++++++++++ 5 files changed, 26 insertions(+), 15 deletions(-) rename configuration.nix => hosts/default/configuration.nix (94%) rename hardware-configuration.nix => hosts/default/hardware-configuration.nix (100%) rename home.nix => hosts/default/home.nix (100%) create mode 100644 modules/nixos/bootloader/default.nix create mode 100644 modules/nixos/kernel/default.nix diff --git a/configuration.nix b/hosts/default/configuration.nix similarity index 94% rename from configuration.nix rename to hosts/default/configuration.nix index 73b8abe..a70247c 100644 --- a/configuration.nix +++ b/hosts/default/configuration.nix @@ -35,23 +35,8 @@ }; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.efi.efiSysMountPoint = "/boot"; - boot.supportedFilesystems = ["ntfs"]; # Kernel modules - boot.kernelModules = ["kvm-intel" "snd-hda-intel" "i8042" "nf_nat_ftp"]; - boot.extraModprobeConfig = '' - options snd-hda-intel model=alc255-acer,dell-headset-multi - options i8042 nopnp=1 - ''; - boot.kernelParams = ["allow-discards"]; - - boot.kernel.sysctl = { - "net.ipv4.conf.all.forwarding" = true; - "net.ipv4.conf.default.forwarding" = true; - }; # Setup keyfile # boot.initrd.secrets = { diff --git a/hardware-configuration.nix b/hosts/default/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/default/hardware-configuration.nix diff --git a/home.nix b/hosts/default/home.nix similarity index 100% rename from home.nix rename to hosts/default/home.nix diff --git a/modules/nixos/bootloader/default.nix b/modules/nixos/bootloader/default.nix new file mode 100644 index 0000000..2f3aadd --- /dev/null +++ b/modules/nixos/bootloader/default.nix @@ -0,0 +1,12 @@ +_: { + boot = { + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + supportedFilesystems = ["ntfs"]; + }; +} diff --git a/modules/nixos/kernel/default.nix b/modules/nixos/kernel/default.nix new file mode 100644 index 0000000..42a6c05 --- /dev/null +++ b/modules/nixos/kernel/default.nix @@ -0,0 +1,14 @@ +_: { + boot = { + kernelModules = ["kvm-intel" "snd-hda-intel" "i8042" "nf_nat_ftp"]; + extraModprobeConfig = '' + options snd-hda-intel model=alc255-acer,dell-headset-multi + options i8042 nopnp=1 + ''; + kernelParams = ["allow-discards"]; + kernel.sysctl = { + "net.ipv4.conf.all.forwarding" = true; + "net.ipv4.conf.default.forwarding" = true; + }; + }; +}