reformat all the nix files

using
    nix run -f channel:nixos-unstable nixfmt -c nixfmt $(git ls-files *.nix)
This commit is contained in:
Raphael Borun Das Gupta 2020-04-05 19:05:38 +02:00
parent a7f51f92f1
commit bf0be939cc
14 changed files with 312 additions and 312 deletions

View file

@ -4,16 +4,19 @@
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
boot.loader.grub.extraConfig = "
serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
terminal_input serial
terminal_output serial
";
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.loader.grub.extraConfig =
"\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n ";
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"ehci_pci"
"usbhid"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "virtio" "tun" ];
boot.extraModulePackages = [ ];
@ -21,6 +24,5 @@
hardware.cpu.amd.updateMicrocode = true;
nix.maxJobs = lib.mkDefault 4;
}

View file

@ -4,16 +4,15 @@
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "e1000e" "virtio-pci"];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "e1000e" "virtio-pci" ];
boot.initrd.kernelModules = [ ];
# boot.kernelModules = [ "kvm-intel" "virtio" "tun" ];
# boot.kernelModules = [ "kvm-intel" "virtio" "tun" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# boot.kernelParams = [ "console=ttyS0,115200n8" ];
# boot.kernelParams = [ "console=ttyS0,115200n8" ];
hardware.cpu.intel.updateMicrocode = true;
powerManagement.cpuFreqGovernor = "ondemand";

View file

@ -1,5 +1,4 @@
{ config, lib, pkgs, ... }:
{
{ config, lib, pkgs, ... }: {
boot.kernelPatches = [{
name = "ath10k-override-eeprom-regulatory-domain";
patch = ./wle900vx/ath10k-override-eeprom-regulatory-domain.patch;

View file

@ -4,7 +4,8 @@
{ config, pkgs, ... }:
let routerConfig = {
let
routerConfig = {
wanInterface = "wwp0s19u1u3i12";
wireless = {
wleInterface = "wlp5s0";
@ -21,14 +22,11 @@ let routerConfig = {
dhcpRange = "10.2.1.2,10.2.1.249";
routerHostName = "bachtel";
};
};
};
in
in {
{
imports =
[
imports = [
../hardware/apu.nix
../hardware/wle900vx.nix
../role/base
@ -36,15 +34,14 @@ in
(import ../role/router routerConfig)
];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/360a6bc9-fc4e-4803-bd53-69320ac32ac5";
fileSystems."/" = {
device = "/dev/disk/by-uuid/360a6bc9-fc4e-4803-bd53-69320ac32ac5";
fsType = "btrfs";
options = [ "defaults" "subvol=nixos" "noatime" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/73f91e99-d856-4504-b6b2-d60f855d6d95"; }
];
[{ device = "/dev/disk/by-uuid/73f91e99-d856-4504-b6b2-d60f855d6d95"; }];
services.wwan = {
enable = true;
@ -61,7 +58,8 @@ in
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
networking.hostName = routerConfig.lanNetwork.routerHostName; # Define your hostname.
networking.hostName =
routerConfig.lanNetwork.routerHostName; # Define your hostname.
#networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
#networking.wireless.networks = {
# yummi = {

View file

@ -5,22 +5,20 @@
{ config, pkgs, ... }:
{
imports =
[
imports = [
../hardware/apu.nix
../role/base
# ../role/router.nix #TODO
# ../role/router.nix #TODO
];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/16efc5db-0697-4f39-b64b-fc18ac318625";
fileSystems."/" = {
device = "/dev/disk/by-uuid/16efc5db-0697-4f39-b64b-fc18ac318625";
fsType = "btrfs";
options = [ "defaults" "subvol=nixos" "noatime" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b5104a7c-4a4a-4048-a9f8-44ddb0082632"; }
];
[{ device = "/dev/disk/by-uuid/b5104a7c-4a4a-4048-a9f8-44ddb0082632"; }];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;

View file

@ -5,14 +5,10 @@
{ config, pkgs, ... }:
{
imports =
[
../hardware/apu.nix
../role/base
];
imports = [ ../hardware/apu.nix ../role/base ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/ab5a598b-6609-465f-8ab8-b894b8a5e32a";
fileSystems."/" = {
device = "/dev/disk/by-uuid/ab5a598b-6609-465f-8ab8-b894b8a5e32a";
fsType = "btrfs";
options = [ "defaults" "noatime" ];
};

View file

@ -6,12 +6,14 @@
{
imports =
[
imports = [
../hardware/nuc.nix
../role/base
../role/dropbear
(import ../role/backup { systemdMount = "var-backup.mount"; borgArchiveFolder = "/var/backup/montalin";})
(import ../role/backup {
systemdMount = "var-backup.mount";
borgArchiveFolder = "/var/backup/montalin";
})
];
boot.initrd.luks.devices = {
@ -21,9 +23,21 @@
};
fileSystems = {
"/" = { device = "/dev/mapper/root"; fsType = "btrfs"; options = [ "defaults" "noatime" ]; };
"/var/backup" = { device = "/dev/mapper/backup"; fsType = "ext4"; options = [ "defaults" "noauto" "noatime" ]; };
"/boot" = { device = "/dev/disk/by-uuid/0065-E4EA"; fsType = "vfat"; options = [ "defaults" "noatime" ]; };
"/" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "defaults" "noatime" ];
};
"/var/backup" = {
device = "/dev/mapper/backup";
fsType = "ext4";
options = [ "defaults" "noauto" "noatime" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/0065-E4EA";
fsType = "vfat";
options = [ "defaults" "noatime" ];
};
};
swapDevices = [{ device = "/dev/mapper/swap"; }];

View file

@ -1,21 +1,17 @@
# Regular backup role to a separate device
{
systemdMount, # Systemd mount name
borgArchiveFolder, # Absolute borg root folder
keepWithin? "14d",
keepWeekly? "4",
keepMonthly? "6",
keepYearly? "-1",
schedule? "13:37", # Systemd Schedule of backup timer
{ systemdMount, # Systemd mount name
borgArchiveFolder, # Absolute borg root folder
keepWithin ? "14d", keepWeekly ? "4", keepMonthly ? "6", keepYearly ? "-1"
, schedule ? "13:37", # Systemd Schedule of backup timer
}:
let pkgs = import<nixpkgs>{};
in
{
let pkgs = import <nixpkgs> { };
in {
systemd = {
services.backup = {
description = "Backup of all user data and system configuration with BorgBackup";
description =
"Backup of all user data and system configuration with BorgBackup";
serviceConfig.Type = "oneshot";
path = with pkgs; [ bash borgbackup ];
script = ''

View file

@ -15,14 +15,24 @@
};
environment.systemPackages = with pkgs; [
wget curl vim tmux git ncat bind ack
fwupd pciutils dmidecode smartmontools parted
wget
curl
vim
tmux
git
ncat
bind
ack
fwupd
pciutils
dmidecode
smartmontools
parted
borgbackup
];
services.fwupd.enable = true;
# Networking
networking.firewall = {
allowPing = true;

View file

@ -18,7 +18,7 @@
echo 'cryptsetup-askpass' >> /root/.profile
'';
};
boot.kernelParams = ["ip=::::montalin:eth0:dhcp"];
boot.kernelParams = [ "ip=::::montalin:eth0:dhcp" ];
boot.initrd.postMountCommands = ''
ip link set eth0 down

View file

@ -1,15 +1,13 @@
{
# To get the MAC address of each card, use this command: cat /sys/class/net/*device_name*/address
# Make sure to use the lower-case hex values in your udev rules. It does not like upper-case.
wanInterface,
wireless ? {
# To get the MAC address of each card, use this command: cat /sys/class/net/*device_name*/address
# Make sure to use the lower-case hex values in your udev rules. It does not like upper-case.
wanInterface, wireless ? {
wleInterface = "wlp5s0";
wleSSID = "hauser";
# Generate Encrypted Passphrase with: wpa_passphrase <wleSSID> <passphrase>
wlePassphrase = "a5e42b914b5ad2b7e0474c3b9b35d0843a52668d30cd6aa8650ec43263a60b6e";
},
lanInterfaces ? [ "enp2s0" "enp3s0" ],
lanNetwork ? {
wlePassphrase =
"a5e42b914b5ad2b7e0474c3b9b35d0843a52668d30cd6aa8650ec43263a60b6e";
}, lanInterfaces ? [ "enp2s0" "enp3s0" ], lanNetwork ? {
routerAddress = "10.1.1.1";
netid = "10.1.1.0";
revIpDomain = "1.1.10";
@ -17,12 +15,10 @@
domain = "ilanz.fh2.ch";
dhcpRange = "10.1.1.2,10.1.1.249";
routerHostName = "router";
},
}:
}, }:
let pkgs = import<nixpkgs>{};
in
{
let pkgs = import <nixpkgs> { };
in {
imports = [
(import ./wireless-access-point.nix wireless)
(import ./dns-recursive.nix lanNetwork)
@ -38,7 +34,10 @@ in
bridges.lan.interfaces = lanInterfaces ++ [ wireless.wleInterface ];
interfaces.lan = {
ipv4 = {
addresses = [ { address = lanNetwork.routerAddress; prefixLength = lanNetwork.prefixLength; } ];
addresses = [{
address = lanNetwork.routerAddress;
prefixLength = lanNetwork.prefixLength;
}];
};
};
firewall.trustedInterfaces = [ "lan" ];

View file

@ -1,17 +1,8 @@
{ routerAddress, netid, revIpDomain, prefixLength, domain, dhcpRange
, routerHostName, }:
{
routerAddress,
netid,
revIpDomain,
prefixLength,
domain,
dhcpRange,
routerHostName,
}:
let pkgs = import<nixpkgs>{};
in
{
let pkgs = import <nixpkgs> { };
in {
services.unbound = {
enable = true;
@ -656,7 +647,5 @@ in
#log-dhcp
'';
systemd.services.dnsmasq = {
bindsTo = [ "network-addresses-lan.service" ];
};
systemd.services.dnsmasq = { bindsTo = [ "network-addresses-lan.service" ]; };
}

View file

@ -1,15 +1,12 @@
{
wleInterface,
wleSSID,
# Generate Encrypted Passphrase with: wpa_passphrase <wleSSID> <passphrase>
wlePassphrase,
# TODO: Type
# TODO: Multi-Band, if available
{ wleInterface, wleSSID,
# Generate Encrypted Passphrase with: wpa_passphrase <wleSSID> <passphrase>
wlePassphrase,
# TODO: Type
# TODO: Multi-Band, if available
}:
let pkgs = import<nixpkgs>{};
in
{
let pkgs = import <nixpkgs> { };
in {
boot.extraModprobeConfig = ''
options cfg80211 ieee80211_regdom=US
'';

View file

@ -24,8 +24,7 @@ let
systemctl restart wwan.service
fi
'';
in
{
in {
options.services.wwan = {
enable = mkEnableOption "wwan client service";
@ -56,7 +55,9 @@ in
type = types.enum [ "PAP" "CHAP" "MSCHAPV2" "" ];
default = "";
description = ''
APN authentication type, one of ${concatMapStringsSep ", " show values} (optional).
APN authentication type, one of ${
concatMapStringsSep ", " show values
} (optional).
'';
};
@ -91,8 +92,10 @@ in
path = with pkgs; [ libmbim iproute ];
serviceConfig = {
ExecStart = "${mbim-ip-configured}/bin/mbim-ip-configured start ${cfg.networkInterface}";
ExecStop = "${mbim-ip-configured}/bin/mbim-ip-configured stop ${cfg.networkInterface}";
ExecStart =
"${mbim-ip-configured}/bin/mbim-ip-configured start ${cfg.networkInterface}";
ExecStop =
"${mbim-ip-configured}/bin/mbim-ip-configured stop ${cfg.networkInterface}";
RemainAfterExit = true;
};
@ -111,8 +114,8 @@ in
wantedBy = [ "timers.target" ];
timerConfig = {
Unit = "wwan-check";
OnBootSec="2m";
OnUnitActiveSec="1m";
OnBootSec = "2m";
OnUnitActiveSec = "1m";
};
};