diff --git a/SPEC.md b/SPEC.md index 3c6fd23..fb49dc4 100644 --- a/SPEC.md +++ b/SPEC.md @@ -343,8 +343,6 @@ tool. └── <...>.provisioned # hot-cell marker ``` -`~/.config/ecrou.yaml` carries over (DNS overrides today). - ## Snap packaging Confinement: strict. Plugs: `network`, `home`, `kvm`. Manual diff --git a/crates/ecrou/src/config.rs b/crates/ecrou/src/config.rs deleted file mode 100644 index 5ec6eb7..0000000 --- a/crates/ecrou/src/config.rs +++ /dev/null @@ -1,43 +0,0 @@ -use anyhow::Context; - -use crate::Result; -use serde::Deserialize; - -#[derive(Debug, Deserialize, Default)] -pub struct Config { - #[serde(default)] - pub dns: Vec, -} - -impl Config { - pub fn load() -> Result { - let config_path = dirs::config_dir().map(|p| p.join("ecrou.yaml")); - - match config_path { - Some(path) if path.exists() => { - let content = - std::fs::read_to_string(&path).context("Failed to read config file")?; - - let config: Config = - serde_yaml::from_str(&content).context("Failed to parse config file")?; - - // Set defaults - let config = Config { - dns: if config.dns.is_empty() { - vec!["1.1.1.1".to_string()] - } else { - config.dns - }, - }; - - Ok(config) - } - _ => { - // No config file, use defaults - Ok(Config { - dns: vec!["1.1.1.1".to_string()], - }) - } - } - } -} diff --git a/crates/ecrou/src/lib.rs b/crates/ecrou/src/lib.rs index 756c2a2..52c71ee 100644 --- a/crates/ecrou/src/lib.rs +++ b/crates/ecrou/src/lib.rs @@ -31,7 +31,6 @@ //! embeds the library exactly the way the CLI does - a [`RootfsCache`] //! to prepare a rootfs, then [`run`] to boot it. -pub mod config; pub mod distro; pub mod download; pub mod error; diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index fa906ce..81839a3 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -27,7 +27,6 @@ description: | ## Configuration and cache - image cache: `~/snap/ecrou/common/cache/ecrou` - - config: `~/snap/ecrou/common/config/ecrou.yaml` The home interface does not cover dotfiles, so the XDG directories are redirected into the snap's common data area. @@ -58,17 +57,16 @@ parts: build-packages: [cmake, perl] override-build: | craftctl default - # The home interface stops at dotfiles, so ~/.cache and - # ~/.config are unreachable under strict confinement. Point the - # XDG lookups (the dirs crate honors these variables) into the - # snap's durable area, shared across refreshes. + # The home interface stops at dotfiles, so ~/.cache is + # unreachable under strict confinement. Point the XDG cache + # lookup (the dirs crate honors the variable) into the snap's + # durable area, shared across refreshes. mkdir -p "$CRAFT_PART_INSTALL/command-chain" cat > "$CRAFT_PART_INSTALL/command-chain/ecrou-env" <<'EOF' #!/bin/sh XDG_CACHE_HOME="$SNAP_USER_COMMON/cache" - XDG_CONFIG_HOME="$SNAP_USER_COMMON/config" - export XDG_CACHE_HOME XDG_CONFIG_HOME - mkdir -p "$XDG_CACHE_HOME" "$XDG_CONFIG_HOME" + export XDG_CACHE_HOME + mkdir -p "$XDG_CACHE_HOME" exec "$@" EOF chmod 755 "$CRAFT_PART_INSTALL/command-chain/ecrou-env"