Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/command/apply_local.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::env;
use regex::Regex;
use std::collections::HashMap;

use clap::{Arg, App, ArgMatches};
Expand Down Expand Up @@ -61,7 +62,8 @@ By default, Colmena will deploy keys set in `deployment.keys` before activating
pub async fn run(_global_args: &ArgMatches, local_args: &ArgMatches) -> Result<(), ColmenaError> {
// Sanity check: Are we running NixOS?
if let Ok(os_release) = fs::read_to_string("/etc/os-release").await {
if !os_release.contains("ID=nixos\n") {
let re = Regex::new(r#"ID="?nixos"?"#).unwrap();
if !re.is_match(&os_release) {
log::error!("\"apply-local\" only works on NixOS machines.");
quit::with_code(5);
}
Expand Down