difftreelog
fix make indicatif optional
in: trunk
7 files changed
cmds/fleet/Cargo.tomldiffbeforeafterboth--- a/cmds/fleet/Cargo.toml
+++ b/cmds/fleet/Cargo.toml
@@ -22,26 +22,29 @@
base64 = "0.21"
chrono = { version = "0.4", features = ["serde"] }
z85 = "3.0"
-clap = { version = "4.5", features = [
- "derive",
- "env",
- "wrap_help",
- "unicode",
-] }
+clap = { version = "4.5", features = ["derive", "env", "wrap_help", "unicode"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
tokio-util = { version = "0.7", features = ["codec"] }
async-trait = "0.1"
futures = "0.3"
-tracing-indicatif = "0.3"
-indicatif = "0.17"
itertools = "0.12"
shlex = "1.3"
tabled = { version = "0.15" }
-owo-colors = { version = "4.0", features = ["supports-color", "supports-colors"] }
+owo-colors = { version = "4.0", features = [
+ "supports-color",
+ "supports-colors",
+] }
r2d2 = "0.8.10"
abort-on-drop = "0.2"
unindent = "0.2"
regex = "1.10"
openssh = "0.10"
-human-repr = "1.1"
+
+tracing-indicatif = { version = "0.3", optional = true }
+human-repr = { version = "1.1", optional = true }
+indicatif = { version = "0.17", optional = true }
+
+[features]
+# Not quite stable
+indicatif = ["tracing-indicatif", "dep:indicatif", "human-repr", "better-command/indicatif"]
cmds/fleet/src/main.rsdiffbeforeafterboth--- a/cmds/fleet/src/main.rs
+++ b/cmds/fleet/src/main.rs
@@ -26,10 +26,13 @@
use futures::stream::FuturesUnordered;
use futures::TryStreamExt;
use host::{Config, FleetOpts};
+#[cfg(feature = "indicatif")]
use human_repr::HumanCount;
+#[cfg(feature = "indicatif")]
use indicatif::{ProgressState, ProgressStyle};
use tracing::{error, info};
use tracing::{info_span, Instrument};
+#[cfg(feature = "indicatif")]
use tracing_indicatif::IndicatifLayer;
use tracing_subscriber::{prelude::*, EnvFilter};
@@ -108,6 +111,7 @@
}
fn setup_logging() {
+ #[cfg(feature = "indicatif")]
let indicatif_layer = IndicatifLayer::new().with_progress_style(
ProgressStyle::with_template(
"{color_start}{span_child_prefix} {span_name}{{{span_fields}}}{color_end} {wide_msg} {color_start}{download_progress} {elapsed}{color_end}",
@@ -127,6 +131,7 @@
.with_key(
"color_start",
|state: &ProgressState, writer: &mut dyn std::fmt::Write| {
+ use std::time::Duration;
let elapsed = state.elapsed();
if elapsed > Duration::from_secs(60) {
@@ -150,16 +155,18 @@
let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
- tracing_subscriber::registry()
- .with(
- tracing_subscriber::fmt::layer()
- .without_time()
- .with_target(true)
- .with_writer(indicatif_layer.get_stdout_writer())
- .with_filter(filter), // .withou,
- )
- .with(indicatif_layer)
- .init();
+ let reg = tracing_subscriber::registry().with({
+ let sub = tracing_subscriber::fmt::layer()
+ .without_time()
+ .with_target(true);
+ #[cfg(feature = "indicatif")]
+ let sub = sub.with_writer(indicatif_layer.get_stdout_writer());
+ sub.with_filter(filter) // .withou,
+ });
+ // #[cfg(feature = "indicatif")]
+ #[cfg(feature = "indicatif")]
+ let reg = reg.with(indicatif_layer);
+ reg.init();
}
#[tokio::main]
cmds/install-secrets/Cargo.tomldiffbeforeafterboth--- a/cmds/install-secrets/Cargo.toml
+++ b/cmds/install-secrets/Cargo.toml
@@ -6,7 +6,7 @@
[dependencies]
age = { version = "0.10.0", features = ["ssh"] }
anyhow = "1.0.79"
-tracing-subscriber = "0.3"
+tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing = "0.1"
nix = {version = "0.27.1", features = ["user", "fs"]}
serde = { version = "1.0.196", features = ["derive"] }
crates/better-command/Cargo.tomldiffbeforeafterboth--- a/crates/better-command/Cargo.toml
+++ b/crates/better-command/Cargo.toml
@@ -9,4 +9,8 @@
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tracing = "0.1"
-tracing-indicatif = "0.3"
+
+tracing-indicatif = { version = "0.3", optional = true }
+
+[features]
+indicatif = ["tracing-indicatif"]
crates/better-command/src/handler.rsdiffbeforeafterboth1//! Collection of handlers, which transform program-specific stdout format to tracing23use std::collections::HashMap;4use std::sync::{Arc, Mutex};56use once_cell::sync::Lazy;7use regex::Regex;8use serde::Deserialize;9use tracing::{Span, info, warn, info_span};10use tracing_indicatif::span_ext::IndicatifSpanExt as _;1112pub trait Handler: Send {13 fn handle_line(&mut self, e: &str);14}1516/// Handler wrapper, which can be cloned.17pub struct ClonableHandler<H>(Arc<Mutex<H>>);18impl<H> Clone for ClonableHandler<H> {19 fn clone(&self) -> Self {20 Self(self.0.clone())21 }22}23impl<H> ClonableHandler<H> {24 pub fn new(inner: H) -> Self {25 Self(Arc::new(Mutex::new(inner)))26 }27}28impl<H: Handler> Handler for ClonableHandler<H> {29 fn handle_line(&mut self, e: &str) {30 self.0.lock().unwrap().handle_line(e)31 }32}3334/// Converts command output to tracing lines35pub struct PlainHandler;36impl Handler for PlainHandler {37 fn handle_line(&mut self, e: &str) {38 info!(target: "log", "{e}");39 }40}4142/// Ignores output43pub struct NoopHandler;44impl Handler for NoopHandler {45 fn handle_line(&mut self, _e: &str) {}46}4748/// Transform nix internal-json logs to tracing spans.49#[derive(Default)]50pub struct NixHandler {51 spans: HashMap<u64, Span>,52}53#[derive(Deserialize, Debug)]54#[serde(untagged)]55enum LogField {56 String(String),57 Num(u64),58}5960/// Nix internal-json log line type61#[derive(Deserialize, Debug)]62#[serde(rename_all = "camelCase", tag = "action")]63#[allow(dead_code)]64enum NixLog {65 Msg {66 level: u32,67 msg: String,68 raw_msg: Option<String>,69 },70 Start {71 id: u64,72 level: u32,73 #[serde(default)]74 fields: Vec<LogField>,75 text: String,76 #[serde(rename = "type")]77 typ: u32,78 },79 Stop {80 id: u64,81 },82 Result {83 id: u64,84 #[serde(rename = "type")]85 typ: u32,86 #[serde(default)]87 fields: Vec<LogField>,88 },89}90fn process_message(m: &str) -> String {91 // Supposed to remove formatting characters except colors, as some programs try to reset cursor position etc.92 static OSC_CLEANER: Lazy<Regex> =93 Lazy::new(|| Regex::new(r"\x1B\]([^\x07\x1C]*[\x07\x1C])?|\r").unwrap());94 static DETABBER: Lazy<Regex> = Lazy::new(|| Regex::new(r"\t").unwrap());95 let m = OSC_CLEANER.replace_all(m, "");96 // Indicatif can't format tabs. This is not the correct tab formatting, as correct one should be aligned,97 // and not just be replaced with the constant number of spaces, but it's ok for now, as statuses are single-line.98 DETABBER.replace_all(m.as_ref(), " ").to_string()99}100impl Handler for NixHandler {101 fn handle_line(&mut self, e: &str) {102 if let Some(e) = e.strip_prefix("@nix ") {103 let log: NixLog = match serde_json::from_str(e) {104 Ok(l) => l,105 Err(err) => {106 warn!("failed to parse nix log line {:?}: {}", e, err);107 return;108 }109 };110 match log {111 NixLog::Msg { msg, raw_msg, .. } => {112 #[allow(clippy::nonminimal_bool)]113 if !(msg.starts_with("\u{1b}[35;1mwarning:\u{1b}[0m Git tree '") && msg.ends_with("' is dirty"))114 && !msg.starts_with("\u{1b}[35;1mwarning:\u{1b}[0m not writing modified lock file of flake")115 && msg != "\u{1b}[35;1mwarning:\u{1b}[0m \u{1b}[31;1merror:\u{1b}[0m SQLite database '\u{1b}[35;1m/nix/var/nix/db/db.sqlite\u{1b}[0m' is busy" {116 if let Some(raw_msg) = raw_msg {117 if !msg.is_empty() {118 info!(target: "nix", "{}\n{}", raw_msg.trim_end(), msg.trim_end())119 } else {120 info!(target: "nix", "{}", raw_msg.trim_end())121 }122 } else {123 info!(target: "nix", "{}", msg.trim_end())124 }125 }126 }127 NixLog::Start {128 ref fields,129 typ,130 id,131 ..132 } if typ == 105 && !fields.is_empty() => {133 if let [LogField::String(drv), ..] = &fields[..] {134 let mut drv = drv.as_str();135 if let Some(pkg) = drv.strip_prefix("/nix/store/") {136 let mut it = pkg.splitn(2, '-');137 it.next();138 if let Some(pkg) = it.next() {139 drv = pkg;140 }141 }142 info!(target: "nix","building {}", drv);143 let span = info_span!("build", drv);144 span.pb_start();145 self.spans.insert(id, span);146 } else {147 warn!("bad build log: {:?}", log)148 }149 }150 NixLog::Start {151 ref fields,152 typ,153 id,154 ..155 } if typ == 100 && fields.len() >= 3 => {156 if let [LogField::String(drv), LogField::String(from), LogField::String(to), ..] =157 &fields[..]158 {159 let mut drv = drv.as_str();160161 if let Some(pkg) = drv.strip_prefix("/nix/store/") {162 let mut it = pkg.splitn(2, '-');163 it.next();164 if let Some(pkg) = it.next() {165 drv = pkg;166 }167 }168 info!(target: "nix","copying {} {} -> {}", drv, from, to);169 let span = info_span!("copy", from, to, drv);170 span.pb_start();171 self.spans.insert(id, span);172 } else {173 warn!("bad copy log: {:?}", log)174 }175 }176 NixLog::Start { text, typ, id, .. }177 if typ == 0 || typ == 102 || typ == 103 || typ == 104 =>178 {179 if !text.is_empty()180 && text != "querying info about missing paths"181 && text != "copying 0 paths"182 // Too much spam on lazy-trees branch183 && !(text.starts_with("copying '") && text.ends_with("' to the store"))184 {185 let span = info_span!("job");186 span.pb_start();187 span.pb_set_message(&process_message(text.trim()));188 self.spans.insert(id, span);189 info!(target: "nix", "{}", text);190 }191 }192 NixLog::Start {193 text,194 level: 0,195 typ: 108,196 ..197 } if text.is_empty() => {198 // Cache lookup? Coupled with copy log199 }200 NixLog::Start {201 text,202 level: 4,203 typ: 109,204 ..205 } if text.starts_with("querying info about ") => {206 // Cache lookup207 }208 NixLog::Start {209 text,210 level: 4,211 typ: 101,212 ..213 } if text.starts_with("downloading ") => {214 // NAR downloading, coupled with copy log215 }216 NixLog::Start {217 text,218 level: 1,219 typ: 111,220 ..221 } if text.starts_with("waiting for a machine to build ") => {222 // Useless repeating notification about build223 }224 NixLog::Start {225 text,226 level: 3,227 typ: 111,228 ..229 } if text.starts_with("resolved derivation: ") => {230 // CA resolved231 }232 NixLog::Start {233 text,234 level: 1,235 typ: 111,236 id,237 ..238 } if text.starts_with("waiting for lock on ") => {239 let mut drv = text.strip_prefix("waiting for lock on ").unwrap();240 if let Some(txt) = drv.strip_prefix("\u{1b}[35;1m'") {241 drv = txt;242 }243 if let Some(txt) = drv.strip_suffix("'\u{1b}[0m") {244 drv = txt;245 }246 if let Some(txt) = drv.split("', '").next() {247 drv = txt;248 }249 if let Some(pkg) = drv.strip_prefix("/nix/store/") {250 let mut it = pkg.splitn(2, '-');251 it.next();252 if let Some(pkg) = it.next() {253 drv = pkg;254 }255 }256 let span = info_span!("waiting on drv", drv);257 span.pb_start();258 self.spans.insert(id, span);259 // Concurrent build of the same message260 }261 NixLog::Stop { id, .. } => {262 self.spans.remove(&id);263 }264 NixLog::Result { fields, id, typ } if typ == 101 && !fields.is_empty() => {265 if let Some(span) = self.spans.get(&id) {266 if let LogField::String(s) = &fields[0] {267 span.pb_set_message(&process_message(s.trim()));268 } else {269 warn!("bad fields: {fields:?}");270 }271 } else {272 warn!("unknown result id: {id} {typ} {fields:?}");273 }274 // dbg!(fields, id, typ);275 }276 NixLog::Result { fields, id, typ } if typ == 105 && fields.len() >= 4 => {277 if let Some(span) = self.spans.get(&id) {278 if let [LogField::Num(done), LogField::Num(expected), LogField::Num(_running), LogField::Num(_failed)] =279 &fields[..4]280 {281 span.pb_set_length(*expected);282 span.pb_set_position(*done);283 } else {284 warn!("bad fields: {fields:?}");285 }286 } else {287 // warn!("unknown result id: {id} {typ} {fields:?}");288 // Unaccounted progress.289 }290 // dbg!(fields, id, typ);291 }292 NixLog::Result { typ, .. } if typ == 104 || typ == 106 => {293 // Set phase, expected294 }295 _ => warn!("unknown log: {:?}", log),296 };297 } else {298 let e = e.trim();299 if e.starts_with("Failed tcsetattr(TCSADRAIN): ") {300 return;301 }302 info!("{e}")303 }304 }305}1//! Collection of handlers, which transform program-specific stdout format to tracing23use std::collections::HashMap;4use std::sync::{Arc, Mutex};56use once_cell::sync::Lazy;7use regex::Regex;8use serde::Deserialize;9use tracing::{info, info_span, warn, Span};10#[cfg(feature = "indicatif")]11use tracing_indicatif::span_ext::IndicatifSpanExt as _;1213pub trait Handler: Send {14 fn handle_line(&mut self, e: &str);15}1617/// Handler wrapper, which can be cloned.18pub struct ClonableHandler<H>(Arc<Mutex<H>>);19impl<H> Clone for ClonableHandler<H> {20 fn clone(&self) -> Self {21 Self(self.0.clone())22 }23}24impl<H> ClonableHandler<H> {25 pub fn new(inner: H) -> Self {26 Self(Arc::new(Mutex::new(inner)))27 }28}29impl<H: Handler> Handler for ClonableHandler<H> {30 fn handle_line(&mut self, e: &str) {31 self.0.lock().unwrap().handle_line(e)32 }33}3435/// Converts command output to tracing lines36pub struct PlainHandler;37impl Handler for PlainHandler {38 fn handle_line(&mut self, e: &str) {39 info!(target: "log", "{e}");40 }41}4243/// Ignores output44pub struct NoopHandler;45impl Handler for NoopHandler {46 fn handle_line(&mut self, _e: &str) {}47}4849/// Transform nix internal-json logs to tracing spans.50#[derive(Default)]51pub struct NixHandler {52 spans: HashMap<u64, Span>,53}54#[derive(Deserialize, Debug)]55#[serde(untagged)]56enum LogField {57 String(String),58 Num(u64),59}6061/// Nix internal-json log line type62#[derive(Deserialize, Debug)]63#[serde(rename_all = "camelCase", tag = "action")]64#[allow(dead_code)]65enum NixLog {66 Msg {67 level: u32,68 msg: String,69 raw_msg: Option<String>,70 },71 Start {72 id: u64,73 level: u32,74 #[serde(default)]75 fields: Vec<LogField>,76 text: String,77 #[serde(rename = "type")]78 typ: u32,79 },80 Stop {81 id: u64,82 },83 Result {84 id: u64,85 #[serde(rename = "type")]86 typ: u32,87 #[serde(default)]88 fields: Vec<LogField>,89 },90}91fn process_message(m: &str) -> String {92 // Supposed to remove formatting characters except colors, as some programs try to reset cursor position etc.93 static OSC_CLEANER: Lazy<Regex> =94 Lazy::new(|| Regex::new(r"\x1B\]([^\x07\x1C]*[\x07\x1C])?|\r").unwrap());95 static DETABBER: Lazy<Regex> = Lazy::new(|| Regex::new(r"\t").unwrap());96 let m = OSC_CLEANER.replace_all(m, "");97 // Indicatif can't format tabs. This is not the correct tab formatting, as correct one should be aligned,98 // and not just be replaced with the constant number of spaces, but it's ok for now, as statuses are single-line.99 DETABBER.replace_all(m.as_ref(), " ").to_string()100}101impl Handler for NixHandler {102 fn handle_line(&mut self, e: &str) {103 if let Some(e) = e.strip_prefix("@nix ") {104 let log: NixLog = match serde_json::from_str(e) {105 Ok(l) => l,106 Err(err) => {107 warn!("failed to parse nix log line {:?}: {}", e, err);108 return;109 }110 };111 match log {112 NixLog::Msg { msg, raw_msg, .. } => {113 #[allow(clippy::nonminimal_bool)]114 if !(msg.starts_with("\u{1b}[35;1mwarning:\u{1b}[0m Git tree '") && msg.ends_with("' is dirty"))115 && !msg.starts_with("\u{1b}[35;1mwarning:\u{1b}[0m not writing modified lock file of flake")116 && msg != "\u{1b}[35;1mwarning:\u{1b}[0m \u{1b}[31;1merror:\u{1b}[0m SQLite database '\u{1b}[35;1m/nix/var/nix/db/db.sqlite\u{1b}[0m' is busy" {117 if let Some(raw_msg) = raw_msg {118 if !msg.is_empty() {119 info!(target: "nix", "{}\n{}", raw_msg.trim_end(), msg.trim_end())120 } else {121 info!(target: "nix", "{}", raw_msg.trim_end())122 }123 } else {124 info!(target: "nix", "{}", msg.trim_end())125 }126 }127 }128 NixLog::Start {129 ref fields,130 typ,131 id,132 ..133 } if typ == 105 && !fields.is_empty() => {134 if let [LogField::String(drv), ..] = &fields[..] {135 let mut drv = drv.as_str();136 if let Some(pkg) = drv.strip_prefix("/nix/store/") {137 let mut it = pkg.splitn(2, '-');138 it.next();139 if let Some(pkg) = it.next() {140 drv = pkg;141 }142 }143 info!(target: "nix","building {}", drv);144 let span = info_span!("build", drv);145 #[cfg(feature = "indicatif")]146 span.pb_start();147 self.spans.insert(id, span);148 } else {149 warn!("bad build log: {:?}", log)150 }151 }152 NixLog::Start {153 ref fields,154 typ,155 id,156 ..157 } if typ == 100 && fields.len() >= 3 => {158 if let [LogField::String(drv), LogField::String(from), LogField::String(to), ..] =159 &fields[..]160 {161 let mut drv = drv.as_str();162163 if let Some(pkg) = drv.strip_prefix("/nix/store/") {164 let mut it = pkg.splitn(2, '-');165 it.next();166 if let Some(pkg) = it.next() {167 drv = pkg;168 }169 }170 info!(target: "nix","copying {} {} -> {}", drv, from, to);171 let span = info_span!("copy", from, to, drv);172 #[cfg(feature = "indicatif")]173 span.pb_start();174 self.spans.insert(id, span);175 } else {176 warn!("bad copy log: {:?}", log)177 }178 }179 NixLog::Start { text, typ, id, .. }180 if typ == 0 || typ == 102 || typ == 103 || typ == 104 =>181 {182 if !text.is_empty()183 && text != "querying info about missing paths"184 && text != "copying 0 paths"185 // Too much spam on lazy-trees branch186 && !(text.starts_with("copying '") && text.ends_with("' to the store"))187 {188 let span = info_span!("job");189 #[cfg(feature = "indicatif")]190 {191 span.pb_start();192 span.pb_set_message(&process_message(text.trim()));193 }194 self.spans.insert(id, span);195 info!(target: "nix", "{}", text);196 }197 }198 NixLog::Start {199 text,200 level: 0,201 typ: 108,202 ..203 } if text.is_empty() => {204 // Cache lookup? Coupled with copy log205 }206 NixLog::Start {207 text,208 level: 4,209 typ: 109,210 ..211 } if text.starts_with("querying info about ") => {212 // Cache lookup213 }214 NixLog::Start {215 text,216 level: 4,217 typ: 101,218 ..219 } if text.starts_with("downloading ") => {220 // NAR downloading, coupled with copy log221 }222 NixLog::Start {223 text,224 level: 1,225 typ: 111,226 ..227 } if text.starts_with("waiting for a machine to build ") => {228 // Useless repeating notification about build229 }230 NixLog::Start {231 text,232 level: 3,233 typ: 111,234 ..235 } if text.starts_with("resolved derivation: ") => {236 // CA resolved237 }238 NixLog::Start {239 text,240 level: 1,241 typ: 111,242 id,243 ..244 } if text.starts_with("waiting for lock on ") => {245 let mut drv = text.strip_prefix("waiting for lock on ").unwrap();246 if let Some(txt) = drv.strip_prefix("\u{1b}[35;1m'") {247 drv = txt;248 }249 if let Some(txt) = drv.strip_suffix("'\u{1b}[0m") {250 drv = txt;251 }252 if let Some(txt) = drv.split("', '").next() {253 drv = txt;254 }255 if let Some(pkg) = drv.strip_prefix("/nix/store/") {256 let mut it = pkg.splitn(2, '-');257 it.next();258 if let Some(pkg) = it.next() {259 drv = pkg;260 }261 }262 let span = info_span!("waiting on drv", drv);263 #[cfg(feature = "indicatif")]264 span.pb_start();265 self.spans.insert(id, span);266 // Concurrent build of the same message267 }268 NixLog::Stop { id, .. } => {269 self.spans.remove(&id);270 }271 NixLog::Result { fields, id, typ } if typ == 101 && !fields.is_empty() => {272 if let Some(span) = self.spans.get(&id) {273 if let LogField::String(s) = &fields[0] {274 #[cfg(feature = "indicatif")]275 span.pb_set_message(&process_message(s.trim()));276 #[cfg(not(feature = "indicatif"))]277 info!("{}", process_message(s));278 } else {279 warn!("bad fields: {fields:?}");280 }281 } else {282 warn!("unknown result id: {id} {typ} {fields:?}");283 }284 // dbg!(fields, id, typ);285 }286 NixLog::Result { fields, id, typ } if typ == 105 && fields.len() >= 4 => {287 if let Some(span) = self.spans.get(&id) {288 if let [LogField::Num(done), LogField::Num(expected), LogField::Num(_running), LogField::Num(_failed)] =289 &fields[..4]290 {291 #[cfg(feature = "indicatif")]292 {293 span.pb_set_length(*expected);294 span.pb_set_position(*done);295 }296 let _ = (span, done, expected);297 } else {298 warn!("bad fields: {fields:?}");299 }300 } else {301 // warn!("unknown result id: {id} {typ} {fields:?}");302 // Unaccounted progress.303 }304 // dbg!(fields, id, typ);305 }306 NixLog::Result { typ, .. } if typ == 104 || typ == 106 => {307 // Set phase, expected308 }309 _ => warn!("unknown log: {:?}", log),310 };311 } else {312 let e = e.trim();313 if e.starts_with("Failed tcsetattr(TCSADRAIN): ") {314 return;315 }316 info!("{e}")317 }318 }319}lib/fleetLib.nixdiffbeforeafterboth--- a/lib/fleetLib.nix
+++ b/lib/fleetLib.nix
@@ -34,6 +34,9 @@
then "${this}-${other}"
else "${other}-${this}";
- # For places, where fleet knows better than nixpkgs defaults
+ # mkDefault = mkOverride 1000
+ # For places, where fleet knows better than nixpkgs defaults.
mkFleetDefault = mkOverride 999;
+ # Some generators use mkDefault, but optionDefault is set by nixpkgs.
+ mkFleetGeneratorDefault = mkOverride 1001;
}
modules/fleet/meta.nixdiffbeforeafterboth--- a/modules/fleet/meta.nix
+++ b/modules/fleet/meta.nix
@@ -34,9 +34,14 @@
type = unspecified;
description = "Nixos configuration";
};
+ nixpkgs = mkOption {
+ type = unspecified;
+ description = "Nixpkgs override";
+ default = nixpkgs;
+ };
};
config = {
- nixosSystem = nixpkgs.lib.nixosSystem {
+ nixosSystem = hostConfig.config.nixpkgs.lib.nixosSystem {
inherit (hostConfig.config) system modules;
specialArgs = {
inherit fleetLib;
@@ -45,7 +50,7 @@
};
modules = [
({...}: {
- networking.hostName = mkFleetDefault hostName;
+ networking.hostName = mkFleetGeneratorDefault hostName;
})
];
};