Compare commits

...

4 commits

Author SHA1 Message Date
007093abe2 forgejo/module.nix: inherit mkEnableOption 2025-04-18 14:37:14 +02:00
4cfde7f4ff tower/configuration.nix: enable grafana 2025-04-18 14:36:40 +02:00
9be6884e47 tower/configuration.nix: set timeout duration of 30 2025-04-18 14:36:23 +02:00
2cdaf65fb5 boot/module.nix: add timeout option
On desktop systems, it is convenient to have the timeout
at zero, and just spam space when trying to start
a previous generation. On servers however, it is preferable
to have some time to choose the generation, which is
quite convenient if you have to acess is remotely via a
web interface, which tend to be quite slow and unresponsive.
2025-04-18 14:34:03 +02:00
3 changed files with 20 additions and 5 deletions

View file

@ -29,8 +29,14 @@
locate.enable = true;
};
system = {
boot.grub.enable = true;
services.forgejo.enable = true;
boot = {
grub.enable = true;
timeout = 30;
};
services = {
forgejo.enable = true;
grafana.enable = true;
};
programs = {
editors = {
helix.enable = true;

View file

@ -6,6 +6,7 @@
}: let
inherit (pkgs) fetchurl;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (config.services.forgejo) customDir user group;
cfg = config.modules.system.services.forgejo;
@ -16,7 +17,7 @@
acmeRoot = "/var/lib/acme/challenges-forgejo";
dataDir = "/srv/data/forgejo";
in {
options.modules.system.services.forgejo.enable = lib.mkEnableOption "forgejo";
options.modules.system.services.forgejo.enable = mkEnableOption "forgejo";
config = mkIf cfg.enable {
modules.system.services = {

View file

@ -5,13 +5,21 @@
...
}: let
inherit (lib.modules) mkForce;
inherit (lib.options) mkEnableOption;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) int;
cfg = config.modules.system.boot;
in {
options.modules.system.boot = {
grub.enable = mkEnableOption "Grub, a bloated boot loader";
systemd-boot.enable = mkEnableOption "Poetteringboot";
timeout = mkOption {
description = ''
Set the boot loader's timeout. This is 0 by default, but preferably longer on remote servers to make switching to previous generations easier.
'';
type = int;
default = 0;
};
};
config = {
assertions = [
@ -33,7 +41,7 @@ in {
loader = {
efi.canTouchEfiVariables = true;
# I love spamming space
timeout = 0;
timeout = cfg.timeout;
systemd-boot = {
enable = cfg.systemd-boot.enable;
editor = mkForce false;