diff --git a/flake.nix b/flake.nix index eda5873..fdf9675 100644 --- a/flake.nix +++ b/flake.nix @@ -14,33 +14,29 @@ # "${nixos}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" ./hosts/macmini/configuration.nix ./irccat.nix - ({ pkgs, ... }: let - irccatPort = 6969; - in { - environment.systemPackages = [ pkgs.vim ]; - services.sshd.enable = true; - services.tailscale = { - enable = true; - extraUpFlags = [ "--ssh" ]; - }; - services.irccat = { - enable = true; - package = pkgs.irccat.overrideAttrs { - src = irccat; + ({ pkgs, ... }: + let irccatPort = 6969; + in { + environment.systemPackages = [ pkgs.vim ]; + services.sshd.enable = true; + services.tailscale = { + enable = true; + extraUpFlags = [ "--ssh" ]; }; - config = { - irc.server = "irc.libera.chat:6697"; - irc.nick = "sru-bot"; - irc.channels = "#emfcamp-video"; - http = { - listen = "localhost:${toString irccatPort}"; - listeners.github = { - default_channel = "#emfcamp-video"; + services.irccat = { + enable = true; + package = pkgs.irccat.overrideAttrs { src = irccat; }; + config = { + irc.server = "irc.libera.chat:6697"; + irc.nick = "sru-bot"; + irc.channels = "#emfcamp-video"; + http = { + listen = "localhost:${toString irccatPort}"; + listeners.github = { default_channel = "#emfcamp-video"; }; }; }; }; - }; - }) + }) ]; }; }; diff --git a/hosts/macmini/configuration.nix b/hosts/macmini/configuration.nix index 89c9de8..7e7e2cf 100644 --- a/hosts/macmini/configuration.nix +++ b/hosts/macmini/configuration.nix @@ -1,6 +1,5 @@ -{config, pkgs, ...}: { - imports = - [ ./hardware-configuration.nix ]; +{ config, pkgs, ... }: { + imports = [ ./hardware-configuration.nix ]; boot.loader.systemd-boot.enable = true; nixpkgs.config.allowUnfree = true; @@ -20,12 +19,7 @@ }; }; - environment.systemPackages = with pkgs; [ - git - htop - vim - wget - ]; + environment.systemPackages = with pkgs; [ git htop vim wget ]; services.openssh.enable = true; services.tailscale = { diff --git a/hosts/macmini/hardware-configuration.nix b/hosts/macmini/hardware-configuration.nix index 939252c..e33ccb7 100644 --- a/hosts/macmini/hardware-configuration.nix +++ b/hosts/macmini/hardware-configuration.nix @@ -4,28 +4,26 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" "wl" ]; boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/28b6ff7f-a91d-4d25-a2f5-4726267dc7d1"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/28b6ff7f-a91d-4d25-a2f5-4726267dc7d1"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/8B90-BC9C"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/8B90-BC9C"; + fsType = "vfat"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/5db7cdf3-a2b0-4c29-8261-f12d6c5897e7"; } - ]; + [{ device = "/dev/disk/by-uuid/5db7cdf3-a2b0-4c29-8261-f12d6c5897e7"; }]; # 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 @@ -35,5 +33,6 @@ # networking.interfaces.enp3s0f0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/irccat.nix b/irccat.nix index d78eef7..03a2bdb 100644 --- a/irccat.nix +++ b/irccat.nix @@ -3,14 +3,13 @@ with lib; let cfg = config.services.irccat; - format = pkgs.formats.json {}; + format = pkgs.formats.json { }; cfgFile = format.generate "config.json" cfg.config; -in -{ +in { options = { services.irccat = { enable = mkEnableOption (lib.mdDoc "Irccat irc event sender"); - package = mkPackageOption pkgs "irccat" {}; + package = mkPackageOption pkgs "irccat" { }; config = mkOption { type = types.submodule { freeformType = format.type; diff --git a/livestream-boxes/configuration.nix b/livestream-boxes/configuration.nix index a0e1670..0eea5c9 100755 --- a/livestream-boxes/configuration.nix +++ b/livestream-boxes/configuration.nix @@ -5,10 +5,9 @@ { config, lib, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; @@ -37,11 +36,9 @@ # Enable the X11 windowing system. services.xserver.enable = true; - # Enable the Plasma 5 Desktop Environment. services.xserver.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; - # Configure keymap in X11 # services.xserver.xkb.layout = "us"; @@ -57,17 +54,17 @@ # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - nix.settings.experimental-features = ["nix-command" "flakes"]; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; hardware.decklink.enable = true; virtualisation.docker.enable = true; networking = { - interfaces.eth0.ipv4.addresses = [ { + interfaces.eth0.ipv4.addresses = [{ address = "172.31.152.107"; # blue # address = "172.31.152.117"; # yellow # address = "172.31.152.127"; # green prefixLength = 24; - } ]; + }]; hostName = "livestream-blue"; # hostName = "livestream-yellow"; @@ -78,12 +75,7 @@ users.users.voc = { isNormalUser = true; extraGroups = [ "wheel" "docker" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - firefox - tree - flatpak - ffmpeg - ]; + packages = with pkgs; [ firefox tree flatpak ffmpeg ]; }; # List packages installed in system profile. To search, run: diff --git a/livestream-boxes/flake.nix b/livestream-boxes/flake.nix index 97fb4a7..1bff26b 100755 --- a/livestream-boxes/flake.nix +++ b/livestream-boxes/flake.nix @@ -1,14 +1,15 @@ { # inputs.nixpkgs.url = "nixpkgs/23.11"; - inputs.ajantv2.url = "git+https://git.hacksrus.org/Streams-R-Us/ajantv2-nix.git"; + inputs.ajantv2.url = + "git+https://git.hacksrus.org/Streams-R-Us/ajantv2-nix.git"; description = "Setup for 'livestream' boxes in Hacks'R'Us racks"; - outputs = { self, nixpkgs, ajantv2}: { + outputs = { self, nixpkgs, ajantv2 }: { nixosConfigurations = { streambox-blue = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ajantv2.nixosModules.default - ({ }: {imports = [./configuration.nix];}) + ({ }: { imports = [ ./configuration.nix ]; }) ]; }; }; diff --git a/livestream-boxes/hardware-configuration.nix b/livestream-boxes/hardware-configuration.nix index a72e43c..e592aa6 100755 --- a/livestream-boxes/hardware-configuration.nix +++ b/livestream-boxes/hardware-configuration.nix @@ -4,29 +4,34 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "firewire_ohci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "ehci_pci" + "ahci" + "firewire_ohci" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/6f4313a7-2dcb-4b8b-9a0c-43e99a369141"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/6f4313a7-2dcb-4b8b-9a0c-43e99a369141"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/8BF4-E7B8"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/8BF4-E7B8"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/b416084d-1670-4df1-8719-505b3e2c9351"; } - ]; + [{ device = "/dev/disk/by-uuid/b416084d-1670-4df1-8719-505b3e2c9351"; }]; # 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 @@ -37,5 +42,6 @@ # networking.interfaces.enp14s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; }