From aa13c942c6c8e67fca6adac033cbf2415107d343 Mon Sep 17 00:00:00 2001 From: mb Date: Sun, 28 Apr 2019 15:48:23 +0200 Subject: mb: update configs --- mb/1systems/orange/configuration.nix | 6 +++--- mb/1systems/p1nk/configuration.nix | 7 ++++--- mb/2configs/default.nix | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mb/1systems/orange/configuration.nix b/mb/1systems/orange/configuration.nix index 4ac0996a4..ff9d49884 100644 --- a/mb/1systems/orange/configuration.nix +++ b/mb/1systems/orange/configuration.nix @@ -27,15 +27,13 @@ in { fileSystems."/".options = [ "noatime" "nodiratime" "discard" ]; fileSystems."/mnt/public" = { - device = "//192.168.88.252/public"; + device = "//192.168.0.4/public"; fsType = "cifs"; options = let automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; in [ "${automount_opts},user,rw,username=mb0,iocharset=utf8,credentials=${config.users.users.mb.home}/.smbcredentials" ]; }; - #networking.hostName = "0r4n93"; - networking.wireless.enable = false; # Select internationalisation properties. i18n = { @@ -173,7 +171,9 @@ in { #services.openssh.permitRootLogin = "yes"; services.openssh.passwordAuthentication = false; + networking.wireless.enable = false; networking.networkmanager.enable = false; + krebs.iptables.enable = true; #networking.nameservers = [ "8.8.8.8" "141.1.1.1" ]; networking.enableIPv6 = false; diff --git a/mb/1systems/p1nk/configuration.nix b/mb/1systems/p1nk/configuration.nix index 28a7c7776..73ef04bff 100644 --- a/mb/1systems/p1nk/configuration.nix +++ b/mb/1systems/p1nk/configuration.nix @@ -22,14 +22,13 @@ in { ]; fileSystems."/".options = [ "noatime" "nodiratime" "discard" ]; fileSystems."/mnt/public" = { - device = "//192.168.88.252/public"; + device = "//192.168.0.4/public"; fsType = "cifs"; options = let automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; in [ "${automount_opts},user,rw,username=mb0,iocharset=utf8,credentials=${config.users.users.mb.home}/.smbcredentials" ]; }; - networking.wireless.enable = true; i18n = { consoleFont = "Lat2-Terminus16"; @@ -147,7 +146,7 @@ in { services.xserver = { enable = true; layout = "de"; - xkbOptions = "neo"; + xkbOptions = "nodeadkeys"; libinput.enable = true; desktopManager = { default = "xfce"; @@ -164,7 +163,9 @@ in { services.openssh.enable = true; services.openssh.passwordAuthentication = false; + krebs.iptables.enable = true; networking.networkmanager.enable = false; + networking.wireless.enable = true; networking.nameservers = [ "8.8.8.8" "141.1.1.1" ]; networking.enableIPv6 = false; diff --git a/mb/2configs/default.nix b/mb/2configs/default.nix index 75189e192..679be56de 100644 --- a/mb/2configs/default.nix +++ b/mb/2configs/default.nix @@ -67,6 +67,7 @@ with import ; environment.systemPackages = with pkgs; [ #stockholm git + git-preview gnumake jq parallel -- cgit v1.2.3 From 1e97ad698cd93a6d70ed607e976eee0878bfd9da Mon Sep 17 00:00:00 2001 From: magenbluten Date: Sun, 28 Apr 2019 16:54:11 +0200 Subject: mb: mutableUsers = true --- mb/2configs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mb/2configs/default.nix b/mb/2configs/default.nix index 679be56de..ab11495c8 100644 --- a/mb/2configs/default.nix +++ b/mb/2configs/default.nix @@ -49,7 +49,7 @@ with import ; build.user = config.krebs.users.mb; }; - users.mutableUsers = false; + users.mutableUsers = true; services.timesyncd.enable = mkForce true; -- cgit v1.2.3 From 7736272ac122ef616a253a8732bcddbddb031047 Mon Sep 17 00:00:00 2001 From: magenbluten Date: Sun, 28 Apr 2019 22:00:12 +0200 Subject: mb orange: no wireshark --- mb/1systems/orange/configuration.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/mb/1systems/orange/configuration.nix b/mb/1systems/orange/configuration.nix index ff9d49884..fb844717b 100644 --- a/mb/1systems/orange/configuration.nix +++ b/mb/1systems/orange/configuration.nix @@ -130,7 +130,6 @@ in { vulnix wcalc wget - wireshark-gtk xz ]; -- cgit v1.2.3 From c74d86cf6a1299ba0a11fcfb2341a8632b147420 Mon Sep 17 00:00:00 2001 From: magenbluten Date: Tue, 21 May 2019 19:43:40 +0200 Subject: mb: add new machines --- krebs/3modules/mb/default.nix | 52 +++++++++++ mb/1systems/gr33n/configuration.nix | 130 +++++++++++++++++++++++++++ mb/1systems/gr33n/hardware-configuration.nix | 37 ++++++++ mb/1systems/orange/configuration.nix | 2 + mb/1systems/p1nk/configuration.nix | 1 + 5 files changed, 222 insertions(+) create mode 100644 mb/1systems/gr33n/configuration.nix create mode 100644 mb/1systems/gr33n/hardware-configuration.nix diff --git a/krebs/3modules/mb/default.nix b/krebs/3modules/mb/default.nix index c98db4b27..d6e45ba57 100644 --- a/krebs/3modules/mb/default.nix +++ b/krebs/3modules/mb/default.nix @@ -63,6 +63,58 @@ in { }; }; }; + gr33n = { + nets = { + retiolum = { + ip4.addr = "10.243.42.123"; + aliases = [ + "gr33n.r" + ]; + tinc.pubkey = '' + -----BEGIN PUBLIC KEY----- + MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvcqecLfk8TlGFF7JJpv8 + kjLFNgoNfu9FYRMNG4GSxWL5w+49n6b+GC5ciOC+RJ+N56jfB9JYE0MtbuOmkY5M + JUphuvgOCNhTbBJsjnmG9n02evpxZn9HWypNC3oQCvY2K7vHpIxGKR5PyTVKPO0P + OOYKAbCLD9F2bmuLaBQ/dFXFQxfu3tjvJI9mYDWBpSkh1mYeMZLw2xxnRZLs0bEO + ZWdzxCh9UM/mgb4WYuNED9+sz7MSsaMPAqquarFCguUxhjp6rElGFcNWjXaxA5zt + JGS6VompUViVSHjSaQ5/3VRKoIQjr4NOFYQqLpmB5S2OpiggV6I9OpB7QUGlvcYd + I3j+1AeK11HuEyPqSwxjNCCrI12bSIo3685BPHbl+AMhWGhzrCkAGcOCbAefreXQ + 5v4SaKUIDlCYhN+vyNdlu2jvqQlxfJrPAfBt+jJBK6gMcAEKc7P/Oj4B9Fsl331X + s0kWH5G9t6OhO/Of8/kb2/P+YEbM6zi1QQdZAOr6Cg0y4cMt9zxLWknaM4yEDAXH + oSM33PTv9DOvBjfxRXqOHqOHRq5ayqZdIFgfLUlPTdbWRkhNzjG8f7k7p32m20A6 + Kal+OF//I2c9E9vKFzyepyTcnwi3B8+cFJ74+XYaNApdwHSb1BU/+c3O9RJExZGV + jtTSbSJHU5esECtAuXy1XH8CAwEAAQ== + -----END PUBLIC KEY----- + ''; + }; + }; + }; + sunsh1n3 = { + nets = { + retiolum = { + ip4.addr = "10.243.42.142"; + aliases = [ + "sunsh1n3.r" + ]; + tinc.pubkey = '' + -----BEGIN PUBLIC KEY----- + MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAo2VCqp6mUbyo3n+1XpKf + QavpgRYQyv9wAZzYSYHjxThuLmNb/wERPbWJFMZfAGuku0blKWJISSgFWd9YL7dU + pZQZxfqo/9xnS/r0xIKrKSsBiTZt7JZmTQzj1ri11TIO0S1QPjIP5HsxlZZAw0nz + idEDlKmgWs74FPdezlXqvJyEUKDqL/ZQBtdhZZIDMkSJnCdBzXxKwv+uLVE46ZBf + 4HrtQjcj+dyVMogMIoseAgf5lS6V3pyCM7/NHZFxrIxoIAxSsUoB59i2EbK6aUK5 + yuiWHI6ZHToxN2K/0SX96hzxcwrUmdk49tTHBY0Zhn2ku6NjQPU3LuxgIwrSaSJD + /KWh6XkqR7EsCVN0AIsLvFelI2ckSyNyAlnYbMAHDt7GwHlNp4Lsy+x4ZQ6m0xTY + Z+/jt6sfoMiulPcwWEpqNCCf5A65lF77DldQhH3qYrdQ756n/kOqSfQtPCnVNYXy + LlN5rKCOgxKxxtKkwMUif2OM9RPHpM7wS09Rvek6zpL9ymhU5THF7UylLKxKGjYj + 6dTooyRVQRJdrwIYLrJIy0MfGyYiGAJxf/C0KOOZnJPCW2b51+bo5Zh+BhKZYN8H + C2DEGc8+4h5hX1TAaUfTpfVm3mMTh8H2m9N8Pdl5ji+A0m0IwHDLQyaoskcxSjvU + 9IxYLfkSD6AJqasnHlz0L08CAwEAAQ== + -----END PUBLIC KEY----- + ''; + }; + }; + }; }; users = { mb = { diff --git a/mb/1systems/gr33n/configuration.nix b/mb/1systems/gr33n/configuration.nix new file mode 100644 index 000000000..4342ba0e2 --- /dev/null +++ b/mb/1systems/gr33n/configuration.nix @@ -0,0 +1,130 @@ +{ config, pkgs, callPackage, ... }: let + unstable = import { config = { allowUnfree = true; }; }; +in { + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + + ]; + + krebs.build.host = config.krebs.hosts.gr33n; + + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.extraModulePackages = with config.boot.kernelPackages; [ wireguard ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + fileSystems."/".options = [ "noatime" "nodiratime" "discard" ]; + fileSystems."/mnt/public" = { + device = "//192.168.0.4/public"; + fsType = "cifs"; + options = let + automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; + in [ "${automount_opts},user,rw,username=mb0,iocharset=utf8,credentials=${config.users.users.mb.home}/.smbcredentials" ]; + }; + + i18n = { + consoleFont = "Lat2-Terminus16"; + consoleKeyMap = "de"; + defaultLocale = "en_US.UTF-8"; + }; + + time.timeZone = "Europe/Berlin"; + + nixpkgs.config.allowUnfree = true; + + nixpkgs.config.packageOverrides = super: { + openvpn = super.openvpn.override { + pkcs11Support = true; + useSystemd = false; + }; + }; + + environment.shellAliases = { + ll = "ls -alh"; + ls = "ls --color=tty"; + }; + + environment.systemPackages = with pkgs; [ + curl + fish + git + htop + nmap + ranger + tcpdump + tmux + traceroute + tree + vim + wcalc + wget + xz + ]; + + programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; + + sound.enable = false; + + services.openssh.enable = true; + services.openssh.passwordAuthentication = false; + + networking.wireless.enable = false; + networking.networkmanager.enable = false; + krebs.iptables.enable = true; + networking.enableIPv6 = false; + + programs.fish = { + enable = true; + shellInit = '' + function ssh_agent --description 'launch the ssh-agent and add the id_rsa identity' + if begin + set -q SSH_AGENT_PID + and kill -0 $SSH_AGENT_PID + and grep -q '^ssh-agent' /proc/$SSH_AGENT_PID/cmdline + end + echo "ssh-agent running on pid $SSH_AGENT_PID" + else + eval (command ssh-agent -c | sed 's/^setenv/set -Ux/') + end + set -l identity $HOME/.ssh/id_rsa + set -l fingerprint (ssh-keygen -lf $identity | awk '{print $2}') + ssh-add -l | grep -q $fingerprint + or ssh-add $identity + end + ''; + promptInit = '' + function fish_prompt --description 'Write out the prompt' + set -l color_cwd + set -l suffix + set -l nix_shell_info ( + if test "$IN_NIX_SHELL" != "" + echo -n " " + end + ) + switch "$USER" + case root toor + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + else + set color_cwd $fish_color_cwd + end + set suffix '#' + case '*' + set color_cwd $fish_color_cwd + set suffix '>' + end + + echo -n -s "$USER" @ (set_color green) (prompt_hostname) (set_color normal) "$nix_shell_info" ' ' (set_color $color_cwd) (prompt_pwd) (set_color normal) "$suffix " + end + ''; + }; + + nix.buildCores = 4; + system.autoUpgrade.enable = false; + system.autoUpgrade.channel = "https://nixos.org/channels/nixos-19.03"; + system.stateVersion = "19.03"; + +} diff --git a/mb/1systems/gr33n/hardware-configuration.nix b/mb/1systems/gr33n/hardware-configuration.nix new file mode 100644 index 000000000..1d13b8dc7 --- /dev/null +++ b/mb/1systems/gr33n/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 = + [ + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + boot.initrd.mdadmConf = '' + ARRAY /dev/md0 level=raid6 num-devices=4 metadata=1.2 name=gr33n:0 UUID=5b715fd9:0be6bfa6:19f07db4:c16836d6 + devices=/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1 + ''; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/a9f2c19b-f60f-450c-87f1-146a54c4198b"; + fsType = "ext4"; + }; + fileSystems."/storage" = + { device = "/dev/disk/by-label/storage"; + fsType = "ext4"; + }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/93EB-BCA3"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/mb/1systems/orange/configuration.nix b/mb/1systems/orange/configuration.nix index fb844717b..3e90f89a2 100644 --- a/mb/1systems/orange/configuration.nix +++ b/mb/1systems/orange/configuration.nix @@ -148,6 +148,8 @@ in { sound.enable = true; hardware.pulseaudio.enable = true; + hardware.pulseaudio.support32Bit = true; + nixpkgs.config.pulseaudio = true; services.xserver = { enable = true; diff --git a/mb/1systems/p1nk/configuration.nix b/mb/1systems/p1nk/configuration.nix index 73ef04bff..905630e78 100644 --- a/mb/1systems/p1nk/configuration.nix +++ b/mb/1systems/p1nk/configuration.nix @@ -142,6 +142,7 @@ in { sound.enable = true; hardware.pulseaudio.enable = true; + hardware.pulseaudio.support32Bit = true; services.xserver = { enable = true; -- cgit v1.2.3 From be12b8a41370f50b413376717a5db38edfebd828 Mon Sep 17 00:00:00 2001 From: magenbluten Date: Tue, 21 May 2019 20:23:09 +0200 Subject: mb sunshine.r: disable ci --- krebs/3modules/mb/default.nix | 2 +- submodules/krops | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/mb/default.nix b/krebs/3modules/mb/default.nix index d6e45ba57..e77811f08 100644 --- a/krebs/3modules/mb/default.nix +++ b/krebs/3modules/mb/default.nix @@ -3,7 +3,6 @@ with import ; hostDefaults = hostName: host: flip recursiveUpdate host { ci = true; - monitoring = true; owner = config.krebs.users.mb; }; @@ -90,6 +89,7 @@ in { }; }; sunsh1n3 = { + ci = false; nets = { retiolum = { ip4.addr = "10.243.42.142"; diff --git a/submodules/krops b/submodules/krops index ee41207df..5b8fb8dc0 160000 --- a/submodules/krops +++ b/submodules/krops @@ -1 +1 @@ -Subproject commit ee41207df1ce718e0b154ed8047384118a0133a4 +Subproject commit 5b8fb8dc0ee14672d7fd533bd98635b8725dbb29 -- cgit v1.2.3