forked from lix-project/lix-installer
Move actions into OS-specific
This commit is contained in:
parent
d71827515a
commit
a61045f5a8
|
@ -1,26 +0,0 @@
|
|||
/*! Actions which do not only call other base plugins. */
|
||||
|
||||
mod configure_nix_daemon_service;
|
||||
mod create_directory;
|
||||
mod create_file;
|
||||
mod create_group;
|
||||
mod create_or_append_file;
|
||||
mod create_user;
|
||||
pub mod darwin;
|
||||
mod fetch_nix;
|
||||
mod move_unpacked_nix;
|
||||
mod setup_default_profile;
|
||||
mod start_systemd_unit;
|
||||
mod systemd_sysext_merge;
|
||||
|
||||
pub use configure_nix_daemon_service::{ConfigureNixDaemonService, ConfigureNixDaemonServiceError};
|
||||
pub use create_directory::{CreateDirectory, CreateDirectoryError};
|
||||
pub use create_file::{CreateFile, CreateFileError};
|
||||
pub use create_group::{CreateGroup, CreateGroupError};
|
||||
pub use create_or_append_file::{CreateOrAppendFile, CreateOrAppendFileError};
|
||||
pub use create_user::{CreateUser, CreateUserError};
|
||||
pub use fetch_nix::{FetchNix, FetchNixError};
|
||||
pub use move_unpacked_nix::{MoveUnpackedNix, MoveUnpackedNixError};
|
||||
pub use setup_default_profile::{SetupDefaultProfile, SetupDefaultProfileError};
|
||||
pub use start_systemd_unit::{StartSystemdUnit, StartSystemdUnitError};
|
||||
pub use systemd_sysext_merge::{SystemdSysextMerge, SystemdSysextMergeError};
|
|
@ -2,8 +2,11 @@ use reqwest::Url;
|
|||
|
||||
use crate::{
|
||||
action::{
|
||||
base::{ConfigureNixDaemonService, SetupDefaultProfile},
|
||||
meta::{ConfigureShellProfile, PlaceChannelConfiguration, PlaceNixConfiguration},
|
||||
common::{
|
||||
ConfigureShellProfile, PlaceChannelConfiguration, PlaceNixConfiguration,
|
||||
SetupDefaultProfile,
|
||||
},
|
||||
linux::ConfigureNixDaemonService,
|
||||
Action, ActionDescription, ActionState,
|
||||
},
|
||||
cli::arg::ChannelValue,
|
|
@ -2,7 +2,7 @@ use std::path::Path;
|
|||
|
||||
use tokio::task::{JoinError, JoinSet};
|
||||
|
||||
use crate::action::base::{CreateOrAppendFile, CreateOrAppendFileError};
|
||||
use crate::action::common::{CreateOrAppendFile, CreateOrAppendFileError};
|
||||
use crate::{
|
||||
action::{Action, ActionDescription, ActionState},
|
||||
BoxableError,
|
|
@ -1,4 +1,4 @@
|
|||
use crate::action::base::{CreateDirectory, CreateDirectoryError};
|
||||
use crate::action::common::{CreateDirectory, CreateDirectoryError};
|
||||
use crate::action::{Action, ActionDescription, ActionState};
|
||||
|
||||
const PATHS: &[&str] = &[
|
|
@ -4,7 +4,7 @@ use crate::CommonSettings;
|
|||
|
||||
use crate::{
|
||||
action::{
|
||||
base::{CreateGroup, CreateGroupError, CreateUser, CreateUserError},
|
||||
common::{CreateGroup, CreateGroupError, CreateUser, CreateUserError},
|
||||
Action, ActionDescription, ActionState,
|
||||
},
|
||||
BoxableError,
|
|
@ -2,19 +2,32 @@
|
|||
|
||||
mod configure_nix;
|
||||
mod configure_shell_profile;
|
||||
mod create_directory;
|
||||
mod create_file;
|
||||
mod create_group;
|
||||
mod create_nix_tree;
|
||||
mod create_systemd_sysext;
|
||||
mod create_or_append_file;
|
||||
mod create_user;
|
||||
mod create_users_and_group;
|
||||
pub mod darwin;
|
||||
mod fetch_nix;
|
||||
mod move_unpacked_nix;
|
||||
mod place_channel_configuration;
|
||||
mod place_nix_configuration;
|
||||
mod provision_nix;
|
||||
mod setup_default_profile;
|
||||
|
||||
pub use configure_nix::ConfigureNix;
|
||||
pub use configure_shell_profile::ConfigureShellProfile;
|
||||
pub use create_directory::{CreateDirectory, CreateDirectoryError};
|
||||
pub use create_file::{CreateFile, CreateFileError};
|
||||
pub use create_group::{CreateGroup, CreateGroupError};
|
||||
pub use create_nix_tree::{CreateNixTree, CreateNixTreeError};
|
||||
pub use create_systemd_sysext::{CreateSystemdSysext, CreateSystemdSysextError};
|
||||
pub use create_or_append_file::{CreateOrAppendFile, CreateOrAppendFileError};
|
||||
pub use create_user::{CreateUser, CreateUserError};
|
||||
pub use create_users_and_group::{CreateUsersAndGroup, CreateUsersAndGroupError};
|
||||
pub use fetch_nix::{FetchNix, FetchNixError};
|
||||
pub use move_unpacked_nix::{MoveUnpackedNix, MoveUnpackedNixError};
|
||||
pub use place_channel_configuration::{PlaceChannelConfiguration, PlaceChannelConfigurationError};
|
||||
pub use place_nix_configuration::{PlaceNixConfiguration, PlaceNixConfigurationError};
|
||||
pub use provision_nix::{ProvisionNix, ProvisionNixError};
|
||||
pub use setup_default_profile::{SetupDefaultProfile, SetupDefaultProfileError};
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
BoxableError,
|
||||
};
|
||||
|
||||
use crate::action::base::{CreateFile, CreateFileError};
|
||||
use crate::action::common::{CreateFile, CreateFileError};
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
|
||||
pub struct PlaceChannelConfiguration {
|
|
@ -1,6 +1,6 @@
|
|||
use crate::action::{Action, ActionDescription, ActionState};
|
||||
|
||||
use crate::action::base::{CreateDirectory, CreateDirectoryError, CreateFile, CreateFileError};
|
||||
use crate::action::common::{CreateDirectory, CreateDirectoryError, CreateFile, CreateFileError};
|
||||
|
||||
const NIX_CONF_FOLDER: &str = "/etc/nix";
|
||||
const NIX_CONF: &str = "/etc/nix/nix.conf";
|
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
|||
|
||||
use tokio::task::JoinError;
|
||||
|
||||
use crate::action::base::{
|
||||
use crate::action::common::{
|
||||
CreateDirectoryError, FetchNix, FetchNixError, MoveUnpackedNix, MoveUnpackedNixError,
|
||||
};
|
||||
use crate::CommonSettings;
|
|
@ -6,15 +6,13 @@ use tokio::process::Command;
|
|||
|
||||
use crate::{
|
||||
action::{
|
||||
base::{
|
||||
common::{CreateFile, CreateFileError, CreateOrAppendFile, CreateOrAppendFileError},
|
||||
darwin::{
|
||||
BootstrapVolume, BootstrapVolumeError, CreateSyntheticObjects,
|
||||
CreateSyntheticObjectsError, CreateVolume, CreateVolumeError, EnableOwnership,
|
||||
EnableOwnershipError, EncryptVolume, EncryptVolumeError, UnmountVolume,
|
||||
UnmountVolumeError,
|
||||
},
|
||||
CreateFile, CreateFileError, CreateOrAppendFile, CreateOrAppendFileError,
|
||||
},
|
||||
Action, ActionDescription, ActionState,
|
||||
},
|
||||
BoxableError,
|
|
@ -1,4 +1,5 @@
|
|||
mod bootstrap_volume;
|
||||
mod create_apfs_volume;
|
||||
mod create_synthetic_objects;
|
||||
mod create_volume;
|
||||
mod enable_ownership;
|
||||
|
@ -7,6 +8,7 @@ mod kickstart_launchctl_service;
|
|||
mod unmount_volume;
|
||||
|
||||
pub use bootstrap_volume::{BootstrapVolume, BootstrapVolumeError};
|
||||
pub use create_apfs_volume::{CreateApfsVolume, CreateApfsVolumeError};
|
||||
pub use create_synthetic_objects::{CreateSyntheticObjects, CreateSyntheticObjectsError};
|
||||
pub use create_volume::{CreateVolume, CreateVolumeError};
|
||||
pub use enable_ownership::{EnableOwnership, EnableOwnershipError};
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::action::base::{CreateDirectory, CreateDirectoryError, CreateFile, CreateFileError};
|
||||
use crate::action::common::{CreateDirectory, CreateDirectoryError, CreateFile, CreateFileError};
|
||||
use crate::{
|
||||
action::{Action, ActionDescription, ActionState},
|
||||
BoxableError,
|
9
src/action/linux/mod.rs
Normal file
9
src/action/linux/mod.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
mod configure_nix_daemon_service;
|
||||
mod create_systemd_sysext;
|
||||
mod start_systemd_unit;
|
||||
mod systemd_sysext_merge;
|
||||
|
||||
pub use configure_nix_daemon_service::{ConfigureNixDaemonService, ConfigureNixDaemonServiceError};
|
||||
pub use create_systemd_sysext::{CreateSystemdSysext, CreateSystemdSysextError};
|
||||
pub use start_systemd_unit::{StartSystemdUnit, StartSystemdUnitError};
|
||||
pub use systemd_sysext_merge::{SystemdSysextMerge, SystemdSysextMergeError};
|
|
@ -1,2 +0,0 @@
|
|||
mod create_apfs_volume;
|
||||
pub use create_apfs_volume::{CreateApfsVolume, CreateApfsVolumeError};
|
|
@ -1,5 +1,6 @@
|
|||
pub mod base;
|
||||
pub mod meta;
|
||||
pub mod common;
|
||||
pub mod darwin;
|
||||
pub mod linux;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::path::PathBuf;
|
|||
use crate::{
|
||||
action::{Action, ActionDescription},
|
||||
planner::Planner,
|
||||
BuiltinPlanner, HarmonicError,
|
||||
HarmonicError,
|
||||
};
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
|
||||
|
|
|
@ -5,8 +5,8 @@ use tokio::process::Command;
|
|||
|
||||
use crate::{
|
||||
action::{
|
||||
base::darwin::KickstartLaunchctlService,
|
||||
meta::{darwin::CreateApfsVolume, ConfigureNix, ProvisionNix},
|
||||
common::{ConfigureNix, ProvisionNix},
|
||||
darwin::{CreateApfsVolume, KickstartLaunchctlService},
|
||||
},
|
||||
execute_command,
|
||||
os::darwin::DiskUtilOutput,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use crate::{
|
||||
action::{
|
||||
base::{CreateDirectory, StartSystemdUnit},
|
||||
meta::{ConfigureNix, ProvisionNix},
|
||||
common::{ConfigureNix, CreateDirectory, ProvisionNix},
|
||||
linux::StartSystemdUnit,
|
||||
},
|
||||
planner::{BuiltinPlannerError, Planner},
|
||||
planner::Planner,
|
||||
BuiltinPlanner, CommonSettings, InstallPlan,
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{
|
||||
action::{
|
||||
base::{CreateDirectory, StartSystemdUnit},
|
||||
meta::{CreateSystemdSysext, ProvisionNix},
|
||||
common::{CreateDirectory, ProvisionNix},
|
||||
linux::{CreateSystemdSysext, StartSystemdUnit},
|
||||
},
|
||||
planner::Planner,
|
||||
BuiltinPlanner, CommonSettings, InstallPlan,
|
||||
|
|
Loading…
Reference in a new issue