refactor: hide x86_64-specific host config in a module
This commit is contained in:
parent
b52057e317
commit
b334db28c6
|
@ -4,7 +4,6 @@
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./feeds.nix
|
./feeds.nix
|
||||||
./fs.nix
|
./fs.nix
|
||||||
./hardware
|
|
||||||
./home
|
./home
|
||||||
./hosts.nix
|
./hosts.nix
|
||||||
./ids.nix
|
./ids.nix
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./x86_64.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# services.snapper.configs = {
|
|
||||||
# root = {
|
|
||||||
# subvolume = "/";
|
|
||||||
# extraConfig = {
|
|
||||||
# ALLOW_USERS = "colin";
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# services.snapper.snapshotInterval = "daily";
|
|
||||||
}
|
|
|
@ -3,6 +3,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./derived-secrets
|
./derived-secrets
|
||||||
|
./hal
|
||||||
./hosts.nix
|
./hosts.nix
|
||||||
./nixcache.nix
|
./nixcache.nix
|
||||||
./roles
|
./roles
|
||||||
|
|
6
hosts/modules/hal/default.nix
Normal file
6
hosts/modules/hal/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./x86_64.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,7 +1,14 @@
|
||||||
{ lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.hal.x86_64;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf (pkgs.system == "x86_64-linux") {
|
options = {
|
||||||
|
sane.hal.x86_64.enable = (lib.mkEnableOption "x86_64-specific hardware support") // {
|
||||||
|
default = pkgs.system == "x86_64-linux";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
boot.initrd.availableKernelModules = [
|
boot.initrd.availableKernelModules = [
|
||||||
"xhci_pci" "ahci" "sd_mod" "sdhci_pci" # nixos-generate-config defaults
|
"xhci_pci" "ahci" "sd_mod" "sdhci_pci" # nixos-generate-config defaults
|
||||||
"usb_storage" # rpi needed this to boot from usb storage, i think.
|
"usb_storage" # rpi needed this to boot from usb storage, i think.
|
Loading…
Reference in New Issue
Block a user