This commit is contained in:
parent
da290991d3
commit
d21c8fac35
82
nix/oracle-gitea-runner/coder.nix
Normal file
82
nix/oracle-gitea-runner/coder.nix
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
{ lib
|
||||||
|
, fetchurl
|
||||||
|
, installShellFiles
|
||||||
|
, makeWrapper
|
||||||
|
, terraform
|
||||||
|
, stdenvNoCC
|
||||||
|
, unzip
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (stdenvNoCC.hostPlatform) system;
|
||||||
|
in
|
||||||
|
|
||||||
|
stdenvNoCC.mkDerivation rec {
|
||||||
|
pname = "coder";
|
||||||
|
version = "2.3.3";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
sha256 = {
|
||||||
|
x86_64-linux = "sha256-3gO71Eii3KBjn/oQ1Q3OCJ7S6H12iDYjOfqf43ph1nQ=";
|
||||||
|
x86_64-darwin = lib.fakeHash;
|
||||||
|
aarch64-linux = "sha256-v7S22I62EKPcHO9yZGciKKftRlzIowfAeVgnccOdlSs=";
|
||||||
|
aarch64-darwin = "";
|
||||||
|
}.${system};
|
||||||
|
|
||||||
|
url =
|
||||||
|
let
|
||||||
|
systemName = {
|
||||||
|
x86_64-linux = "linux_amd64";
|
||||||
|
aarch64-linux = "linux_arm64";
|
||||||
|
x86_64-darwin = "darwin_amd64";
|
||||||
|
aarch64-darwin = "darwin_arm64";
|
||||||
|
}.${system};
|
||||||
|
|
||||||
|
ext = {
|
||||||
|
x86_64-linux = "tar.gz";
|
||||||
|
aarch64-linux = "tar.gz";
|
||||||
|
x86_64-darwin = "zip";
|
||||||
|
aarch64-darwin = "zip";
|
||||||
|
}.${system};
|
||||||
|
in
|
||||||
|
"https://github.com/coder/coder/releases/download/v${version}/coder_${version}_${systemName}.${ext}";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
installShellFiles
|
||||||
|
makeWrapper
|
||||||
|
unzip
|
||||||
|
];
|
||||||
|
|
||||||
|
unpackPhase = ''
|
||||||
|
printf 'Decompressing %s\n' "$src"
|
||||||
|
case $src in
|
||||||
|
*.tar.gz) tar -xz -f "$src" ;;
|
||||||
|
*.zip) unzip "$src" ;;
|
||||||
|
esac
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp coder $out/bin
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
installShellCompletion --cmd coder \
|
||||||
|
--bash <($out/bin/coder completion bash) \
|
||||||
|
--fish <($out/bin/coder completion fish) \
|
||||||
|
--zsh <($out/bin/coder completion zsh)
|
||||||
|
|
||||||
|
wrapProgram $out/bin/coder --prefix PATH : ${lib.makeBinPath [ terraform ]}
|
||||||
|
'';
|
||||||
|
|
||||||
|
# integration tests require network access
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Provision software development environments via Terraform on Linux, macOS, Windows, X86, ARM, and of course, Kubernetes";
|
||||||
|
homepage = "https://coder.com";
|
||||||
|
license = lib.licenses.agpl3;
|
||||||
|
maintainers = [ lib.maintainers.ghuntley lib.maintainers.urandom ];
|
||||||
|
broken = false;
|
||||||
|
};
|
||||||
|
}
|
|
@ -5,6 +5,8 @@
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
boot.tmp.cleanOnBoot = true;
|
boot.tmp.cleanOnBoot = true;
|
||||||
zramSwap.enable = true;
|
zramSwap.enable = true;
|
||||||
|
@ -16,6 +18,13 @@
|
||||||
tailscale
|
tailscale
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.coder = {
|
||||||
|
enable = true;
|
||||||
|
group = "docker";
|
||||||
|
listenAddress = "0.0.0.0:3000";
|
||||||
|
package = (pkgs.callPackage ./coder.nix {});
|
||||||
|
};
|
||||||
|
|
||||||
services.gitea-actions-runner = {
|
services.gitea-actions-runner = {
|
||||||
package = pkgs.forgejo-actions-runner;
|
package = pkgs.forgejo-actions-runner;
|
||||||
instances = {
|
instances = {
|
||||||
|
|
Loading…
Reference in a new issue