Gives us a start for workign on pelecan in nixos
This commit is contained in:
parent
9001157fc6
commit
b13683e40c
6 changed files with 309 additions and 0 deletions
19
applications/pelican/wings/package.nix
Normal file
19
applications/pelican/wings/package.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ stdenv, lib, fetchurl, docker, gnutar }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pelican-wings";
|
||||
version = "v1.0.0-beta6";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/pelican-dev/wings/releases/download/${version}/wings_linux_amd64";
|
||||
hash = "sha256-a2T4BjqS8Hy5YqwDEJpbvGqqsrVjdRhxvJLgk3MCXag=";
|
||||
};
|
||||
|
||||
buildInputs = [ docker gnutar ];
|
||||
|
||||
phases = [ "installPhase" ];
|
||||
|
||||
installPhase = ''
|
||||
install -D $src $out/bin/wings
|
||||
'';
|
||||
}
|
42
applications/pelican/wings/wings.nix
Normal file
42
applications/pelican/wings/wings.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
with lib; let
|
||||
cfg = config.modules.pelican-wings;
|
||||
in {
|
||||
options = {
|
||||
modules.pelican-wings = {
|
||||
enable = mkEnableOption "Pelican Wings";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall.allowedTCPPorts = [ 8080 8443 ];
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
( pkgs.callPackage ./package.nix {} )
|
||||
];
|
||||
|
||||
systemd.services.pelican-wings = {
|
||||
description = "Wings Daemon";
|
||||
after = [ "docker.service" ];
|
||||
requires = [ "docker.service" ];
|
||||
partOf = [ "docker.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
User = "root";
|
||||
WorkingDirectory = "/etc/pelican";
|
||||
LimitNOFILE = 4096;
|
||||
PIDFile = "/var/run/wings/daemon.pid";
|
||||
ExecStart = "/run/current-system/sw/bin/wings";
|
||||
Restart = "on-failure";
|
||||
startLimitInterval = 180;
|
||||
startLimitBurst = 30;
|
||||
RestartSec = "5";
|
||||
};
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue