nix/os/devices: init router-wan-host

This commit is contained in:
steveej 2021-01-11 11:56:32 +01:00
parent 05cb97c929
commit 8358d55177
7 changed files with 244 additions and 0 deletions

View file

@ -0,0 +1,10 @@
{ lib
, ...
}:
{
boot.loader.grub.efiSupport = true;
boot.loader.grub.efiInstallAsRemovable = lib.mkForce true;
boot.loader.efi.canTouchEfiVariables = lib.mkForce false;
boot.extraModulePackages = [ ];
}

View file

@ -0,0 +1,15 @@
{ ... }:
{
disabledModules = [
];
imports = [
../../profiles/common/configuration.nix
../../modules/opinionatedDisk.nix
./system.nix
./hw.nix
./pkg.nix
./boot.nix
];
}

View file

@ -0,0 +1,25 @@
{ ... }:
let
stage1Modules = [
"aesni_intel"
"kvm-intel"
"aes_x86_64"
"scsi_mod"
];
in
{
# TASK: new device
hardware.opinionatedDisk = {
enable = true;
encrypted = false;
diskId = "usb-SanDisk_USB_Flash_Drive_01013875dd7912fe12f6e8fe69cdeb24a78a1813c318ba161d69db591c0b3c0316d400000000000000000000a6cff87e009a450084558107b0a69ba3-0:0";
};
boot.initrd.availableKernelModules = stage1Modules;
boot.initrd.kernelModules = stage1Modules;
boot.extraModprobeConfig = ''
'';
}

View file

@ -0,0 +1,53 @@
{ config
, pkgs
, lib
, ...
}:
{
nixpkgs.config.packageOverrides = pkgs: with pkgs; {
nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath;
};
home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; };
# nix.buildMachines = [
# { hostName = "localhost";
# system = "x86_64-linux";
# supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
# maxJobs = 4;
# }
# ];
# services.hydra = {
# enable = false;
# hydraURL = "http://localhost:3000"; # externally visible URL
# notificationSender = "hydra@${config.networking.hostName}.stefanjunker.de"; # e-mail of hydra service
# # a standalone hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines
# buildMachinesFiles = [];
# # you will probably also want, otherwise *everything* will be built from scratch
# useSubstitutes = true;
# };
# services.gitlab-runner = {
# enable = false;
# extraPackages = with pkgs; [
# bash
# gitlab-runner
# nix
# gitFull
# git-crypt
# ];
# concurrent = 2;
# checkInterval = 0;
# services = {
# nixRunner = {
# executor = "shell";
# runUntagged = true;
# registrationConfigFile = "/etc/secrets/gitlab-runner/nix-runner.registration";
# tagList = [ "nix" ];
# };
# };
# };
}

View file

@ -0,0 +1,67 @@
{ pkgs
, lib
, config
, ... }:
let
keys = import ../../../variables/keys.nix;
in {
# TASK: new device
networking.hostName = "router-wan-host"; # Define your hostname.
# networking.domain = "home-ch.stefanjunker.de";
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [
# iperf3
5201
];
networking.firewall.logRefusedConnections = false;
networking.usePredictableInterfaceNames = true;
networking.dhcpcd = {
enable = true;
persistent = true;
};
networking.interfaces.eth0 = {
ipv4.addresses = [
{ address = "172.172.172.254"; prefixLength = 24; }
];
useDHCP = false;
# ipv6.addresses = [
# { address = "2a02:c207:3003:2387::1"; prefixLength = 64; }
# ];
};
# networking.defaultGateway6 = {
# address = "fe80::1";
# interface = "eth0";
# };
# networking.nat = {
# enable = true;
# internalInterfaces = [ "ve-+" ];
# externalInterface = "eth0";
# };
# Kubernetes
# services.kubernetes.roles = ["master" "node"];
nix.gc = {
automatic = true;
};
networking.useHostResolvConf = true;
containers = {
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "20.09"; # Did you read the comment?
}

View file

@ -0,0 +1,37 @@
let
nixpkgs = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-20.09";
rev = "4a75ca4a4e7d14e7b0b0230b3ea57b5bd7c16218";
};
in
{
inherit nixpkgs;
"channels-nixos-stable" = nixpkgs;
"channels-nixos-20.03" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-20.03";
rev = "929768261a3ede470eafb58d5b819e1a848aa8bf";
};
"channels-nixos-19.09" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-19.09";
rev = "75f4ba05c63be3f147bcc2f7bd4ba1f029cedcb1";
};
"channels-nixos-unstable" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-unstable";
rev = "d9dba88d08a9cdf483c3d45f0d7220cf97a4ce64";
};
"nixpkgs-master" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "master";
rev = "479867700baa7ced259c979a0f724915c4d46d12";
};
"home-manager-module" = {
url = "https://github.com/nix-community/home-manager";
ref = "release-20.09";
rev = "22f6736e628958f05222ddaadd7df7818fe8f59d";
};
}

View file

@ -0,0 +1,37 @@
let
nixpkgs = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-20.09";
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d '\n' -%>";
};
in
{
inherit nixpkgs;
"channels-nixos-stable" = nixpkgs;
"channels-nixos-20.03" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-20.03";
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.03 | awk '{ print $1 }' | tr -d '\n' -%>";
};
"channels-nixos-19.09" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-19.09";
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-19.09 | awk '{ print $1 }' | tr -d '\n' -%>";
};
"channels-nixos-unstable" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "nixos-unstable";
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>";
};
"nixpkgs-master" = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "master";
rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>";
};
"home-manager-module" = {
url = "https://github.com/nix-community/home-manager";
ref = "release-20.09";
rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-20.09 | awk '{ print $1 }' | tr -d '\n' -%>";
};
}