Skip to content

Commit

Permalink
Merge pull request #1433 from cachix/nix-2.24
Browse files Browse the repository at this point in the history
Nix 2.24
  • Loading branch information
domenkozar authored Sep 10, 2024
2 parents 98c7c13 + 1a93f87 commit 93e0871
Show file tree
Hide file tree
Showing 23 changed files with 6,899 additions and 2,645 deletions.
163 changes: 109 additions & 54 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
"type": "github"
},
"original": {
Expand All @@ -36,7 +35,6 @@
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
"type": "github"
},
"original": {
Expand All @@ -45,21 +43,23 @@
"type": "github"
}
},
"flake-utils": {
"flake-parts": {
"inputs": {
"systems": "systems"
"nixpkgs-lib": [
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1710146030,
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"treeHash": "bd263f021e345cb4a39d80c126ab650bebc3c10c",
"lastModified": 1725234343,
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
Expand All @@ -75,7 +75,6 @@
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
"type": "github"
},
"original": {
Expand All @@ -84,42 +83,72 @@
"type": "github"
}
},
"libgit2": {
"flake": false,
"locked": {
"lastModified": 1725398119,
"owner": "libgit2",
"repo": "libgit2",
"rev": "403a03b3beaea7d26b9515e27dd36553239647ca",
"type": "github"
},
"original": {
"owner": "libgit2",
"repo": "libgit2",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression"
"flake-parts": "flake-parts",
"libgit2": "libgit2",
"nixpkgs": "nixpkgs",
"nixpkgs-23-11": "nixpkgs-23-11",
"nixpkgs-regression": "nixpkgs-regression",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1712911606,
"lastModified": 1725980365,
"owner": "domenkozar",
"repo": "nix",
"rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12",
"treeHash": "2d981a54945f813d5523e8edb198cc740a2671bd",
"rev": "1e61e9f40673f84c3b02573145492d8af581bec5",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "devenv-2.21",
"ref": "devenv-2.24",
"repo": "nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1713361204,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "285676e87ad9f0ca23d8714a6ab61e7e027020c6",
"treeHash": "50354b35a3e0277d4a83a0a88fa0b0866b5f392f",
"lastModified": 1725976237,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f5aee17516d197620d69e20644785f0d3bf03f6f",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-23-11": {
"locked": {
"lastModified": 1717159533,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
}
},
Expand All @@ -129,7 +158,6 @@
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"treeHash": "749c7b11668286627143f45b3f9078561a91980a",
"type": "github"
},
"original": {
Expand All @@ -141,36 +169,78 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1713725259,
"lastModified": 1725826545,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a5e4bbcb4780c63c79c87d29ea409abf097de3f7",
"treeHash": "d71e381aa8a18139cbba1b0bae4338a2b78108df",
"rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1716977621,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": [
"nix"
],
"gitignore": [
"nix"
],
"nixpkgs": [
"nix",
"nixpkgs"
],
"nixpkgs-stable": [
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1725513492,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "7570de7b9b504cfe92025dd1be797bf546f66528",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"pre-commit-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1713775815,
"lastModified": 1725513492,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4",
"treeHash": "419ef022a9c8ad014d76c605ef29c0e2d7fc07a0",
"rev": "7570de7b9b504cfe92025dd1be797bf546f66528",
"type": "github"
},
"original": {
Expand All @@ -183,23 +253,8 @@
"inputs": {
"devenv": "devenv",
"nix": "nix",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"treeHash": "cce81f2a0f0743b2eb61bc2eb6c7adbe2f2c6beb",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
"nixpkgs": "nixpkgs_2",
"pre-commit-hooks": "pre-commit-hooks_2"
}
}
},
Expand Down
9 changes: 4 additions & 5 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ inputs, pkgs, lib, config, ... }: {
env.DEVENV_NIX = inputs.nix.packages.${pkgs.stdenv.system}.nix;
# ignore annoying browserlists warning that breaks pre-commit hooks
env.BROWSERSLIST_IGNORE_OLD_DATA = "1";

packages = [
pkgs.cairo
Expand Down Expand Up @@ -96,9 +98,7 @@
};
scripts."devenv-generate-doc-css" = {
description = "Generate CSS for the docs.";
exec = ''
${lib.getExe pkgs.tailwindcss} build -i docs/assets/extra.css -o docs/assets/output.css
'';
exec = "${lib.getExe pkgs.tailwindcss} build -i docs/assets/extra.css -o docs/assets/output.css";
};
scripts."devenv-generate-doc-options" = {
description = "Generate option docs.";
Expand Down Expand Up @@ -224,11 +224,10 @@ EOF
generate-doc-css = {
enable = true;
name = "generate-doc-css";
# Copied from devenv-generate-doc-css
# In CI, the auto-commit action doesn't run in the shell, so it can't reuse our scripts.
# And the following command is curently too slow to be a pre-commit command.
# entry = "devenv shell devenv-generate-doc-css";
entry = "${lib.getExe pkgs.tailwindcss} build -i docs/assets/extra.css -o docs/assets/output.css";
entry = config.scripts."devenv-generate-doc-css".exec;
};
};
}
5 changes: 1 addition & 4 deletions devenv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ inputs:
devenv:
url: path:.?dir=src/modules
nix:
url: github:domenkozar/nix/devenv-2.21
inputs:
nixpkgs:
follows: nixpkgs
url: github:domenkozar/nix/devenv-2.24
22 changes: 12 additions & 10 deletions devenv/src/devenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,19 +460,21 @@ impl Devenv {
));

{
let _logprogress = self.log_progress.without_newline(
"Running garbage collection (this process may take some time) ...",
);
let paths: Vec<&str> = to_gc
let _logprogress = self
.log_progress
.with_newline("Running garbage collection (this process will take some time) ...");
self.logger.warn("If you'd like this to run faster, leave a thumbs up at https://github.com/NixOS/nix/issues/7239");
let paths: std::collections::HashSet<&str> = to_gc
.iter()
.filter_map(|path_buf| path_buf.to_str())
.collect();
let args: Vec<&str> = ["store", "gc"]
.iter()
.chain(paths.iter())
.copied()
.collect();
self.run_nix("nix", &args, &command::Options::default())?;
for path in paths {
self.logger.info(&format!("Deleting {}...", path));
let args: Vec<&str> = ["store", "delete", path].iter().copied().collect();
let cmd = self.prepare_command("nix", &args);
// we ignore if this command fails, because root might be in use
let _ = cmd?.output();
}
}

let (after_gc, _) = cleanup_symlinks(&self.devenv_home_gc);
Expand Down
Loading

0 comments on commit 93e0871

Please sign in to comment.