*: add config
This commit is contained in:
commit
80c42c7e45
22 changed files with 3229 additions and 0 deletions
65
ops/nano/configuration.nix
Normal file
65
ops/nano/configuration.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
# 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’).
|
||||
|
||||
{ n, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Use the GRUB 2 boot loader.
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.version = 2;
|
||||
# Define on which hard drive you want to install Grub.
|
||||
boot.loader.grub.device = "/dev/sdb";
|
||||
|
||||
networking.hostName = "nano${toString n}"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Select internationalisation properties.
|
||||
# i18n = {
|
||||
# consoleFont = "Lat2-Terminus16";
|
||||
# consoleKeyMap = "us";
|
||||
# defaultLocale = "en_US.UTF-8";
|
||||
# };
|
||||
|
||||
# Set your time zone.
|
||||
# time.timeZone = "Europe/Amsterdam";
|
||||
|
||||
# List packages installed in system profile. To search by name, run:
|
||||
# $ nix-env -qaP | grep wget
|
||||
# environment.systemPackages = with pkgs; [
|
||||
# wget
|
||||
# ];
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
services.openssh.permitRootLogin = "yes";
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = false;
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = false;
|
||||
# services.xserver.layout = "us";
|
||||
# services.xserver.xkbOptions = "eurosign:e";
|
||||
|
||||
# Enable the KDE Desktop Environment.
|
||||
# services.xserver.displayManager.kdm.enable = true;
|
||||
# services.xserver.desktopManager.kde4.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
# users.extraUsers.guest = {
|
||||
# isNormalUser = true;
|
||||
# uid = 1000;
|
||||
# };
|
||||
|
||||
# The NixOS release to be compatible with for stateful data such as databases.
|
||||
system.stateVersion = "16.03";
|
||||
|
||||
}
|
23
ops/nano/hardware-configuration.nix
Normal file
23
ops/nano/hardware-configuration.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/e02a410e-5044-440f-90e9-b573e51f1315";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nix.maxJobs = 2;
|
||||
}
|
26
ops/nanos@kn.nix
Normal file
26
ops/nanos@kn.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ nixpkgs ? import <nixpkgs> {}
|
||||
, nrNanos ? 1 # Number of nanos
|
||||
}:
|
||||
|
||||
let
|
||||
pkgs = nixpkgs;
|
||||
webserver = { services.httpd.enable = true;
|
||||
services.httpd.adminAddr = "mail@stefanjunker.de";
|
||||
services.httpd.documentRoot = "${pkgs.nixops}/share/doc/nixops/";
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
};
|
||||
|
||||
mkNano = { n }: {
|
||||
imports = [
|
||||
(import ./nano/configuration.nix {inherit pkgs n;})
|
||||
../configuration/common/user/root.nix
|
||||
];
|
||||
deployment.targetEnv = "none";
|
||||
deployment.targetHost = "nano${toString n}";
|
||||
};
|
||||
|
||||
mkNanos = n: nixpkgs.lib.nameValuePair "nano${toString n}" (
|
||||
mkNano { inherit n; }
|
||||
);
|
||||
|
||||
in nixpkgs.lib.listToAttrs (map mkNanos (nixpkgs.lib.range 0 (nrNanos - 1)))
|
Loading…
Add table
Add a link
Reference in a new issue