mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
nix profile: Add a test for non-flake packages
This commit is contained in:
parent
161f798aa1
commit
f9375778ae
1 changed files with 8 additions and 1 deletions
|
@ -13,7 +13,7 @@ cat > $flake1Dir/flake.nix <<EOF
|
||||||
|
|
||||||
outputs = { self }: with import ./config.nix; rec {
|
outputs = { self }: with import ./config.nix; rec {
|
||||||
packages.$system.default = mkDerivation {
|
packages.$system.default = mkDerivation {
|
||||||
name = "simple-\${builtins.readFile ./version}";
|
name = "profile-test-\${builtins.readFile ./version}";
|
||||||
builder = builtins.toFile "builder.sh"
|
builder = builtins.toFile "builder.sh"
|
||||||
''
|
''
|
||||||
mkdir -p \$out/bin
|
mkdir -p \$out/bin
|
||||||
|
@ -68,6 +68,13 @@ nix profile remove 0
|
||||||
nix profile history | grep 'foo: 1.0 -> ∅'
|
nix profile history | grep 'foo: 1.0 -> ∅'
|
||||||
nix profile diff-closures | grep 'Version 3 -> 4'
|
nix profile diff-closures | grep 'Version 3 -> 4'
|
||||||
|
|
||||||
|
# Test installing a non-flake package.
|
||||||
|
nix profile install --file ./simple.nix ''
|
||||||
|
[[ $(cat $TEST_HOME/.nix-profile/hello) = "Hello World!" ]]
|
||||||
|
nix profile remove 1
|
||||||
|
nix profile install $(nix-build --no-out-link ./simple.nix)
|
||||||
|
[[ $(cat $TEST_HOME/.nix-profile/hello) = "Hello World!" ]]
|
||||||
|
|
||||||
# Test wipe-history.
|
# Test wipe-history.
|
||||||
nix profile wipe-history
|
nix profile wipe-history
|
||||||
[[ $(nix profile history | grep Version | wc -l) -eq 1 ]]
|
[[ $(nix profile history | grep Version | wc -l) -eq 1 ]]
|
||||||
|
|
Loading…
Reference in a new issue