1
0

Compare commits

..

No commits in common. "2a29a00dfe4e7e775dc746687f646faf93ff5877" and "be044cb59e0bd44d778fae999e4d3a3244081f7c" have entirely different histories.

7 changed files with 19 additions and 84 deletions

View File

@ -72,17 +72,13 @@
(let [e (or (. modules path) [])] (let [e (or (. modules path) [])]
(table.insert e option) (table.insert e option)
(tset modules path e)))) (tset modules path e))))
(tset modules "lib/modules.nix" nil) (each [name module (pairs modules)]
(let [module-names (doto (icollect [n _ (pairs modules)] n) table.sort)] (print (or (read-preamble name) (headline name)))
(io.stderr:write (view module-names)) (let [options (sort-options module)]
(each [_ name (ipairs module-names)] (each [_ o (ipairs options)]
(let [module (. modules name) (if (= o.type "parametrisable s6-rc service definition")
options (sort-options module)] (print-service o)
(print (or (read-preamble name) (headline name))) (print-option o))))))
(each [_ o (ipairs options)]
(if (= o.type "parametrisable s6-rc service definition")
(print-service o)
(print-option o)))))))
;; for each element el, add to table modules keyed on ;; for each element el, add to table modules keyed on
;; el.declarations ;; el.declarations

View File

@ -83,42 +83,19 @@ Creating configuration.nix
========================== ==========================
You need to create a :file:`configuration.nix` that describes your You need to create a :file:`configuration.nix` that describes your device
device and the services that you want to run on it. The best way to and the services that you want to run on it. Start by copying
get started is by reading one of the examples such as :file:`vanilla-configuration.nix` and adjusting it, or look in the `examples`
:file:`examples/rotuer.nix` and modifying it to your needs. directory for some pre-written configurations.
:file:`configuration.nix` conventionally describes the packages, services, :file:`configuration.nix` conventionally describes the packages, services,
user accounts etc of the device. It does not describe the hardware user accounts etc of the device. It does not describe the hardware
itself, which is specified separately in the build command (as you itself, which is specified separately in the build command (as you
will see below). will see below).
Most of the functionality of a Liminix system is driven by *services* Your configuration may include modules: it probably *should*
which are declared by *modules*: thus, to add for example an NTP service include the ``standard`` module unless you understand what it
you first add :file:`modules/ntp` to your ``imports`` list, then does and what happens if you leave it out.
you create a service by calling :code:`config.system.service.ntp.build { .... }`
with the appropriate service-dependent configuration parameters.
.. code-block:: nix
let svc = config.system.service;
in {
# ...
imports = [
./modules/ntp
# ....
];
config.services.ntp = svc.ntp.build {
pools = { "pool.ntp.org" = ["iburst"]; };
makestep = { threshold = 1.0; limit = 3; };
};
A :ref:`full list of module options <module-options>` is provided
later in this manual.
You *most likely* want to include the ``standard`` module unless you
have a quite unusual use case for a very minimal system, in which case
you will understand what it does and what happens if you leave it out.
.. code-block:: nix .. code-block:: nix
@ -342,6 +319,4 @@ Caveats
Configuration options Configuration options
********************* *********************
.. _module-options:
.. include:: modules.rst .. include:: modules.rst

View File

@ -1,7 +1,3 @@
## Base options
## ============
{ lib, pkgs, config, ...}: { lib, pkgs, config, ...}:
let let
inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ; inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ;

View File

@ -1,11 +1,3 @@
## Busybox
## =======
##
## Busybox provides stripped-down versions of many usual
## Linux/Unix tools, and may be configured to include only
## the commands (termed "applets") required by the user or
## by other included modules.
{ lib, pkgs, config, ...}: { lib, pkgs, config, ...}:
let let
inherit (lib) mkOption mkEnableOption types mapAttrsToList; inherit (lib) mkOption mkEnableOption types mapAttrsToList;
@ -55,14 +47,12 @@ in {
programs.busybox = { programs.busybox = {
applets = mkOption { applets = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
description = "Applets required";
default = []; default = [];
example = ["sh" "getty" "login"]; example = ["sh" "getty" "login"];
}; };
options = mkOption { options = mkOption {
# mostly the values are y n or m, but sometimes # mostly the values are y n or m, but sometimes
# other strings are also used # other strings are also used
description = "Other busybox config flags that do not map directly to applet names (often prefixed FEATURE_)";
type = types.attrsOf types.nonEmptyStr; type = types.attrsOf types.nonEmptyStr;
default = { }; default = { };
}; };

View File

@ -1,11 +1,3 @@
## Hardware-dependent options
## ==========================
##
## These are attributes of the hardware not of the application
## you want to run on it, and would usually be set in the "device" file:
## :file:`devices/manuf-model/default.nix`
{ lib, pkgs, config, ...}: { lib, pkgs, config, ...}:
let let
inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ; inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ;

View File

@ -1,12 +1,11 @@
## PPP ## PPP
## === ## ===
## ##
## A PPPoE (PPP over Ethernet) configuration to address the case where ## A rudimentary PPPoE (PPP over Ethernet) configuration to address
## your Liminix device is connected to an upstream network using ## the case where your Liminix device is connected to an upstream
## PPPoE. This is typical for UK broadband connections where the ## network using PPPoE. This is typical for UK broadband connections
## physical connection is made by OpenReach ("Fibre To The X") and ## (except "cable"), and common in some other localities as well: ask
## common in some other localities as well: ask your ISP if this is ## your ISP if this is you.
## you.
{ lib, pkgs, config, ...}: { lib, pkgs, config, ...}:
let let

View File

@ -1,16 +1,3 @@
## Users
## =====
##
## User- and group-related configuration.
##
## Changes made here are reflected in files such as :file:/etc/shadow,
## :file:/etc/passwd, :file:/etc/group etc. If you are familiar with
## user configuration in NixOS, please note that Liminix does not have
## the concept of "mutable users" - files in /etc/ are symlinks to
## the immutable store, so you can't e.g change a password with
## :command:`passwd`
{ lib, pkgs, config, ...}: { lib, pkgs, config, ...}:
let let
inherit (lib) inherit (lib)