refactor into lib/lxc-container,shared for grafana
This commit is contained in:
parent
f4b14c94fa
commit
79db592b0a
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "secrets"]
|
||||||
|
path = secrets
|
||||||
|
url = ssh://git@gitea.c3d2.de:2222/c3d2-admins/secrets.git
|
|
@ -2,48 +2,20 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ <nixpkgs/nixos/modules/profiles/minimal.nix>
|
[ ../../../lib/lxc-container.nix
|
||||||
|
../../../lib/shared.nix
|
||||||
];
|
];
|
||||||
nix.useSandbox = false;
|
|
||||||
nix.maxJobs = lib.mkDefault 2;
|
|
||||||
nix.buildCores = lib.mkDefault 16;
|
|
||||||
|
|
||||||
boot.isContainer = true;
|
|
||||||
# /sbin/init
|
|
||||||
boot.loader.initScript.enable = true;
|
|
||||||
boot.loader.grub.enable = false;
|
|
||||||
|
|
||||||
fileSystems."/" = { fsType = "rootfs"; device = "rootfs"; };
|
|
||||||
|
|
||||||
networking.hostName = "grafana";
|
networking.hostName = "grafana";
|
||||||
networking.useNetworkd = true;
|
networking.useNetworkd = true;
|
||||||
networking.defaultGateway = "172.22.99.4";
|
networking.defaultGateway = "172.22.99.4";
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = "Europe/Berlin";
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n = {
|
|
||||||
defaultLocale = "en_US.UTF-8";
|
|
||||||
supportedLocales = lib.mkForce [ "en_US.UTF-8/UTF-8" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
];
|
];
|
||||||
|
|
||||||
# Create a few files early before packing tarball for Proxmox
|
|
||||||
# architecture/OS detection.
|
|
||||||
system.extraSystemBuilderCmds =
|
|
||||||
''
|
|
||||||
mkdir -m 0755 -p $out/bin
|
|
||||||
ln -s ${pkgs.bash}/bin/bash $out/bin/sh
|
|
||||||
mkdir -m 0755 -p $out/sbin
|
|
||||||
ln -s ../init $out/sbin/init
|
|
||||||
'';
|
|
||||||
|
|
||||||
|
|
||||||
# http https
|
# http https
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
# collectd
|
# collectd
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ <nixpkgs/nixos/modules/profiles/minimal.nix>
|
||||||
|
];
|
||||||
|
nix.useSandbox = false;
|
||||||
|
nix.maxJobs = lib.mkDefault 1;
|
||||||
|
nix.buildCores = lib.mkDefault 4;
|
||||||
|
|
||||||
|
boot.isContainer = true;
|
||||||
|
# /sbin/init
|
||||||
|
boot.loader.initScript.enable = true;
|
||||||
|
boot.loader.grub.enable = false;
|
||||||
|
|
||||||
|
# Create a few files early before packing tarball for Proxmox
|
||||||
|
# architecture/OS detection.
|
||||||
|
system.extraSystemBuilderCmds =
|
||||||
|
''
|
||||||
|
mkdir -m 0755 -p $out/bin
|
||||||
|
ln -s ${pkgs.bash}/bin/bash $out/bin/sh
|
||||||
|
mkdir -m 0755 -p $out/sbin
|
||||||
|
ln -s ../init $out/sbin/init
|
||||||
|
'';
|
||||||
|
|
||||||
|
fileSystems."/" = { fsType = "rootfs"; device = "rootfs"; };
|
||||||
|
|
||||||
|
# Required for remote deployment
|
||||||
|
services.openssh.enable = true;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Berlin";
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
supportedLocales = lib.mkForce [ "en_US.UTF-8/UTF-8" ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 16d7de68c8468e0f347092526150d72d4fd5fc93
|
Loading…
Reference in New Issue