mirror of
https://forgejo.merr.is/annika/nixos.git
synced 2026-02-04 15:45:38 -05:00
Added some of the hardware config stuff
This commit is contained in:
parent
fc3e307d0c
commit
bfba6682f6
7 changed files with 78 additions and 22 deletions
6
modules/nixos/default.nix
Normal file
6
modules/nixos/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware
|
||||
]
|
||||
}
|
||||
28
modules/nixos/hardware/boot.nix
Normal file
28
modules/nixos/hardware/boot.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
boot.loader = lib.mkIf (config.physical && !config.physical) {
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
useOSProber = true;
|
||||
gfxmodeEfi = "1920x1080";
|
||||
configurationLimit = 25;
|
||||
device = "nodev";
|
||||
|
||||
# Display menu indefinitely if holding shift key
|
||||
extraConfig = ''
|
||||
if keystatus --shift; then
|
||||
set timeout=-1
|
||||
else
|
||||
set timeout=3
|
||||
fi
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
boot.supportedFilesystems = lib.mkIf config.physical [ "ntfs" ];
|
||||
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
|
||||
}
|
||||
12
modules/nixos/hardware/default.nix
Normal file
12
modules/nixos/hardware/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
|
||||
import = [
|
||||
./boot.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
physical = lib.mkEnableOption "Whether this machine is a physical device.";
|
||||
server = lib.mkEnableOption "Whether this machine is a server.";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue