Refactored boot

This commit is contained in:
James Patrick 2021-12-15 00:04:57 -05:00
parent 326be5ceee
commit 2d7868490c
6 changed files with 27 additions and 14 deletions

View File

@ -1,10 +0,0 @@
{ config, lib, ... }: {
boot = {
# Enable bootloader & clear /tmp on boot.
cleanTmpDir = true;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
}

View File

@ -13,7 +13,6 @@
./system
./applications
# TODO Refactor everything after this.
./boot.nix
./cli.nix
./fonts.nix
./zfs.nix

View File

@ -5,7 +5,6 @@ in {
imports = [
../applications/firefox.nix
../applications/nextcloud.nix
../boot.nix
../cli.nix
../fonts.nix
../system/gtk.nix

View File

@ -1,6 +1,7 @@
{ config, lib, pkgs, modulesPath, ... }: {
{ config, lib, pkgs, ... }: {
imports = [ ./graphical.nix ];
this.systems.boot.enable = true;
networking.networkmanager.enable = true;
users.users.james.extraGroups = [ "networkmanager" ];
}

22
modules/system/boot.nix Normal file
View File

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
let cfg = config.this.systems.boot;
in with lib; {
options.this.systems.boot = {
enable = mkOption {
default = true;
type = with types; bool;
description = "Is there a physical power button?";
};
};
config = mkIf cfg.enable {
boot = {
# Enable bootloader & clear /tmp on boot.
cleanTmpDir = true;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
};
}

View File

@ -1 +1,3 @@
{ config, pkgs, ... }: { imports = [ ./gtk.nix ./xdg.nix ./flatpak.nix ]; }
{ config, pkgs, ... }: {
imports = [ ./gtk.nix ./boot.nix ./xdg.nix ./flatpak.nix ];
}