commit f726ce603303ff2e8cfc3c266c5f257ba55c5434
parent a9799e4953a8a42d9ba3484ce1cb61c0fd99ad3d
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 19 Aug 2022 12:22:34 +0000
systems: some modules updates for wakasu
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
7 files changed, 50 insertions(+), 22 deletions(-)
diff --git a/flake.nix b/flake.nix
@@ -127,8 +127,11 @@
# Common modules
# FIXME: migrate this to elsewhere, or at least split it
./systems/modules/core/default.nix
+ ./systems/modules/desktop/default.nix
+ ./systems/modules/editors/default.nix
./systems/modules/hardware/default.nix
# ./systems/modules/hardware/sane-extra-config.nixos.nix
+ # Profiles probably need to go away
./systems/modules/profiles/avahi.nix
./systems/modules/profiles/base.nix
./systems/modules/profiles/builder.nix
diff --git a/systems/hosts/wakasu.nix b/systems/hosts/wakasu.nix
@@ -52,15 +52,8 @@ in
};
boot = {
- loader.systemd-boot.netbootxyz.enable = true;
+ # FIXME move somewhere else
kernelPackages = pkgs.linuxPackages_latest;
- tmpOnTmpfs = true;
- plymouth = {
- enable = true;
- themePackages = [ pkgs.my.adi1090x-plymouth ];
- theme = "deus_ex";
- # hexagon, green_loader, deus_ex, cuts, sphere, spinner_alt
- };
};
services.udev.extraRules = ''
@@ -72,18 +65,21 @@ in
# Suspend the system when battery level drops to 5% or lower
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="${pkgs.systemd}/bin/systemctl hibernate"
'';
- services.hardware.bolt.enable = true;
+
core.nix = {
# temporary or not
localCaches = [ ];
};
modules = {
+ editors.emacs.enable = true;
hardware = {
yubikey.enable = true;
laptop.enable = true;
};
- desktop.wayland.sway.enable = true;
+ desktop = {
+ wayland.sway.enable = true;
+ };
};
profiles.ssh.enable = true;
@@ -93,10 +89,6 @@ in
];
services = {
- logind.extraConfig = ''
- HandleLidSwitchExternalPower=ignore
- HandleLidSwitchDocked=ignore
- '';
wireguard = {
enable = true;
ips = [ "${metadata.hosts.wakasu.wireguard.addrs.v4}/24" ];
diff --git a/systems/modules/core/boot.nix b/systems/modules/core/boot.nix
@@ -1,5 +1,19 @@
{ config, pkgs }:
+let
+ inherit (lib) mkOption types;
+ cfg = config.core.boot;
+in
{
-
-}-
\ No newline at end of file
+ options = {
+ core.boot.systemd-boot = mkOption {
+ description = "Enable systemd-boot for loading";
+ # This is meant to be disable only on a few cases (qemu images, DigitalOcean droplets, …)
+ default = true;
+ type = types.bool;
+ };
+ };
+ config = {
+ boot.load.systemd-boot.enable = cfg.systemd-boot;
+ };
+}
diff --git a/systems/modules/desktop/base.nix b/systems/modules/desktop/base.nix
@@ -1,20 +1,38 @@
{ config, lib, pkgs, ... }:
let
- inherit (lib) mkIf mkEnableOption mkDefault;
+ inherit (lib) mkIf mkEnableOption mkDefault mkOption types;
cfg = config.modules.desktop;
in
{
options = {
modules.desktop = {
enable = mkEnableOption "desktop configuration";
+ plymouth = {
+ theme = mkOption {
+ default = "deus_ex";
+ description = "Plymouth theme to use for boot (hexagon, green_loader, deus_ex, cuts, sphere, spinner_alt)";
+ type = types.str;
+ };
+ themePackage = mkOption {
+ default = pkgs.my.adi1090x-plymouth;
+ description = "Plymouth theme package to use";
+ type = types.package;
+ };
+ };
};
};
config = mkIf cfg.enable {
+ # Enable netbootxyz if systemd-boot is enabled
+ loader.systemd-boot.netbootxyz.enable = core.boot.systemd-boot;
boot = {
# /tmp to be tmpfs
tmpOnTmpfs = true;
# Enable Plymouth on desktops
- plymouth.enable = true;
+ plymouth = {
+ enable = true;
+ themePackages = [ cfg.plymouth.themePackage ];
+ theme = cfg.plymouth.theme;
+ };
};
# FIXME Fix tmpOnTmpfs
@@ -44,7 +62,7 @@ in
noto-fonts-emoji
noto-fonts-extra
overpass
- symbola
+ # symbola
source-code-pro
twemoji-color-font
ubuntu_font_family
diff --git a/systems/modules/hardware/laptop.nix b/systems/modules/hardware/laptop.nix
@@ -27,9 +27,10 @@ in
];
# Run nix-gc only when on AC power
systemd.services.nix-gc.unitConfig.ConditionACPower = true;
- # When a laptop is docked, ignor the lid state (if the laptop is opened or closed)
+ # When a laptop is docked or on external power, ignore the lid state (if the laptop is opened or closed)
services = {
logind.extraConfig = ''
+ HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
'';
};
diff --git a/systems/modules/profiles/base.nix b/systems/modules/profiles/base.nix
@@ -20,6 +20,7 @@ in
};
};
config = mkIf cfg.enable {
+ warnings = [ "The option 'profiles.base.boot' is deprecated, use 'core.boot.systemd-boot' instead" ];
boot.loader.systemd-boot.enable = cfg.systemd-boot;
environment.pathsToLink = [
"/share/nix-direnv"
diff --git a/systems/modules/profiles/laptop.nix b/systems/modules/profiles/laptop.nix
@@ -11,7 +11,7 @@ in
};
};
config = mkIf cfg.enable {
- warnings = [ "The option 'profiles.laptop' is deprecated, use modules.hardware.laptop instead" ];
+ warnings = [ "The option 'profiles.laptop' is deprecated, use 'modules.hardware.laptop' instead" ];
# Use modules.hardware.enable instead
modules.hardware.laptop.enable = true;
};