Skip to content

Commit

Permalink
FIXME
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Nov 17, 2024
1 parent ed21160 commit 795dca7
Show file tree
Hide file tree
Showing 16 changed files with 507 additions and 680 deletions.
150 changes: 19 additions & 131 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[package]
name = "nh"
version = "3.6.0"
version = "4.0.0-alpha.1"
edition = "2021"
license = "EUPL-1.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ambassador = "0.4.0"
anstyle = "1.0.0"
clap = { version = "4.0", features = [
"cargo",
Expand All @@ -21,7 +20,6 @@ clean-path = "0.2"
color-eyre = { version = "0.6.2", default-features = false, features = [
"track-caller",
] }
derive_builder = "0.20.0"
dialoguer = { version = "0.11.0", default-features = false }
elasticsearch-dsl = "0.4.19"
hostname = "0.4"
Expand Down
13 changes: 0 additions & 13 deletions module.nix

This file was deleted.

6 changes: 3 additions & 3 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ in

preFixup = ''
mkdir completions
$out/bin/nh completions --shell bash > completions/nh.bash
$out/bin/nh completions --shell zsh > completions/nh.zsh
$out/bin/nh completions --shell fish > completions/nh.fish
$out/bin/nh completions bash > completions/nh.bash
$out/bin/nh completions zsh > completions/nh.zsh
$out/bin/nh completions fish > completions/nh.fish
installShellCompletion completions/*
'';
Expand Down
13 changes: 6 additions & 7 deletions src/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
time::SystemTime,
};

use crate::*;
use crate::{commands::Command, *};
use color_eyre::eyre::{bail, eyre, Context, ContextCompat};
use nix::errno::Errno;
use nix::{
Expand All @@ -31,8 +31,8 @@ type ToBeRemoved = bool;
type GenerationsTagged = BTreeMap<Generation, ToBeRemoved>;
type ProfilesTagged = HashMap<PathBuf, GenerationsTagged>;

impl NHRunnable for interface::CleanMode {
fn run(&self) -> Result<()> {
impl interface::CleanMode {
pub fn run(&self) -> Result<()> {
let mut profiles = Vec::new();
let mut gcroots_tagged: HashMap<PathBuf, ToBeRemoved> = HashMap::new();
let now = SystemTime::now();
Expand Down Expand Up @@ -221,12 +221,11 @@ impl NHRunnable for interface::CleanMode {
}
}

commands::CommandBuilder::default()
.args(["nix", "store", "gc"])
Command::new("nix")
.args(["store", "gc"])
.dry(args.dry)
.message("Performing garbage collection on the nix store")
.build()?
.exec()?;
.run()?;

Ok(())
}
Expand Down
Loading

0 comments on commit 795dca7

Please sign in to comment.