Compare commits
4 Commits
e57cc9dbe6
...
fileserver
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a667c8bdc | ||
|
|
705d895f0e | ||
|
|
cfc023f9b1 | ||
|
|
1201f0fc53 |
@@ -42,6 +42,14 @@ let
|
|||||||
defaultModules = baseModules;
|
defaultModules = baseModules;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
moderatio = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
modules = defaultModules ++ [
|
||||||
|
./moderatio/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
louise = nixosSystem {
|
louise = nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs.inputs = inputs;
|
specialArgs.inputs = inputs;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ in
|
|||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
../modules/malobeo_user.nix
|
../modules/malobeo_user.nix
|
||||||
|
./file_server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
sops.defaultSopsFile = ./secrets.yaml;
|
sops.defaultSopsFile = ./secrets.yaml;
|
||||||
@@ -14,7 +15,7 @@ in
|
|||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.openssh.ports = [ 22 ];
|
services.openssh.ports = [ 22 ];
|
||||||
services.openssh.settings.PasswordAuthentication = false;
|
services.openssh.passwordAuthentication = false;
|
||||||
services.openssh.settings.PermitRootLogin = "prohibit-password";
|
services.openssh.settings.PermitRootLogin = "prohibit-password";
|
||||||
users.users.root.openssh.authorizedKeys.keys = sshKeys.admins;
|
users.users.root.openssh.authorizedKeys.keys = sshKeys.admins;
|
||||||
|
|
||||||
@@ -198,7 +199,7 @@ in
|
|||||||
|
|
||||||
services.avahi = {
|
services.avahi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nssmdns4 = true;
|
nssmdns = true;
|
||||||
publish = {
|
publish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
addresses = true;
|
addresses = true;
|
||||||
|
|||||||
36
machines/lucia/file_server.nix
Normal file
36
machines/lucia/file_server.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
#automount mit udisks2
|
||||||
|
#siehe udevadm monitor
|
||||||
|
#bash-script?
|
||||||
|
#user-oder root mount
|
||||||
|
#systemd-automount villeicht
|
||||||
|
fileSystems = {
|
||||||
|
"/mnt/extHdd0" = { #statisches mounten ist am einfachsten aber kein hotplug möglich
|
||||||
|
device = "/dev/disk/by-uuid/"; #noch ausfüllen
|
||||||
|
fsType = "ext4"; #zfs wäre hier cool
|
||||||
|
options = [ "users" "nofail" ];
|
||||||
|
};
|
||||||
|
"/exports/extHdd0" = {
|
||||||
|
device = "/mnt/extHdd0";
|
||||||
|
fsType = "none";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups = { nfs = {gid = 1003; }; }; #erstelle nfs user und gruppe für isolation
|
||||||
|
users.users.nfs = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "nfs";
|
||||||
|
uid = 1003;
|
||||||
|
};
|
||||||
|
users.users.malobeo.extraGroups = [ "nfs" ];
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [ "d /export 0775 nfs nfs -" ]; #erstelle nfs ordner
|
||||||
|
|
||||||
|
services.nfs.server = {
|
||||||
|
enable = true;
|
||||||
|
exports = ''
|
||||||
|
/export 192.168.1.0/24(ro, nohide, no_subtree_check, async, all_squash, anonuid=1003, anongid=1003)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [ 2049 ]; #wir benutzen NfsV4 hoffentlich
|
||||||
|
}
|
||||||
92
machines/moderatio/configuration.nix
Normal file
92
machines/moderatio/configuration.nix
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.acpid.enable = true;
|
||||||
|
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_5_4;
|
||||||
|
services.xserver.videoDrivers = [ "intel" ];
|
||||||
|
services.xserver.deviceSection = ''
|
||||||
|
Option "DRI" "2"
|
||||||
|
Option "TearFree" "true"
|
||||||
|
'';
|
||||||
|
|
||||||
|
zramSwap.enable = true;
|
||||||
|
zramSwap.memoryPercent = 150;
|
||||||
|
|
||||||
|
imports =
|
||||||
|
[ # Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./zfs.nix
|
||||||
|
|
||||||
|
../modules/xserver.nix
|
||||||
|
../modules/malobeo_user.nix
|
||||||
|
../modules/sshd.nix
|
||||||
|
../modules/minimal_tools.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.malobeo = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
firefox
|
||||||
|
thunderbird
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hostName = "moderatio"; # Define your hostname.
|
||||||
|
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Berlin";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
# i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
# console = {
|
||||||
|
# font = "Lat2-Terminus16";
|
||||||
|
# keyMap = "us";
|
||||||
|
# useXkbConfig = true; # use xkbOptions in tty.
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
# services.printing.enable = true;
|
||||||
|
|
||||||
|
# Enable sound.
|
||||||
|
sound.enable = true;
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
# started in user sessions.
|
||||||
|
# programs.mtr.enable = true;
|
||||||
|
# programs.gnupg.agent = {
|
||||||
|
# enable = true;
|
||||||
|
# enableSSHSupport = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
# services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
|
# (/run/current-system/configuration.nix). This is useful in case you
|
||||||
|
# accidentally delete configuration.nix.
|
||||||
|
# system.copySystemConfiguration = true;
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "22.05"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
53
machines/moderatio/hardware-configuration.nix
Normal file
53
machines/moderatio/hardware-configuration.nix
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# 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 + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usb_storage" "ums_realtek" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "rpool/nixos/root";
|
||||||
|
fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/home" =
|
||||||
|
{ device = "rpool/nixos/home";
|
||||||
|
fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "bpool/nixos/root";
|
||||||
|
fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot/efis/ata-ST250LT003-9YG14C_W041QXCA-part1" =
|
||||||
|
{ device = "/dev/disk/by-uuid/A0D1-00C1";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot/efi" =
|
||||||
|
{ device = "/boot/efis/ata-ST250LT003-9YG14C_W041QXCA-part1";
|
||||||
|
fsType = "none";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# 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.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
34
machines/moderatio/zfs.nix
Normal file
34
machines/moderatio/zfs.nix
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{ boot.supportedFilesystems = [ "zfs" ];
|
||||||
|
networking.hostId = "ae749b82";
|
||||||
|
#boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||||
|
boot.loader.efi.canTouchEfiVariables = false;
|
||||||
|
boot.loader.generationsDir.copyKernels = true;
|
||||||
|
boot.loader.grub.efiInstallAsRemovable = true;
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.version = 2;
|
||||||
|
boot.loader.grub.copyKernels = true;
|
||||||
|
boot.loader.grub.efiSupport = true;
|
||||||
|
boot.loader.grub.zfsSupport = true;
|
||||||
|
boot.loader.grub.extraPrepareConfig = ''
|
||||||
|
mkdir -p /boot/efis
|
||||||
|
for i in /boot/efis/*; do mount $i ; done
|
||||||
|
|
||||||
|
mkdir -p /boot/efi
|
||||||
|
mount /boot/efi
|
||||||
|
'';
|
||||||
|
boot.loader.grub.extraInstallCommands = ''
|
||||||
|
ESP_MIRROR=$(mktemp -d)
|
||||||
|
cp -r /boot/efi/EFI $ESP_MIRROR
|
||||||
|
for i in /boot/efis/*; do
|
||||||
|
cp -r $ESP_MIRROR/EFI $i
|
||||||
|
done
|
||||||
|
rm -rf $ESP_MIRROR
|
||||||
|
'';
|
||||||
|
boot.loader.grub.devices = [
|
||||||
|
"/dev/disk/by-id/ata-ST250LT003-9YG14C_W041QXCA"
|
||||||
|
];
|
||||||
|
users.users.root.initialHashedPassword = "$6$PmoyhSlGGT6SI0t0$.cFsLyhtO1ks1LUDhLjG0vT44/NjuWCBrv5vUSXqwrU5WpaBvvthnLp0Dfwfyd6Zcdx/4izDcjQAgEWs4QdzW0";
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.openssh.ports = [ 22 ];
|
services.openssh.ports = [ 22 ];
|
||||||
services.openssh.settings.PasswordAuthentication = false;
|
services.openssh.passwordAuthentication = false;
|
||||||
services.openssh.settings.PermitRootLogin = "no";
|
services.openssh.settings.PermitRootLogin = "no";
|
||||||
users.users.root.openssh.authorizedKeys.keys = sshKeys.admins;
|
users.users.root.openssh.authorizedKeys.keys = sshKeys.admins;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
xterm.enable = false;
|
xterm.enable = false;
|
||||||
cinnamon.enable = true;
|
cinnamon.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
displayManager.defaultSession = "cinnamon";
|
||||||
};
|
};
|
||||||
services.displayManager.defaultSession = "cinnamon";
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user