From 71c5166390abc9cdf7672620e10e93b2c7eb972b Mon Sep 17 00:00:00 2001 From: Vivian Date: Fri, 29 Dec 2023 13:01:36 +0100 Subject: [PATCH] fix lint --- nixos/hosts/hades/lucy/configuration.nix | 32 ++++--- nixos/hosts/hades/storage/configuration.nix | 88 ++++++++--------- nixos/hosts/hades/storage/fs.nix | 95 ++++++++++--------- .../hades/storage/hardware-configuration.nix | 42 ++++---- 4 files changed, 136 insertions(+), 121 deletions(-) diff --git a/nixos/hosts/hades/lucy/configuration.nix b/nixos/hosts/hades/lucy/configuration.nix index 721b44cd..09a364d1 100644 --- a/nixos/hosts/hades/lucy/configuration.nix +++ b/nixos/hosts/hades/lucy/configuration.nix @@ -49,24 +49,28 @@ enable = true; allowedTCPPorts = [ 25565 ]; }; + users = { + extraUsers = { - users.extraUsers.laura.extraGroups = [ "wheel" ]; - users.extraUsers.vivian.extraGroups = [ "wheel" ]; - users.groups.mc = { }; + laura.extraGroups = [ "wheel" ]; + vivian.extraGroups = [ "wheel" ]; - users.extraUsers.julia = { - isNormalUser = true; - shell = pkgs.zsh; + julia = { + isNormalUser = true; + shell = pkgs.zsh; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTvqk+CJG4VwN8wg3H1ZdbUVj1JuX7RYKH1ewRKfCPv julia@juliadijkstraarch" - # 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" + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTvqk+CJG4VwN8wg3H1ZdbUVj1JuX7RYKH1ewRKfCPv julia@juliadijkstraarch" + # 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" - ]; + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfooZjMWXvXZu1ReOEACDZ0TMb2WJRBSOLlWE8y6fUh victor@aoife" + ]; - extraGroups = [ "mc" "wheel" ]; + extraGroups = [ "mc" "wheel" ]; + }; + }; + groups.mc = { }; }; } diff --git a/nixos/hosts/hades/storage/configuration.nix b/nixos/hosts/hades/storage/configuration.nix index 081c7533..25c646cd 100644 --- a/nixos/hosts/hades/storage/configuration.nix +++ b/nixos/hosts/hades/storage/configuration.nix @@ -7,54 +7,56 @@ ]; boot.loader.systemd-boot.enable = true; + services = { - # Enable the OpenSSH daemon. - services.openssh.enable = true; + # Enable the OpenSSH daemon. + openssh.enable = true; # Did you read the comment? + + nfs.server = { + enable = true; + exports = '' + /mnt/storage *(rw,async,no_subtree_check,fsid=0,all_squash,anonuid=0,anongid=0) + ''; + }; + + snapraid = { + enable = true; + parityFiles = + [ "/mnt/parity1/snapraid.parity" "/mnt/parity2/snapraid.parity-2" ]; + dataDisks = { + d1 = "/mnt/disk1"; + d2 = "/mnt/disk2"; + d3 = "/mnt/disk3"; + d4 = "/mnt/disk4"; + d5 = "/mnt/disk5"; + d6 = "/mnt/disk6"; + }; + contentFiles = [ + "/var/lib/snapraid/snapraid.content" + "/mnt/disk1/snapraid.content" + "/mnt/disk2/snapraid.content" + "/mnt/disk3/snapraid.content" + "/mnt/disk5/snapraid.content" + ]; + exclude = [ + "/lost+found/" + "*.tmp" + "/tmp/" + "*.unrecoverable" + "/.Trash-1000/" + "/rancher/" + "/torrents/" + "/exclusion-zone/" + "/roms/" + "/roms/" + ]; + }; + }; # 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) - ''; - }; - - services.snapraid = { - enable = true; - parityFiles = - [ "/mnt/parity1/snapraid.parity" "/mnt/parity2/snapraid.parity-2" ]; - dataDisks = { - d1 = "/mnt/disk1"; - d2 = "/mnt/disk2"; - d3 = "/mnt/disk3"; - d4 = "/mnt/disk4"; - d5 = "/mnt/disk5"; - d6 = "/mnt/disk6"; - }; - contentFiles = [ - "/var/lib/snapraid/snapraid.content" - "/mnt/disk1/snapraid.content" - "/mnt/disk2/snapraid.content" - "/mnt/disk3/snapraid.content" - "/mnt/disk5/snapraid.content" - ]; - exclude = [ - "/lost+found/" - "*.tmp" - "/tmp/" - "*.unrecoverable" - "/.Trash-1000/" - "/rancher/" - "/torrents/" - "/exclusion-zone/" - "/roms/" - "/roms/" - ]; - }; + system.stateVersion = "23.11"; } diff --git a/nixos/hosts/hades/storage/fs.nix b/nixos/hosts/hades/storage/fs.nix index 738e0ed1..d3f3f880 100644 --- a/nixos/hosts/hades/storage/fs.nix +++ b/nixos/hosts/hades/storage/fs.nix @@ -1,60 +1,61 @@ { pkgs, ... }: { environment.systemPackages = with pkgs; [ mergerfs mergerfs-tools ]; + fileSystems = { + "/mnt/disk1" = { + fsType = "ext4"; + device = "/dev/disk/by-partuuid/abbfc440-fb3d-4b33-92cb-948b2deeac53"; + }; - fileSystems."/mnt/disk1" = { - fsType = "ext4"; - device = "/dev/disk/by-partuuid/abbfc440-fb3d-4b33-92cb-948b2deeac53"; - }; + "/mnt/disk2" = { + fsType = "ext4"; + device = "/dev/disk/by-partuuid/3a57ffa8-8a0f-4839-81df-7f34d99e9dbc"; + }; - fileSystems."/mnt/disk2" = { - fsType = "ext4"; - device = "/dev/disk/by-partuuid/3a57ffa8-8a0f-4839-81df-7f34d99e9dbc"; - }; + "/mnt/disk3" = { + fsType = "ext4"; + device = "/dev/disk/by-partuuid/0f72c5f8-b7db-4151-83f0-47e5f703aeb1"; + }; - fileSystems."/mnt/disk3" = { - fsType = "ext4"; - device = "/dev/disk/by-partuuid/0f72c5f8-b7db-4151-83f0-47e5f703aeb1"; - }; + "/mnt/disk4" = { + fsType = "ext4"; + device = "/dev/disk/by-partuuid/b9c72b41-1538-436e-a595-49d1faa5ed01"; + }; - fileSystems."/mnt/disk4" = { - fsType = "ext4"; - device = "/dev/disk/by-partuuid/b9c72b41-1538-436e-a595-49d1faa5ed01"; - }; + "/mnt/disk5" = { + fsType = "ext4"; + device = "/dev/disk/by-partuuid/928d0200-eca1-4a69-b2d6-fbd23a5ee8cd"; + }; - fileSystems."/mnt/disk5" = { - fsType = "ext4"; - device = "/dev/disk/by-partuuid/928d0200-eca1-4a69-b2d6-fbd23a5ee8cd"; - }; + "/mnt/disk6" = { + fsType = "ext4"; + device = "/dev/disk/by-uuid/63381321-fe00-4838-8668-4d1decc94296"; + }; - fileSystems."/mnt/disk6" = { - fsType = "ext4"; - device = "/dev/disk/by-uuid/63381321-fe00-4838-8668-4d1decc94296"; - }; + "/mnt/parity1" = { + fsType = "ext4"; + device = "/dev/disk/by-partuuid/7c9b88ed-b8f8-40c9-bbc3-b75d30e04e01"; + }; - fileSystems."/mnt/parity1" = { - fsType = "ext4"; - device = "/dev/disk/by-partuuid/7c9b88ed-b8f8-40c9-bbc3-b75d30e04e01"; - }; + "/mnt/parity2" = { + fsType = "ext4"; + device = "/dev/disk/by-uuid/6c568887-9d2e-45ce-ab85-4c48cca2226a"; + }; - 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" - ]; + "/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" + ]; + }; }; } diff --git a/nixos/hosts/hades/storage/hardware-configuration.nix b/nixos/hosts/hades/storage/hardware-configuration.nix index dfbcc224..a4de009b 100644 --- a/nixos/hosts/hades/storage/hardware-configuration.nix +++ b/nixos/hosts/hades/storage/hardware-configuration.nix @@ -4,28 +4,36 @@ { lib, modulesPath, ... }: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot = { + + initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ahci" + "mpt3sas" + "virtio_pci" + "sd_mod" + "sr_mod" + "virtio_blk" ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; - 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."/" = - { device = "/dev/disk/by-uuid/cdbb197e-c1a8-4780-acd8-57d23bfb4050"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/7613-E759"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/7613-E759"; + fsType = "vfat"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/a3e08ffb-2237-463e-b9bf-8a42c0dbbf22"; } - ]; + [{ 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