Skip to content

Commit

Permalink
nixfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Q-Mart committed May 27, 2024
1 parent a07cd18 commit 6f3aae6
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 85 deletions.
42 changes: 19 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"; };
};
};
};
};
})
})
];
};
};
Expand Down
12 changes: 3 additions & 9 deletions hosts/macmini/configuration.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 = {
Expand Down
29 changes: 14 additions & 15 deletions hosts/macmini/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
7 changes: 3 additions & 4 deletions irccat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 7 additions & 15 deletions livestream-boxes/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions livestream-boxes/flake.nix
Original file line number Diff line number Diff line change
@@ -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 ]; })
];
};
};
Expand Down
38 changes: 22 additions & 16 deletions livestream-boxes/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

0 comments on commit 6f3aae6

Please sign in to comment.