code cleanup

This commit is contained in:
Markus Schmidl 2022-05-29 02:39:40 +02:00 committed by Grigory Shipunov
parent bd874af210
commit 1fb93826a5
5 changed files with 25 additions and 75 deletions

View File

@ -83,31 +83,11 @@
];
diskModule = { config, lib, pkgs, ... }: {
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
boot = {
loader.efi.canTouchEfiVariables = false;
loader.grub = {
enable = true;
devices = [ "/dev/sda" ];
efiSupport = true;
efiInstallAsRemovable = true;
};
growPartition = true;
};
boot.growPartition = true;
system.build.diskImage = import "${nixpkgs}/nixos/lib/make-disk-image.nix" {
name = "${config.networking.hostName}-disk";
partitionTableType = "hybrid";
partitionTableType = "efi";
additionalSpace = "2G";
inherit config lib pkgs;
postVM = ''
@ -124,8 +104,9 @@
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/traffic-stop-box/configuration.nix
./hosts/traffic-stop-box/hardware-configuration.nix
diskModule
./hosts/traffic-stop-boxes/configuration.nix
./hosts/traffic-stop-boxes/hardware-configuration.nix
./hardware/configuration-dell-wyse-3040.nix
./modules/base.nix
./modules/options.nix
@ -233,10 +214,11 @@
hydraJobs = {
data-hoarder."x86_64-linux" = self.nixosConfigurations.data-hoarder.config.system.build.toplevel;
staging-data-hoarder."x86_64-linux" = self.nixosConfigurations.staging-data-hoarder.config.system.build.toplevel;
traffic-stop-box-0."x86_64-linux" = self.nixosConfigurations.traffic-stop-box-0.config.system.build.toplevel;
traffic-stop-box-0-disk."x86_64-linux" = self.nixosConfigurations.traffic-stop-box-0.config.system.build.diskImage;
mobile-box."x86_64-linux" = self.nixosConfigurations.mobile-box.config.system.build.toplevel;
mobile-box-disk."x86_64-linux" = self.nixosConfigurations.mobile-box.config.system.build.diskImage;
staging-data-hoarder."x86_64-linux" = self.nixosConfigurations.staging-data-hoarder.config.system.build.toplevel;
};
};
}

View File

@ -1,45 +1,33 @@
# 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, inputs, ... }:
{
boot.tmpOnTmpfs = true;
hardware.hackrf.enable = true;
hardware.rtl-sdr.enable = true;
networking.hostName = "mobile-box"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "Europe/Berlin";
documentation.enable = false;
nix.gc = {
automatic = true;
dates = "daily";
nix = {
buildCores = 1;
gc = {
automatic = true;
dates = "daily";
};
};
nix.buildCores = 2;
services.journald.extraConfig = ''
SystemMaxUse=5M
'';
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.configurationLimit = 1;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

View File

@ -20,17 +20,13 @@
fsType = "ext4";
};
# fileSystems."/boot" =
# {
# device = "/dev/disk/by-label/boot";
# fsType = "vfat";
# };
swapDevices = [
fileSystems."/boot" =
{
device = "/dev/mmcblk0p1";
}
];
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
swapDevices = [ ];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,7 +1,3 @@
# 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, inputs, ... }:
{
@ -11,7 +7,6 @@
hardware.rtl-sdr.enable = true;
networking.hostName = "traffic-stop-box-${toString config.dvb-dump.systemNumber}"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "Europe/Berlin";
@ -30,16 +25,9 @@
SystemMaxUse=5M
'';
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.configurationLimit = 1;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

View File

@ -28,9 +28,5 @@
swapDevices = [ ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.configurationLimit = 1;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}