-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permit installation of dev/test dependencies via Nix
Signed-off-by: Charles Duffy <[email protected]>
- Loading branch information
1 parent
a46d096
commit 8d16ad8
Showing
5 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# If using a flake-enabled version of Nix (minimum 2.4, with experimental | ||
# features enabled), ''nix develop'' will spawn an environment in which | ||
# ''./scripts/test'' will work as intended. | ||
|
||
# For older versions of Nix, ''nix-shell'' will invoke this same code via the | ||
# shell.nix compatibility layer. | ||
|
||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/release-21.11"; | ||
flake-compat.url = "github:edolstra/flake-compat"; | ||
flake-compat.flake = false; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
outputs = { self, nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let pkgs = import nixpkgs { inherit system; }; | ||
in rec { | ||
devShell = pkgs.mkShell { | ||
buildInputs = with pkgs; [ | ||
buildkit | ||
go | ||
rootlesskit | ||
runc | ||
]; | ||
shellHook = '' | ||
if ! type newuidmap >/dev/null 2>&1; then { | ||
echo "WARNING: newuidmap and newgid map are required but not found" | ||
echo " Because these tools require a setuid bit to operate," | ||
echo " they cannot be installed in a local Nix shell." | ||
echo | ||
} >&2; fi | ||
PS1='[oci-build-task devshell] '"$PS1" | ||
''; | ||
}; | ||
}); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -e -u | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(import | ||
( | ||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) | ||
{ src = ./.; } | ||
).shellNix |