Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
1c61d1a0
Unverified
Commit
1c61d1a0
authored
Nov 12, 2022
by
Chuck Lantz
Committed by
GitHub
Nov 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test, bump version for extraNixConfig (#280)
parent
a2b1c19a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
devcontainer-feature.json
src/nix/devcontainer-feature.json
+1
-1
extra-config.sh
test/nix/extra-config.sh
+35
-0
scenarios.json
test/nix/scenarios.json
+9
-0
No files found.
src/nix/devcontainer-feature.json
View file @
1c61d1a0
{
{
"id"
:
"nix"
,
"id"
:
"nix"
,
"version"
:
"1.
0
.0"
,
"version"
:
"1.
1
.0"
,
"name"
:
"Nix Package Manager"
,
"name"
:
"Nix Package Manager"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/nix"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/nix"
,
"description"
:
"Installs the Nix package manager and optionally a set of packages."
,
"description"
:
"Installs the Nix package manager and optionally a set of packages."
,
...
...
test/nix/extra-config.sh
0 → 100644
View file @
1c61d1a0
#!/bin/bash
set
-e
# Optional: Import test library bundled with the devcontainer CLI
source
dev-container-features-test-lib
uid
=
"
$(
id
-u
)
"
echo
"Current user UID is
${
uid
}
."
if
[
"
${
uid
}
"
!=
"1000"
]
;
then
echo
"Current user UID was adjusted."
fi
set
+e
vscode_uid
=
"
$(
id
-u
vscode
)
"
set
-e
if
[
"
${
vscode_uid
}
"
!=
""
]
;
then
echo
"User vscode UID is
${
vscode_uid
}
."
if
[
"
${
vscode_uid
}
"
!=
"1000"
]
;
then
echo
"User vscode UID was adjusted."
fi
fi
nix_uid
=
"
$(
stat
/nix
-c
"%u"
)
"
echo
"/nix UID is
${
nix_uid
}
."
cat
/etc/os-release
cat
/etc/nix/nix.conf
# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib.
check
"nix-env"
type
nix-env
check
"First added line"
grep
-E
'^extra-substituters = https://foo\.cachix\.org$'
/etc/nix/nix.conf
check
"Second added line"
grep
-E
'^extra-trusted-public-keys = foo\.cachix\.org-1:bar=$'
/etc/nix/nix.conf
# Report result
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults &2>1
\ No newline at end of file
test/nix/scenarios.json
View file @
1c61d1a0
...
@@ -89,5 +89,14 @@
...
@@ -89,5 +89,14 @@
"flakeUri"
:
"github:nixos/nixpkgs/nixpkgs-unstable#hello"
"flakeUri"
:
"github:nixos/nixpkgs/nixpkgs-unstable#hello"
}
}
}
}
},
"extra-config"
:
{
"image"
:
"mcr.microsoft.com/devcontainers/base:ubuntu"
,
"remoteUser"
:
"vscode"
,
"features"
:
{
"nix"
:
{
"extraNixConfig"
:
"extra-substituters = https://foo.cachix.org,extra-trusted-public-keys = foo.cachix.org-1:bar="
}
}
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment