aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-01-11 13:36:45 -0600
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-01-11 13:36:45 -0600
commitdbc5cb478c7fad1c1750421486252f0a5d98ef9c (patch)
tree2ca74b6cf1db48e2a1a4989b13a6bc7ac6dcfe32
parent32a7e59b93a9c3748cd6aeca3d4fc9dadf8e0f59 (diff)
now there's docs
-rw-r--r--flake.lock59
-rw-r--r--flake.nix15
-rw-r--r--lib/lib.nix14
-rw-r--r--lib/nix-furnace/mkSystem.nix82
-rw-r--r--modules/boot/options.nix9
-rw-r--r--modules/desktop/options.nix112
-rw-r--r--modules/options.nix3
-rw-r--r--modules/secrets/options.nix10
-rw-r--r--modules/services/options.nix43
-rw-r--r--modules/terminal/options.nix10
-rw-r--r--modules/user/options.nix2
11 files changed, 197 insertions, 162 deletions
diff --git a/flake.lock b/flake.lock
index 5832b7a..dae6702 100644
--- a/flake.lock
+++ b/flake.lock
@@ -150,24 +150,6 @@
"type": "github"
}
},
- "flake-parts": {
- "inputs": {
- "nixpkgs-lib": "nixpkgs-lib"
- },
- "locked": {
- "lastModified": 1765835352,
- "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "rev": "a34fae9c08a15ad73f295041fec82323541400a9",
- "type": "github"
- },
- "original": {
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "type": "github"
- }
- },
"gitignore": {
"inputs": {
"nixpkgs": [
@@ -323,18 +305,18 @@
"type": "github"
}
},
- "nixpkgs-lib": {
+ "nmd": {
"locked": {
- "lastModified": 1765674936,
- "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
- "owner": "nix-community",
- "repo": "nixpkgs.lib",
- "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
+ "lastModified": 1759339018,
+ "narHash": "sha256-13x2gvgnnr3cJ5qp7zz7ZnUSrg0DF/sU9KiwZkML6J0=",
+ "owner": "gvolpe",
+ "repo": "nmd",
+ "rev": "5ecbe493e22de649e79c8e51dc5e92659940e081",
"type": "github"
},
"original": {
- "owner": "nix-community",
- "repo": "nixpkgs.lib",
+ "owner": "gvolpe",
+ "repo": "nmd",
"type": "github"
}
},
@@ -371,8 +353,8 @@
"lanzaboote": "lanzaboote",
"nixos-facter-modules": "nixos-facter-modules",
"nixpkgs": "nixpkgs",
- "tmux-tsunami": "tmux-tsunami",
- "tsnsrv": "tsnsrv"
+ "nmd": "nmd",
+ "tmux-tsunami": "tmux-tsunami"
}
},
"rust-overlay": {
@@ -507,27 +489,6 @@
"type": "github"
}
},
- "tsnsrv": {
- "inputs": {
- "flake-parts": "flake-parts",
- "nixpkgs": [
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1767001347,
- "narHash": "sha256-uRm4oWMFUBSmXgofOngMWIyA/yUmLlon6f3XoFTWvBA=",
- "owner": "boinkor-net",
- "repo": "tsnsrv",
- "rev": "8f3fbf69e1517612c0fde9be27522e12c2ddc238",
- "type": "github"
- },
- "original": {
- "owner": "boinkor-net",
- "repo": "tsnsrv",
- "type": "github"
- }
- },
"utils": {
"inputs": {
"systems": "systems_2"
diff --git a/flake.nix b/flake.nix
index 6f71eb4..35afadd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -38,14 +38,13 @@
flake = false;
};
- tsnsrv = {
- url = "github:boinkor-net/tsnsrv";
- inputs.nixpkgs.follows = "nixpkgs";
- };
+ nmd.url = "github:gvolpe/nmd";
};
outputs = inputs: let
- inherit (import ./lib/nix-furnace/mkSystem.nix) mkNixosSystem;
+ inherit (import ./lib/nix-furnace/mkSystem.nix) mkNixosSystem genDocs;
+
+ buildPkgs = import inputs.nixpkgs {system = "x86_64-linux";};
in rec {
nixosConfigurations."mercury" = mkNixosSystem {
inherit inputs;
@@ -63,6 +62,12 @@
username = "collin";
};
+ packages."x86_64-linux".docs = buildPkgs.callPackage genDocs {
+ inherit inputs;
+ pkgs = buildPkgs;
+ hostname = "mercury";
+ };
+
deploy.nodes."ganymede" = {
hostname = "ganymede";
sshUser = "root";
diff --git a/lib/lib.nix b/lib/lib.nix
index 00cc334..56f0dfd 100644
--- a/lib/lib.nix
+++ b/lib/lib.nix
@@ -32,15 +32,21 @@ let
config,
}: let
inherit (lib) mkOption mkEnableOption;
- mkProgramOption = name: {
- enable = mkEnableOption "whether to enable ${name}";
- theme = mkOption {
+
+ mkThemeOption = name:
+ mkOption {
+ description = "Pre-made theme for ${name}";
type = lib.types.enum ["catppuccin" "adwaita" "kanagawa"];
default = config.collinux.theme;
+ defaultText = "config.collinux.theme";
};
+
+ mkProgramOption = name: {
+ enable = mkEnableOption "whether to enable ${name}";
+ theme = mkThemeOption name;
};
in {
- inherit mkProgramOption;
+ inherit mkProgramOption mkThemeOption;
};
in {
inherit globimport;
diff --git a/lib/nix-furnace/mkSystem.nix b/lib/nix-furnace/mkSystem.nix
index 85f952c..2766082 100644
--- a/lib/nix-furnace/mkSystem.nix
+++ b/lib/nix-furnace/mkSystem.nix
@@ -4,6 +4,32 @@ let
listModules = getSubdirs ../../modules;
+ nixosModules = hostname:
+ [
+ ../../modules/options.nix
+ ../../hosts/${hostname}/config.nix
+ (lazyImport ../../hosts/${hostname}/nixos.nix)
+ ]
+ ++ (listModules
+ |> (builtins.map (modName: [
+ (lazyImport ../../modules/${modName}/options.nix)
+ (lazyImport ../../modules/${modName}/nixos/default.nix)
+ ]))
+ |> my-lib.flatten);
+
+ hjemModules = hostname:
+ [
+ ../../modules/options.nix
+ ../../hosts/${hostname}/config.nix
+ (lazyImport ../../hosts/${hostname}/hjem.nix)
+ ]
+ ++ (listModules
+ |> (builtins.map (modName: [
+ (lazyImport ../../modules/${modName}/options.nix)
+ (lazyImport ../../modules/${modName}/hjem/default.nix)
+ ]))
+ |> my-lib.flatten);
+
mkNixosSystem = {
inputs,
hostname,
@@ -17,20 +43,7 @@ let
../../hosts/${hostname}/config.nix
# Nixos-sided modules
- {
- imports =
- [
- ../../modules/options.nix
- ../../hosts/${hostname}/config.nix
- (lazyImport ../../hosts/${hostname}/nixos.nix)
- ]
- ++ (listModules
- |> (builtins.map (modName: [
- (lazyImport ../../modules/${modName}/options.nix)
- (lazyImport ../../modules/${modName}/nixos/default.nix)
- ]))
- |> my-lib.flatten);
- }
+ {imports = nixosModules hostname;}
# Hjem-sided modules
{
@@ -38,18 +51,7 @@ let
inputs.hjem.nixosModules.hjem
];
hjem = {
- extraModules =
- [
- ../../modules/options.nix
- ../../hosts/${hostname}/config.nix
- (lazyImport ../../hosts/${hostname}/hjem.nix)
- ]
- ++ (listModules
- |> (builtins.map (modName: [
- (lazyImport ../../modules/${modName}/options.nix)
- (lazyImport ../../modules/${modName}/hjem/default.nix)
- ]))
- |> my-lib.flatten);
+ extraModules = hjemModules hostname;
specialArgs = {inherit inputs my-lib;};
users.${username} = {
enable = true;
@@ -60,6 +62,32 @@ let
}
];
};
+
+ genDocs = {
+ lib,
+ pkgs,
+ inputs,
+ hostname,
+ ...
+ }: let
+ eval = lib.evalModules {
+ modules = listModules |> (builtins.map (m: (lazyImport ../../modules/${m}/options.nix)));
+ specialArgs = {
+ inherit my-lib pkgs;
+ };
+ check = false;
+ };
+
+ optionsDoc = pkgs.nixosOptionsDoc {
+ inherit (eval) options;
+ };
+ in
+ pkgs.runCommand "options-doc.md" {
+ buildInputs = [pkgs.pandoc];
+ } ''
+ mkdir -p $out
+ cat ${optionsDoc.optionsCommonMark} | pandoc -t html -o - | tee $out/index.html
+ '';
in {
- inherit mkNixosSystem;
+ inherit mkNixosSystem genDocs;
}
diff --git a/modules/boot/options.nix b/modules/boot/options.nix
index 2f670f9..9e85570 100644
--- a/modules/boot/options.nix
+++ b/modules/boot/options.nix
@@ -1,9 +1,11 @@
{
+ my-lib,
config,
lib,
...
}: let
- inherit (lib) mkOption mkEnableOption types;
+ inherit (lib) mkOption mkEnableOption;
+ inherit (my-lib.options {inherit lib config;}) mkThemeOption;
in {
options = {
collinux.boot = {
@@ -15,10 +17,7 @@ in {
};
plymouth = {
enable = mkEnableOption "plymouth bootsplash";
- theme = mkOption {
- type = types.enum ["catppuccin" "adwaita"];
- default = config.collinux.theme;
- };
+ theme = mkThemeOption "plymouth";
};
secureBoot.enable = mkEnableOption "lanzaboote";
};
diff --git a/modules/desktop/options.nix b/modules/desktop/options.nix
index 1067d0b..e59ed68 100644
--- a/modules/desktop/options.nix
+++ b/modules/desktop/options.nix
@@ -6,7 +6,7 @@
...
}: let
inherit (lib) mkOption mkEnableOption types;
- inherit (my-lib.options {inherit lib config;}) mkProgramOption;
+ inherit (my-lib.options {inherit lib config;}) mkProgramOption mkThemeOption;
in {
options = {
collinux.desktop = {
@@ -17,12 +17,14 @@ in {
wallpaper_cmd = mkOption {
type = types.str;
default = "${lib.getExe pkgs.wbg} -s ${config.collinux.desktop.wallpaper}";
+ internal = true;
};
greetd = {
enable = mkEnableOption "greetd greeter";
command = mkOption {
type = lib.types.str;
+ internal = true;
default = let
cfg = config.collinux.desktop;
in
@@ -40,7 +42,6 @@ in {
niri.enable = mkEnableOption "niri";
components = {
- # waybar = mkProgramOption "waybar";
dunst = mkProgramOption "dunst";
fuzzel = mkProgramOption "fuzzel";
};
@@ -49,54 +50,63 @@ in {
gtk = {
enable = mkEnableOption "gtk theming";
- theme = mkOption {
- type = types.enum ["catppuccin" "adwaita" "kanagawa"];
- default = config.collinux.theme;
- };
- cursor_data = {
- package = mkOption {
- type = lib.types.package;
- default =
- if (config.collinux.desktop.gtk.theme == "catppuccin")
- then pkgs.catppuccin-cursors.mochaDark
- else if (config.collinux.desktop.gtk.theme == "adwaita")
- then pkgs.vanilla-dmz
- else null;
- };
- name = mkOption {
- type = lib.types.str;
- default =
- if (config.collinux.desktop.gtk.theme == "catppuccin")
- then "catppuccin-mocha-dark-cursors"
- else if (config.collinux.desktop.gtk.theme == "adwaita")
- then "Vanilla-DMZ"
- else null;
+ theme = mkThemeOption "gtk";
+
+ cursor_data = mkOption {
+ internal = true;
+ type = lib.types.submodule {
+ package = mkOption {
+ internal = true;
+ type = lib.types.package;
+ };
+ name = mkOption {
+ internal = true;
+ type = lib.types.str;
+ };
};
+ default =
+ if config.collinux.desktop.gtk.theme == "catppuccin"
+ then {
+ name = "catppuccin-mocha-dark-cursors";
+ package = pkgs.catppuccin-cursors.mochaDark;
+ }
+ else if config.collinux.gtk.theme == "adwaita"
+ then {
+ name = "Vanilla-DMZ";
+ package = pkgs.vanilla-dmz;
+ }
+ else null;
};
- theme_data = {
- package = mkOption {
- type = lib.types.package;
- default =
- if (config.collinux.desktop.gtk.theme == "catppuccin")
- then
- (pkgs.catppuccin-gtk.override {
- variant = "mocha";
- accents = ["blue"];
- size = "standard";
- })
- else if (config.collinux.desktop.gtk.theme == "adwaita")
- then pkgs.adw-gtk3
- else "";
- };
- name = mkOption {
- type = lib.types.str;
- default =
- if (config.collinux.desktop.gtk.theme == "catppuccin")
- then "catppuccin-mocha-blue-standard"
- else if (config.collinux.desktop.gtk.theme == "adwaita")
- then "adw-gtk3"
- else "";
+
+ theme_data = mkOption {
+ internal = true;
+ type = lib.types.submodule {
+ package = mkOption {
+ internal = true;
+ type = lib.types.package;
+ };
+ name = mkOption {
+ internal = true;
+ type = lib.types.str;
+ };
};
+
+ default =
+ if config.collinux.desktop.gtk.theme == "catppuccin"
+ then {
+ package = pkgs.catppuccin-gtk.override {
+ variant = "mocha";
+ accents = ["blue"];
+ size = "standard";
+ };
+ name = "catppuccin-mocha-blue-standard";
+ }
+ else if config.collinux.desktop.gtk.theme == "adwaita"
+ then {
+ package = pkgs.adw-gtk3;
+ name = "adw-gtk3";
+ }
+ else null;
};
};
@@ -106,11 +116,9 @@ in {
profileName = mkOption {
type = types.str;
default = config.collinux.user.name;
+ internal = true;
};
- theme = mkOption {
- type = types.enum ["none" "catppuccin" "adwaita" "kanagawa"];
- default = config.collinux.theme;
- };
+ theme = mkThemeOption "firefox";
extensions.zotero.enable = mkOption {
description = "install Zotero Connector for Firefox";
default = config.collinux.desktop.programs.research.enable;
@@ -122,7 +130,7 @@ in {
ghostty.enable = mkEnableOption "ghostty";
alacritty.enable = mkEnableOption "alacritty";
- research.enable = mkEnableOption "zathura, Xournal++, Zotero, Zotero Connector";
+ research.enable = mkEnableOption "zathura, Xournal++, Zotero";
};
};
};
diff --git a/modules/options.nix b/modules/options.nix
index 65de32e..8ecf1d7 100644
--- a/modules/options.nix
+++ b/modules/options.nix
@@ -7,15 +7,18 @@
in {
options = {
collinux.theme = mkOption {
+ description = "System-wide theme";
type = types.enum ["catppuccin" "adwaita" "kanagawa"];
};
collinux.palette = let
colorOption = lib.mkOption {
type = lib.types.strMatching "^([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$";
+ internal = true;
};
in
lib.mkOption {
+ internal = true;
type = lib.types.submodule {
options = {
base00 = colorOption;
diff --git a/modules/secrets/options.nix b/modules/secrets/options.nix
index de15f50..fa53d6f 100644
--- a/modules/secrets/options.nix
+++ b/modules/secrets/options.nix
@@ -3,25 +3,33 @@
in {
options = {
collinux.secrets = lib.mkOption {
+ description = "Atribute set of secrets";
type = lib.types.attrsOf (
lib.types.submodule ({config, ...}: {
options = {
name = mkOption {
type = lib.types.str;
default = config._module.args.name;
+ internal = true;
+ };
+ file = mkOption {
+ description = "Name of the file in the /run/secrets.d";
+ type = lib.types.path;
};
- file = mkOption {type = lib.types.path;};
mode = mkOption {
+ description = "Permissions mode of the decrypted secret in a format understood by chmod";
type = lib.types.str;
default = "0400";
};
owner = mkOption {
+ description = "Owner of the decrypted secret file";
type = lib.types.str;
default = "0";
};
path = mkOption {
type = lib.types.str;
default = "/run/secrets.d/${config.name}";
+ description = "Path where the decrypted secret is installed";
};
};
})
diff --git a/modules/services/options.nix b/modules/services/options.nix
index 16bf5ac..231c949 100644
--- a/modules/services/options.nix
+++ b/modules/services/options.nix
@@ -18,36 +18,47 @@ in {
networkd = {
enable = mkEnableOption "use systemd-networkd";
- ssid = mkOption {type = lib.types.str;};
- pskFile = mkOption {type = lib.types.str;};
+ ssid = mkOption {
+ description = "SSID for this network";
+ type = lib.types.str;
+ };
+ pskFile = mkOption {
+ description = "Absolute path to a file containing the pre-shared key for this network";
+ type = lib.types.str;
+ example = "/run/secrets.d/wifi-psk";
+ };
static = lib.mkOption {
+ description = "Set a static IP address for this device on this network. Set to null to use DHCP";
type = lib.types.nullOr (lib.types.submodule {
options = {
- ip = mkOption {type = ip_addr_cidr;};
- gateway = mkOption {type = ip_addr;};
+ ip = mkOption {
+ description = "IP address";
+ type = ip_addr_cidr;
+ };
+ gateway = mkOption {
+ description = "default gateway";
+ type = ip_addr;
+ };
};
});
default = null;
};
};
- tailscale = {
- enable = mkEnableOption "tailscale";
- tailnet = mkOption {
- type = lib.types.str;
- default = "tail7cca06.ts.net";
- };
- };
+
+ tailscale.enable = mkEnableOption "tailscale";
+
sshd = {
enable = mkEnableOption "OpenSSH server";
bind_host = mkOption {
+ description = "The IP address on which OpenSSH will listen for incomming connections. The default, `0.0.0.0`, means 'all interfaces'";
type = ip_addr;
default = "0.0.0.0";
};
};
};
- audio.enable = mkEnableOption "pipewire + wireplumber";
+ audio.enable = mkEnableOption "pipewire and wireplumber";
bluetooth = {
enable = mkEnableOption "bluetooth";
@@ -64,24 +75,28 @@ in {
service_name = mkOption {
type = lib.types.str;
+ internal = true;
};
bind_host = mkOption {
+ description = "The IP address on which ${service_name} will listen for incoming connections. The default, `0.0.0.0`, means 'all interfaces'";
type = ip_addr;
default = "0.0.0.0";
};
port = mkOption {
+ description = "The port on which ${service_name} will listen for incomming connections";
type = lib.types.port;
default = default_port;
};
root_url = mkOption {
+ description = "The final url that this service will be hosted on. Required for caddy, otherwise optional";
type = lib.types.nullOr lib.types.str;
};
caddy = {
enable = mkEnableOption "Automatically create caddy configurations for this service";
- bind_tailscale = mkEnableOption "Bind the service to {service_name}.{tailnet}";
+ bind_tailscale = mkEnableOption "Bind the service to ${service_name}.{tailnet}";
};
};
in {
@@ -103,7 +118,9 @@ in {
caddy = {
enable = mkEnableOption "caddy https server";
envFile = mkOption {
+ description = "Absolute path to file that contains environment variables for caddy operations";
type = lib.types.str;
+ example = "/run/secrets.d/caddy-env";
};
};
};
diff --git a/modules/terminal/options.nix b/modules/terminal/options.nix
index 25e0eb4..8207be3 100644
--- a/modules/terminal/options.nix
+++ b/modules/terminal/options.nix
@@ -6,7 +6,7 @@
...
}: let
inherit (lib) mkOption mkEnableOption types;
- inherit (my-lib.options {inherit lib config;}) mkProgramOption;
+ inherit (my-lib.options {inherit lib config;}) mkProgramOption mkThemeOption;
in {
options = {
collinux.terminal = {
@@ -37,10 +37,11 @@ in {
git = {
enable = mkEnableOption "git";
userName = mkOption {
+ description = "Public name uses for git";
type = types.str;
- default = config.collinux.user.name;
};
userEmail = mkOption {
+ description = "Public email used for git";
type = types.str;
};
installKey = mkEnableOption "automatically install github authentication key";
@@ -48,10 +49,7 @@ in {
helix = {
enable = mkEnableOption "helix text editor";
- theme = mkOption {
- type = lib.types.enum ["catppuccin" "adwaita" "kanagawa"];
- default = config.collinux.theme;
- };
+ theme = mkThemeOption "helix";
hardMode = mkOption {
type = types.bool;
description = "Disable arrow keys and mouse";
diff --git a/modules/user/options.nix b/modules/user/options.nix
index 1024494..d805bf9 100644
--- a/modules/user/options.nix
+++ b/modules/user/options.nix
@@ -4,9 +4,11 @@ in {
options = {
collinux.user = {
name = mkOption {
+ description = "Name for the sole user of this system";
type = types.str;
};
isAdmin = mkOption {
+ description = "Whether this user is an admin";
type = types.bool;
default = true;
};