From fa10334a545d0108c70445d85d215fe87bc234b8 Mon Sep 17 00:00:00 2001 From: fwastring Date: Thu, 27 Mar 2025 20:20:26 +0100 Subject: [PATCH] added macmini --- flake.nix | 6 +-- maskiner/macmini/configuration.nix | 53 +++++++++++++++++++++ maskiner/macmini/hardware-configuration.nix | 39 +++++++++++++++ 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 maskiner/macmini/configuration.nix create mode 100644 maskiner/macmini/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 3dc581a..04cf031 100644 --- a/flake.nix +++ b/flake.nix @@ -72,12 +72,12 @@ }; modules = [./maskiner/work-desktop/configuration.nix]; }; - lillen = nixpkgs.lib.nixosSystem { + macmini = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs; - myhostname = "lillen"; + myhostname = "macmini"; }; - modules = [./maskiner/lillen/configuration.nix]; + modules = [./maskiner/macmini/configuration.nix]; }; }; diff --git a/maskiner/macmini/configuration.nix b/maskiner/macmini/configuration.nix new file mode 100644 index 0000000..c98d9f7 --- /dev/null +++ b/maskiner/macmini/configuration.nix @@ -0,0 +1,53 @@ +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) +{ + inputs, + lib, + config, + pkgs, + myhostname, + ... +}: { + # You can import other NixOS modules here + imports = [ + ./hardware-configuration.nix + ../../config/users.nix + ]; + + environment.systemPackages = with pkgs; [ + unstable.lego + ]; +networking.firewall = { + enable = true; + allowedTCPPorts = [ 80 443 3000 8384 22000]; + allowedUDPPortRanges = [ + { from = 4000; to = 4007; } + { from = 8000; to = 8010; } + ]; +}; + + networking.firewall.allowedUDPPorts = [ 22000 21027 ]; + + services = { + openssh = { + enable = true; + ports = [22]; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + X11Forwarding = true; + }; + extraConfig = '' + AllowUsers fw + ''; + }; + }; + + + security.rtkit.enable = true; + networking.hostName = myhostname; + + services.xserver.dpi = 100; + + system.stateVersion = "24.11"; +} diff --git a/maskiner/macmini/hardware-configuration.nix b/maskiner/macmini/hardware-configuration.nix new file mode 100644 index 0000000..57c3ec5 --- /dev/null +++ b/maskiner/macmini/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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 = [ "ohci_pci" "ehci_pci" "ahci" "firewire_ohci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" "wl" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1c7e7116-3486-45a8-90c0-d3deea8e96b0"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/B70D-941F"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0b1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}