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
a2b1c19a
Unverified
Commit
a2b1c19a
authored
Nov 12, 2022
by
Nick Hu
Committed by
GitHub
Nov 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nix feature: allow extra configuration of /etc/nix/nix.conf (#277)
parent
f7f05f76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
devcontainer-feature.json
src/nix/devcontainer-feature.json
+5
-0
install.sh
src/nix/install.sh
+11
-0
No files found.
src/nix/devcontainer-feature.json
View file @
a2b1c19a
...
@@ -25,6 +25,11 @@
...
@@ -25,6 +25,11 @@
"type"
:
"string"
,
"type"
:
"string"
,
"default"
:
""
,
"default"
:
""
,
"description"
:
"Optional URI to a Nix Flake to install in profile."
"description"
:
"Optional URI to a Nix Flake to install in profile."
},
"extraNixConfig"
:
{
"type"
:
"string"
,
"default"
:
""
,
"description"
:
"Optional comma separated list of extra lines to add to /etc/nix/nix.conf."
}
}
},
},
"installsAfter"
:
[
"installsAfter"
:
[
...
...
src/nix/install.sh
View file @
a2b1c19a
...
@@ -9,6 +9,7 @@ VERSION="${VERSION:-"latest"}"
...
@@ -9,6 +9,7 @@ VERSION="${VERSION:-"latest"}"
MULTIUSER
=
"
${
MULTIUSER
:-
"true"
}
"
MULTIUSER
=
"
${
MULTIUSER
:-
"true"
}
"
PACKAGES
=
"
${
PACKAGES
//,/
}
"
PACKAGES
=
"
${
PACKAGES
//,/
}
"
FLAKEURI
=
"
${
FLAKEURI
:-
""
}
"
FLAKEURI
=
"
${
FLAKEURI
:-
""
}
"
EXTRANIXCONFIG
=
"
${
EXTRANIXCONFIG
:-
""
}
"
USERNAME
=
"
${
USERNAME
:-
"
${
_REMOTE_USER
:-
"automatic"
}
"
}
"
USERNAME
=
"
${
USERNAME
:-
"
${
_REMOTE_USER
:-
"automatic"
}
"
}
"
# Nix keys for securly verifying installer download signature per https://nixos.org/download.html#nix-verify-installation
# Nix keys for securly verifying installer download signature per https://nixos.org/download.html#nix-verify-installation
...
@@ -99,6 +100,16 @@ create_or_update_file /etc/nix/nix.conf 'sandbox = false'
...
@@ -99,6 +100,16 @@ create_or_update_file /etc/nix/nix.conf 'sandbox = false'
if
[
!
-z
"
${
FLAKEURI
}
"
]
&&
[
"
${
FLAKEURI
}
"
!=
"none"
]
;
then
if
[
!
-z
"
${
FLAKEURI
}
"
]
&&
[
"
${
FLAKEURI
}
"
!=
"none"
]
;
then
create_or_update_file /etc/nix/nix.conf
'experimental-features = nix-command flakes'
create_or_update_file /etc/nix/nix.conf
'experimental-features = nix-command flakes'
fi
fi
# Extra nix config
if
[
!
-z
"
${
EXTRANIXCONFIG
}
"
]
;
then
OLDIFS
=
$IFS
IFS
=
","
read
-a
extra_nix_config
<<<
"
$EXTRANIXCONFIG
"
for
line
in
"
${
extra_nix_config
[@]
}
"
;
do
create_or_update_file /etc/nix/nix.conf
"
$line
"
done
IFS
=
$OLDIFS
fi
# Create entrypoint if needed
# Create entrypoint if needed
if
[
!
-e
"/usr/local/share/nix-entrypoint.sh"
]
;
then
if
[
!
-e
"/usr/local/share/nix-entrypoint.sh"
]
;
then
...
...
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