1
0
mirror of https://github.com/tboerger/nixos-config synced 2024-11-22 18:21:58 +01:00

chore: add some more stuff for new server

This commit is contained in:
Thomas Boerger 2022-11-17 09:45:04 +01:00
parent a5bcd9b11c
commit de3c0f004e
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B
10 changed files with 154 additions and 70 deletions

@ -8,4 +8,15 @@ self: super:
hash = "sha256-oX5EeK0+rEsMvJ+3vg26J1g5O6LTtqgrMHT/BTWGxfU=";
};
});
vscode-extensions = self.lib.recursiveUpdate super.vscode-extensions {
dzhavat.bracket-pair-toggler = self.vscode-utils.extensionFromVscodeMarketplace {
name = "bracket-pair-toggler";
publisher = "dzhavat";
version = "0.0.2";
sha256 = "sha256-2u+bdXU9nU1C8X3hpi7FfI2en4mlgWRPIVzcZrgGzPo=";
};
};
protoc-gen-openapiv2 = super.callPackage ./protoc-gen-openapiv2 { };
}

@ -0,0 +1,24 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "protoc-gen-openapiv2";
version = "2.12.0";
src = fetchFromGitHub {
owner = "grpc-ecosystem";
repo = "grpc-gateway";
rev = "v${version}";
sha256 = "sha256-OthyGEMVQnK0jN9svlfAZUl52lt19jtLd1Oj3cuirx4=";
};
vendorSha256 = "sha256-UjwpFjHVaQT4irhbt2GGlYeNhDs9Dv73PcHKhMrQfQs=";
subPackages = [ "protoc-gen-openapiv2" ];
meta = with lib; {
description = "OpenAPI v2 support for Google's protocol buffers";
homepage = "https://grpc-ecosystem.github.io/grpc-gateway/";
license = licenses.bsd3;
maintainers = with maintainers; [ tboerger ];
};
}

