NixOS configuration 馃獎
1{ lib, inputs, }: 2let 3 inherit (lib.options) mkOption; 4 inherit (lib.types) bool str int; 5 6 # Simplified one lining mkOption 7 # example: ``mkOpt str "" "Example Option"`` 8 mkOpt = 9 type: default: description: 10 mkOption { inherit type default description; }; 11 12 # Creating options for my services 13 # Inspired from: isabelroses 14 # example: ``mkServiceOpt "service" { port = 3000; host = "127.0.0.1"; domain = "xaiya.dev"; extraConfig = { //// }; } 15 mkServiceOpt = 16 name: 17 { 18 port ? 0, 19 host ? "[::1]", 20 domain ? "xaiya.dev", # Change if new domains/other devices? 21 extraConfig ? {} 22 }: { 23 enable = mkOpt bool false ''Enable the "${name}" service''; 24 port = mkOpt int port ''On what port ${name} runs on''; 25 host = mkOpt str host ''On what host ${name} runs on''; 26 domain = mkOpt str domain ''What domain should be used for ${name}''; 27 } // extraConfig ; 28 29in 30{ 31 inherit 32 mkOpt 33 mkServiceOpt 34 ; 35}