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; locate.enable = true;
}; };
system = { system = {
boot.grub.enable = true; boot = {
services.forgejo.enable = true; grub.enable = true;
timeout = 30;
};
services = {
forgejo.enable = true;
grafana.enable = true;
};
programs = { programs = {
editors = { editors = {
helix.enable = true; helix.enable = true;

View file

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

View file

@ -5,13 +5,21 @@
... ...
}: let }: let
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) int;
cfg = config.modules.system.boot; cfg = config.modules.system.boot;
in { in {
options.modules.system.boot = { options.modules.system.boot = {
grub.enable = mkEnableOption "Grub, a bloated boot loader"; grub.enable = mkEnableOption "Grub, a bloated boot loader";
systemd-boot.enable = mkEnableOption "Poetteringboot"; 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 = { config = {
assertions = [ assertions = [
@ -33,7 +41,7 @@ in {
loader = { loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
# I love spamming space # I love spamming space
timeout = 0; timeout = cfg.timeout;
systemd-boot = { systemd-boot = {
enable = cfg.systemd-boot.enable; enable = cfg.systemd-boot.enable;
editor = mkForce false; editor = mkForce false;