@ -38,7 +38,7 @@ in
};
extensions = with pkgs.vscode-extensions; [
coenraads.bracket-pair-colorizer-2
dzhavat.bracket-pair-toggler
editorconfig.editorconfig
golang.go
hashicorp.terraform

@ -33,21 +33,21 @@ for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d"
done
echo "----> Drop existing partitions"
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-1.0
sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-1.0
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-2.0
sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-2.0
# sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-3.0
# sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-3.0
# sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-4.0
# sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-4.0
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-3.0
sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-3.0
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-4.0
sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-4.0
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-5.0
sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-5.0
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:1f.2-ata-6.0
sgdisk -og /dev/disk/by-path/pci-0000:00:1f.2-ata-6.0
echo "-----> Wait for cleanup"
sleep 3
sync
echo "-----> Create sda partitions"
parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-1.0 \
parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-3.0 \
mklabel gpt \
mkpart primary fat32 0% 1GiB \
mkpart primary 1GiB 100% \
@ -57,7 +57,7 @@ parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-1.0 \
name 2 tank1
echo "-----> Create sdb partitions"
parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-2.0 \
parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-4.0 \
mklabel gpt \
mkpart primary fat32 0% 1GiB \
mkpart primary 1GiB 100% \
@ -66,35 +66,38 @@ parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-2.0 \
set 2 lvm on \
name 2 tank2
echo "-----> Create raid1 volume"
echo yes | mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/tank1 /dev/disk/by-partlabel/tank2
echo "-----> Create sdc partitions"
parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-5.0 \
mklabel gpt \
mkpart primary fat32 0% 1GiB \
mkpart primary 1GiB 100% \
set 1 esp on \
name 1 boot3 \
set 2 lvm on \
name 2 tank3
# echo "-----> Create sdc partitions"
# parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-3.0 \
# mklabel gpt \
# mkpart primary 0 100% \
# set 1 lvm on \
# name 1 tank3
echo "-----> Create sdd partitions"
parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-6.0 \
mklabel gpt \
mkpart primary fat32 0% 1GiB \
mkpart primary 1GiB 100% \
set 1 esp on \
name 1 boot4 \
set 2 lvm on \
name 2 tank4
# echo "-----> Create sdd partitions"
# parted -a opt --script /dev/disk/by-path/pci-0000:00:1f.2-ata-4.0 \
# mklabel gpt \
# mkpart primary 0 100% \
# set 1 lvm on \
# name 1 tank4
# echo "-----> Create raid2 volume"
# echo yes | mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/tank3 /dev/disk/by-partlabel/tank4
echo "-----> Create raid10 volume"
echo yes | mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/disk/by-partlabel/tank1 /dev/disk/by-partlabel/tank2 /dev/disk/by-partlabel/tank3 /dev/disk/by-partlabel/tank4
echo "-----> Wait for partitions"
sleep 3
sync
echo "-----> Create data pv"
pvcreate /dev/md0 # /dev/md1
pvcreate /dev/md0
echo "-----> Create data vg"
vgcreate system /dev/md0 # /dev/md1
vgcreate system /dev/md0
echo "-----> Create swap volume"
lvcreate -y --size $(cat /proc/meminfo | grep MemTotal | cut -d':' -f2 | sed 's/ //g') --name swap system
@ -139,3 +142,43 @@ mkfs.vfat -F32 -n boot1 /dev/disk/by-partlabel/boot1
echo "-----> Mount boot filesystem"
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot1 /mnt/boot
echo "-----> Create movies volume"
lvcreate -y --size 2000G --name movies system
echo "-----> Create movies filesystem"
mkfs.ext4 -L movies /dev/system/movies
echo "-----> Mount movies filesystem"
mkdir -p /mnt/var/lib/movies
mount -t ext4 /dev/system/movies /mnt/var/lib/movies
echo "-----> Create shows volume"
lvcreate -y --size 2000G --name shows system
echo "-----> Create shows filesystem"
mkfs.ext4 -L shows /dev/system/shows
echo "-----> Mount shows filesystem"
mkdir -p /mnt/var/lib/shows
mount -t ext4 /dev/system/shows /mnt/var/lib/shows
echo "-----> Create books volume"
lvcreate -y --size 100G --name books system
echo "-----> Create books filesystem"
mkfs.ext4 -L books /dev/system/books
echo "-----> Mount books filesystem"
mkdir -p /mnt/var/lib/books
mount -t ext4 /dev/system/books /mnt/var/lib/books
echo "-----> Create music volume"
lvcreate -y --size 100G --name music system
echo "-----> Create music filesystem"
mkfs.ext4 -L music /dev/system/music
echo "-----> Mount music filesystem"
mkdir -p /mnt/var/lib/music
mount -t ext4 /dev/system/music /mnt/var/lib/music

@ -14,21 +14,6 @@
personal = {
services = {
authentik = {
enable = config.personal.services.enable;
};
dst = {
enable = config.personal.services.enable;
};
mediang = {
enable = config.personal.services.enable;
};
minecraft = {
enable = config.personal.services.enable;
};
owncloud = {
enable = config.personal.services.enable;
};
tailscale = {
enable = config.personal.services.enable;
};

@ -16,9 +16,9 @@ with lib;
./media
./mediang
./minecraft
./nextcloud
./nixbuild
./openssh
./owncloud
./shares
./tailscale
./timesyncd

@ -0,0 +1,19 @@
{ pkgs, lib, config, options, ... }:
{
config = {
services = {
nextcloud = {
nixos = {
configuration = {
services = {
nextcloud = {
enable = true;
};
};
};
};
};
};
};
}

@ -0,0 +1,26 @@
{ pkgs, lib, config, options, fetchurl, ... }:
with lib;
let
cfg = config.personal.services.nextcloud;
in
{
options = {
personal = {
services = {
nextcloud = {
enable = mkEnableOption "Nextcloud";
};
};
};
};
config = mkIf cfg.enable {
virtualisation.arion.projects.prometheus.settings = {
imports = [
(import ./arion.nix)
];
};
};
}

@ -1,4 +0,0 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -1,20 +0,0 @@
{ pkgs, lib, config, options, fetchurl, ... }:
with lib;
let
cfg = config.personal.services.owncloud;
in
{
options = {
personal = {
services = {
owncloud = {
enable = mkEnableOption "ownCloud";
};
};
};
};
config = mkIf cfg.enable { };
}