Skip to content

Commit

Permalink
default package name adjusted for 'NixOS/nix#5532
Browse files Browse the repository at this point in the history
  • Loading branch information
TyberiusPrime committed Nov 18, 2024
1 parent e99feb9 commit e059473
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
46 changes: 30 additions & 16 deletions examples/flake_auto_rev/anysnake2.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
[anysnake2]
url2 = "dev"
rev = "dev" # pre 2.0 - 2.0+ uses url2
url = "github:TyberiusPrime/anysnake2_release_flakes" # pre 2.0 - 2.0+ uses url2
url2 = "dev"

[nixpkgs]
url = "github:NixOS/nixpkgs/master/24.05"

[outside_nixpkgs]
url = "github:NixOS/nixpkgs/master/24.05"

[ancient_poetry]
url = "git+https://codeberg.org/TyberiusPrime/ancient-poetry.git?ref=main&rev=68f1e759c557757e55d05027319d5c9751626fba"

[poetry2nix]
url = "github:nix-community/poetry2nix/master/48e7ed4ef7832efa5a5558e573986c4128fc478f"
[nixpkgs]
url = "github:NixOS/nixpkgs/master/24.05"


[flakes.hello]
# # rev get's auto detected
url = "github:TyberiusPrime/hello_flake/main"
url = "github:TyberiusPrime/hello_flake/main/f32e7e451e9463667f6a1ddb7a662ec70d35144b"


[flakes.hello2]
url = "git+https://github.com/TyberiusPrime/hello_flake?ref=main"
follows = ["nixpkgs"] # so we overwrite the flakes dependencies
follows = ["nixpkgs"] # so we overwrite the flakes dependencies
url = "git+https://github.com/TyberiusPrime/hello_flake?ref=main&rev=f32e7e451e9463667f6a1ddb7a662ec70d35144b"


[flakes.hello_merucrial]
url = "hg+https://hg.sr.ht/~tyberius_prime/hello_flake"
url = "hg+https://hg.sr.ht/~tyberius_prime/hello_flake?rev=ed4abef5589800a2f1cf43282b46f180bc46fa0d"


[dev_shell]
inputs = []
shell = "bash"


[outside_nixpkgs]
url = "github:NixOS/nixpkgs/master/24.05"


[ancient_poetry]
url = "git+https://codeberg.org/TyberiusPrime/ancient-poetry.git?ref=main&rev=68f1e759c557757e55d05027319d5c9751626fba"


[poetry2nix]
url = "github:nix-community/poetry2nix/master/48e7ed4ef7832efa5a5558e573986c4128fc478f"


[flake-util]
url = "github:numtide/flake-utils/main/b1d9ab70662946ef0850d488da1c9019f3a9752a"
url = "github:numtide/flake-utils/main/b1d9ab70662946ef0850d488da1c9019f3a9752a"
# follows = ["nixpkgs"] # so we overwrite the flakes dependencies


Expand Down
5 changes: 4 additions & 1 deletion src/flake_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,10 @@ fn add_flakes(
&rev_follows[..],
));
if flake.packages.is_empty() {
nixpkgs_pkgs.insert(format!("{}.{}", name, "defaultPackage.x86_64-linux"));
nixpkgs_pkgs.insert(format!(
"({}.defaultPackage.x86_64-linux or {}.packages.x86_64-linux.defaults)",
name, name
));
} else {
for pkg in &flake.packages {
nixpkgs_pkgs.insert(format!("{name}.{pkg}"));
Expand Down

0 comments on commit e059473

Please sign in to comment.