move storage to nixos 🎉

This commit is contained in:
Vivian 2023-12-28 18:45:12 +01:00
parent 42d258e73b
commit 75af9679d2
11 changed files with 323 additions and 74 deletions

View file

@ -81,7 +81,7 @@
"storage" = {
ip = "192.168.0.115";
mac = "00:50:56:91:0d:69";
nix = false;
type = "vm";
};
"immich" = {
ip = "192.168.0.116";

View file

@ -59,8 +59,11 @@ in {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTvqk+CJG4VwN8wg3H1ZdbUVj1JuX7RYKH1ewRKfCPv julia@juliadijkstraarch"
# Below is Evelyn's key
# Below is Evelyn's keys
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDnZSVdqSybDwVooSZ+SGFM0YNu15sO/jgVqCBGDm33wj0fML5T4oviUrY6yABh+eAgy/NAztgM7+6L8Hlze5DBeMwNAvj9gr9QSzUetW0iqCscZJ8dDbW30O9449gw2JY/XZzcFMZAP5QEQGEgG/6QQ3yRwA3DMCsGhQQ37l/aS+RsKYq3ZSN4f1nFJCrm397QB8r+bhaexufXqwumxe8rlefoUNNVnmu54FA8Pc3jSdsWT4s/3mqF6NiRa53w13SBWyS+zopCy1tTSnRszgAkldpE7Vft/QnmpFavAWHzpfArv/uFXQ3fx5Cj5t70zB6VJEtaBxhdKXeQUFBCn7fmwfjV0Un9b8jLW94uDhDD3059trhMvJvqKebuqyZe74MTZH0IC3IobpSb9fHHvxuRwUQOMkkJmjv1p2y2R6v7s2tA1sZlIEBmRDvZcKo4hPBe6q13OePV3O8KAFzCmPBIfE6kQ/nLc+3k9OjFWFTshdDXUYpSVGjNrv/IanCXbEs="
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA0KA0uOoLXUN4LhU7LgtSk0atWyPlEz5LA8dIXs9xTl"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfooZjMWXvXZu1ReOEACDZ0TMb2WJRBSOLlWE8y6fUh victor@aoife"
];
extraGroups = [ "mc" "wheel" ];

View file

@ -0,0 +1,47 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./fs.nix
];
boot.loader.systemd-boot.enable = true;
networking.hostName = "storage"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# Define a user account. Don't forget to set a password with passwd.
users.users.vivian = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Disable firewall, as NFS makes it annoying
networking.firewall.enable = false;
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment?
services.nfs.server = {
enable = true;
exports = ''
/mnt/storage *(rw,async,no_subtree_check,fsid=0,all_squash,anonuid=0,anongid=0)
'';
};
}

View file

@ -0,0 +1,67 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [ mergerfs ];
fileSystems."/mnt/disk1" = {
fsType = "ext4";
device = "/dev/disk/by-partuuid/abbfc440-fb3d-4b33-92cb-948b2deeac53";
};
fileSystems."/mnt/disk2" = {
fsType = "ext4";
device = "/dev/disk/by-partuuid/3a57ffa8-8a0f-4839-81df-7f34d99e9dbc";
};
fileSystems."/mnt/disk3" = {
fsType = "ext4";
device = "/dev/disk/by-partuuid/0f72c5f8-b7db-4151-83f0-47e5f703aeb1";
};
fileSystems."/mnt/disk4" = {
fsType = "ext4";
device = "/dev/disk/by-partuuid/b9c72b41-1538-436e-a595-49d1faa5ed01";
};
fileSystems."/mnt/disk5" = {
fsType = "ext4";
device = "/dev/disk/by-partuuid/928d0200-eca1-4a69-b2d6-fbd23a5ee8cd";
};
fileSystems."/mnt/disk6" = {
fsType = "ext4";
device = "/dev/disk/by-uuid/63381321-fe00-4838-8668-4d1decc94296";
};
fileSystems."/mnt/parity1" = {
fsType = "ext4";
device = "/dev/disk/by-partuuid/7c9b88ed-b8f8-40c9-bbc3-b75d30e04e01";
};
fileSystems."/mnt/parity2" = {
fsType = "ext4";
device = "/dev/disk/by-uuid/6c568887-9d2e-45ce-ab85-4c48cca2226a";
};
fileSystems."/mnt/storage" = {
fsType = "fuse.mergerfs";
device = "/mnt/disk*";
options = [
"direct_io"
"defaults"
"allow_other"
"minfreespace=20G"
"fsname=mergerfs"
"use_ino"
"noforget"
"moveonenospc=true"
"category.create=mfs"
];
};
services.nfs.server = {
enable = true;
exports = ''
/mnt/storage *(rw,async,no_subtree_check,fsid=0,all_squash,anonuid=0,anongid=0)
'';
};
}

View file

@ -0,0 +1,38 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "mpt3sas" "virtio_pci" "sd_mod" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/cdbb197e-c1a8-4780-acd8-57d23bfb4050";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7613-E759";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/a3e08ffb-2237-463e-b9bf-8a42c0dbbf22"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -51,10 +51,7 @@
ip = "10.42.42.10";
mac = "6E:A5:25:99:FE:68";
exposes = {
www.domain = "0x76.dev";
flux.domain = "flux.0x76.dev";
internal.domain = "internal.xirion.net";
blog.domain = "blog.xirion.net";
};
};
"dex" = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, inputs, ... }:
let
clientConfig = {
"m.homeserver" = {
@ -61,6 +61,26 @@ in
};
};
"0x76.dev" = {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
add_header Content-Type 'text/html; charset=UTF-8';
return 200 '<h1>Under Construction</h1>';
'';
};
"blog.xirion.net" = {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
add_header Content-Type 'text/html; charset=UTF-8';
return 200 '<h1>Under Construction</h1>';
'';
};
# Meow
"meowy.tech" = {
enableACME = true;
@ -113,6 +133,11 @@ in
};
};
};
"es.0x76.dev" = {
enableACME = true;
forceSSL = true;
root = inputs.essentials.packages.${pkgs.system}.default;
};
"cinny.chat.meowy.tech" = {
enableACME = true;
forceSSL = true;

View file

@ -23,8 +23,8 @@ in
git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
userName = "0x76";
userEmail = "v@0x76";
userName = "Vivian";
userEmail = "vivian@0x76.dev";
lfs.enable = true;
# delta.enable = true;
extraConfig = {