From 1fb964e8412106a5d9b764e86a995aabbcd060c3 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 8 Jul 2017 15:00:30 +0200 Subject: shell: call proxy nix-shell with --run --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 3e7ba81c1..83ff7f039 100644 --- a/shell.nix +++ b/shell.nix @@ -109,7 +109,7 @@ let NIX_PATH=$(q "$target_path") \ STOCKHOLM_VERSION=$STOCKHOLM_VERSION \ nix-shell \ - --command $(q \ + --run $(q \ config=$config \ system=$system \ target=$target \ -- cgit v1.2.3 From fc3f5d3d56a299b7b46c1a42d3fec57c536a5917 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 8 Jul 2017 14:58:09 +0200 Subject: shell: don't populate when source doesn't evaluate --- shell.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shell.nix b/shell.nix index 83ff7f039..e0c60e330 100644 --- a/shell.nix +++ b/shell.nix @@ -85,18 +85,19 @@ let }; populate = pkgs.writeDash "init.env.populate" '' set -efu - ${pkgs.nix}/bin/nix-instantiate \ + _source=$(${pkgs.nix}/bin/nix-instantiate \ --eval \ --json \ --readonly-mode \ --show-trace \ --strict \ -I nixos-config="$config" \ - -E 'with import ; config.krebs.build.source' \ - | + -E 'with import ; config.krebs.build.source') + echo $_source | ${pkgs.populate}/bin/populate \ "$target_user@$target_host:$target_port$target_path" \ >&2 + unset _source ''; proxy = pkgs.writeDash "init.env.proxy" '' set -efu -- cgit v1.2.3 From 7fdc46bb9d911838edfa723d985ede6a604c0c5a Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 6 Jul 2017 21:47:47 +0200 Subject: move source config from module system to 1systems/*/source.nix --- Makefile | 2 +- krebs/3modules/build.nix | 7 -- lib/default.nix | 3 + lib/eval-source.nix | 17 +++++ shell.nix | 6 +- tv/1systems/alnus.nix | 96 ------------------------ tv/1systems/alnus/config.nix | 96 ++++++++++++++++++++++++ tv/1systems/alnus/source.nix | 3 + tv/1systems/caxi.nix | 25 ------- tv/1systems/caxi/config.nix | 25 +++++++ tv/1systems/caxi/source.nix | 3 + tv/1systems/cd.nix | 34 --------- tv/1systems/cd/config.nix | 34 +++++++++ tv/1systems/cd/source.nix | 3 + tv/1systems/mu.nix | 160 --------------------------------------- tv/1systems/mu/config.nix | 160 +++++++++++++++++++++++++++++++++++++++ tv/1systems/mu/source.nix | 3 + tv/1systems/nomic.nix | 74 ------------------ tv/1systems/nomic/config.nix | 74 ++++++++++++++++++ tv/1systems/nomic/source.nix | 4 + tv/1systems/test/source.nix | 3 + tv/1systems/wu.nix | 174 ------------------------------------------- tv/1systems/wu/config.nix | 174 +++++++++++++++++++++++++++++++++++++++++++ tv/1systems/wu/source.nix | 4 + tv/1systems/xu.nix | 174 ------------------------------------------- tv/1systems/xu/config.nix | 174 +++++++++++++++++++++++++++++++++++++++++++ tv/1systems/xu/source.nix | 4 + tv/1systems/zu.nix | 170 ------------------------------------------ tv/1systems/zu/config.nix | 170 ++++++++++++++++++++++++++++++++++++++++++ tv/1systems/zu/source.nix | 4 + tv/2configs/default.nix | 18 +---- tv/source.nix | 22 ++++++ 32 files changed, 986 insertions(+), 934 deletions(-) create mode 100644 lib/eval-source.nix delete mode 100644 tv/1systems/alnus.nix create mode 100644 tv/1systems/alnus/config.nix create mode 100644 tv/1systems/alnus/source.nix delete mode 100644 tv/1systems/caxi.nix create mode 100644 tv/1systems/caxi/config.nix create mode 100644 tv/1systems/caxi/source.nix delete mode 100644 tv/1systems/cd.nix create mode 100644 tv/1systems/cd/config.nix create mode 100644 tv/1systems/cd/source.nix delete mode 100644 tv/1systems/mu.nix create mode 100644 tv/1systems/mu/config.nix create mode 100644 tv/1systems/mu/source.nix delete mode 100644 tv/1systems/nomic.nix create mode 100644 tv/1systems/nomic/config.nix create mode 100644 tv/1systems/nomic/source.nix create mode 100644 tv/1systems/test/source.nix delete mode 100644 tv/1systems/wu.nix create mode 100644 tv/1systems/wu/config.nix create mode 100644 tv/1systems/wu/source.nix delete mode 100644 tv/1systems/xu.nix create mode 100644 tv/1systems/xu/config.nix create mode 100644 tv/1systems/xu/source.nix delete mode 100644 tv/1systems/zu.nix create mode 100644 tv/1systems/zu/config.nix create mode 100644 tv/1systems/zu/source.nix create mode 100644 tv/source.nix diff --git a/Makefile b/Makefile index cab53d52a..e35aa89bc 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ export STOCKHOLM_VERSION ?= $(shell \ system ?= $(HOSTNAME) $(if $(system),,$(error unbound variable: system)) -nixos-config ?= $(stockholm)/$(LOGNAME)/1systems/$(system).nix +nixos-config ?= $(stockholm)/$(LOGNAME)/1systems/$(system)/config.nix ifneq ($(words $(wildcard $(nixos-config))),1) $(error bad nixos-config: $(nixos-config)) endif diff --git a/krebs/3modules/build.nix b/krebs/3modules/build.nix index 976d378f9..904deb164 100644 --- a/krebs/3modules/build.nix +++ b/krebs/3modules/build.nix @@ -14,16 +14,9 @@ with import ; default = "/nix/var/nix/profiles/system"; }; - source = mkOption { - type = types.attrsOf types.source; - default = {}; - }; - # TODO deprecate krebs.build.user user = mkOption { type = types.user; }; }; - - config.krebs.build.source.stockholm.file = mkDefault (toString ); } diff --git a/lib/default.nix b/lib/default.nix index 803a614a1..4c54f60aa 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,6 +1,9 @@ let nixpkgs-lib = import ; lib = with lib; nixpkgs-lib // builtins // { + + evalSource = import ./eval-source.nix; + git = import ./git.nix { inherit lib; }; shell = import ./shell.nix { inherit lib; }; types = nixpkgs-lib.types // import ./types.nix { inherit lib; }; diff --git a/lib/eval-source.nix b/lib/eval-source.nix new file mode 100644 index 000000000..de5f0b43c --- /dev/null +++ b/lib/eval-source.nix @@ -0,0 +1,17 @@ +with import ; +let + eval = _file: source: evalModules { + modules = singleton { + inherit _file; + options.source = mkOption { + type = types.attrsOf types.source; + default = {}; + }; + config = { + inherit source; + }; + }; + }; +in + # This function's return value can be used as pkgs.populate input. + _file: source: (eval _file source).config.source diff --git a/shell.nix b/shell.nix index e0c60e330..57957f823 100644 --- a/shell.nix +++ b/shell.nix @@ -43,9 +43,11 @@ let ''; init.env = pkgs.writeText "init.env" /* sh */ '' - config=''${config-$LOGNAME/1systems/$system.nix} + config=''${config-$LOGNAME/1systems/$system/config.nix} + source=''${source-$LOGNAME/1systems/$system/source.nix} export config + export source export system export target @@ -92,7 +94,7 @@ let --show-trace \ --strict \ -I nixos-config="$config" \ - -E 'with import ; config.krebs.build.source') + "$source") echo $_source | ${pkgs.populate}/bin/populate \ "$target_user@$target_host:$target_port$target_path" \ diff --git a/tv/1systems/alnus.nix b/tv/1systems/alnus.nix deleted file mode 100644 index ef2a0500f..000000000 --- a/tv/1systems/alnus.nix +++ /dev/null @@ -1,96 +0,0 @@ -{ config, pkgs, ... }: - -with import ; - -{ - imports = [ - ../. - ../2configs/hw/x220.nix - ../2configs/exim-retiolum.nix - ../2configs/retiolum.nix - ]; - - # TODO remove non-hardware stuff from ../2configs/hw/x220.nix - # networking.wireless.enable collides with networkmanager - networking.wireless.enable = mkForce false; - - boot = { - initrd = { - availableKernelModules = [ "ahci" ]; - luks = { - cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ { name = "luksroot"; device = "/dev/sda2"; } ]; - }; - }; - }; - - environment.systemPackages = with pkgs; [ - chromium - firefoxWrapper - networkmanagerapplet - pidginotr - pidgin-with-plugins - ]; - - fileSystems = { - "/boot" = { - device = "/dev/sda1"; - }; - "/" = { - device = "/dev/mapper/main-root"; - fsType = "btrfs"; - options = [ "defaults" "noatime" ]; - }; - "/home" = { - device = "/dev/mapper/main-home"; - fsType = "btrfs"; - options = [ "defaults" "noatime" ]; - }; - }; - - hardware = { - opengl.driSupport32Bit = true; - pulseaudio.enable = true; - }; - - i18n.defaultLocale = "de_DE.UTF-8"; - - krebs.build = { - host = config.krebs.hosts.alnus; - user = mkForce config.krebs.users.dv; - source.nixpkgs.git.ref = mkForce "9b948ea439ddbaa26740ce35543e7e35d2aa6d18"; - }; - - networking.networkmanager.enable = true; - - nixpkgs.config = { - allowUnfree = true; - }; - - services.xserver = { - enable = true; - layout = "de"; - xkbOptions = "eurosign:e"; - synaptics = { - enable = true; - twoFingerScroll = true; - }; - desktopManager.xfce.enable = true; - displayManager.auto = { - enable = true; - user = "dv"; - }; - }; - - swapDevices =[ ]; - - users.users.dv = { - inherit (config.krebs.users.dv) home uid; - isNormalUser = true; - extraGroups = [ - "audio" - "video" - "networkmanager" - ]; - }; -} diff --git a/tv/1systems/alnus/config.nix b/tv/1systems/alnus/config.nix new file mode 100644 index 000000000..d08a2901b --- /dev/null +++ b/tv/1systems/alnus/config.nix @@ -0,0 +1,96 @@ +{ config, pkgs, ... }: + +with import ; + +{ + imports = [ + + + + + ]; + + # TODO remove non-hardware stuff from ../2configs/hw/x220.nix + # networking.wireless.enable collides with networkmanager + networking.wireless.enable = mkForce false; + + boot = { + initrd = { + availableKernelModules = [ "ahci" ]; + luks = { + cryptoModules = [ "aes" "sha512" "xts" ]; + devices = [ { name = "luksroot"; device = "/dev/sda2"; } ]; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + chromium + firefoxWrapper + networkmanagerapplet + pidginotr + pidgin-with-plugins + ]; + + fileSystems = { + "/boot" = { + device = "/dev/sda1"; + }; + "/" = { + device = "/dev/mapper/main-root"; + fsType = "btrfs"; + options = [ "defaults" "noatime" ]; + }; + "/home" = { + device = "/dev/mapper/main-home"; + fsType = "btrfs"; + options = [ "defaults" "noatime" ]; + }; + }; + + hardware = { + opengl.driSupport32Bit = true; + pulseaudio.enable = true; + }; + + i18n.defaultLocale = "de_DE.UTF-8"; + + krebs.build = { + host = config.krebs.hosts.alnus; + user = mkForce config.krebs.users.dv; + source.nixpkgs.git.ref = mkForce "9b948ea439ddbaa26740ce35543e7e35d2aa6d18"; + }; + + networking.networkmanager.enable = true; + + nixpkgs.config = { + allowUnfree = true; + }; + + services.xserver = { + enable = true; + layout = "de"; + xkbOptions = "eurosign:e"; + synaptics = { + enable = true; + twoFingerScroll = true; + }; + desktopManager.xfce.enable = true; + displayManager.auto = { + enable = true; + user = "dv"; + }; + }; + + swapDevices =[ ]; + + users.users.dv = { + inherit (config.krebs.users.dv) home uid; + isNormalUser = true; + extraGroups = [ + "audio" + "video" + "networkmanager" + ]; + }; +} diff --git a/tv/1systems/alnus/source.nix b/tv/1systems/alnus/source.nix new file mode 100644 index 000000000..f9dcefee6 --- /dev/null +++ b/tv/1systems/alnus/source.nix @@ -0,0 +1,3 @@ +import { + name = "alnus"; +} diff --git a/tv/1systems/caxi.nix b/tv/1systems/caxi.nix deleted file mode 100644 index 59f3cd63a..000000000 --- a/tv/1systems/caxi.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, ... }: - -with import ; - -{ - krebs.build.host = config.krebs.hosts.caxi; - - imports = [ - ../. - ../2configs/hw/CAC-Developer-1.nix - ../2configs/fs/CAC-CentOS-7-64bit.nix - ../2configs/retiolum.nix - ]; - - networking = let - inherit (config.krebs.build.host.nets.internet) ip4; - in { - interfaces.enp2s1.ip4 = singleton { - address = ip4.addr; - prefixLength = fromJSON (head (match ".*/([0-9]+)" ip4.prefix)); - }; - defaultGateway = head (match "([^/]*)\.0/[0-9]+" ip4.prefix) + ".1"; - nameservers = ["8.8.8.8"]; - }; -} diff --git a/tv/1systems/caxi/config.nix b/tv/1systems/caxi/config.nix new file mode 100644 index 000000000..b136d1ade --- /dev/null +++ b/tv/1systems/caxi/config.nix @@ -0,0 +1,25 @@ +{ config, ... }: + +with import ; + +{ + krebs.build.host = config.krebs.hosts.caxi; + + imports = [ + + + + + ]; + + networking = let + inherit (config.krebs.build.host.nets.internet) ip4; + in { + interfaces.enp2s1.ip4 = singleton { + address = ip4.addr; + prefixLength = fromJSON (head (match ".*/([0-9]+)" ip4.prefix)); + }; + defaultGateway = head (match "([^/]*)\.0/[0-9]+" ip4.prefix) + ".1"; + nameservers = ["8.8.8.8"]; + }; +} diff --git a/tv/1systems/caxi/source.nix b/tv/1systems/caxi/source.nix new file mode 100644 index 000000000..bc875b768 --- /dev/null +++ b/tv/1systems/caxi/source.nix @@ -0,0 +1,3 @@ +import { + name = "caxi"; +} diff --git a/tv/1systems/cd.nix b/tv/1systems/cd.nix deleted file mode 100644 index 9f2cec574..000000000 --- a/tv/1systems/cd.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import ; - -{ - krebs.build.host = config.krebs.hosts.cd; - - imports = [ - ../. - ../2configs/hw/CAC-Developer-2.nix - ../2configs/fs/CAC-CentOS-7-64bit.nix - ../2configs/exim-smarthost.nix - ../2configs/retiolum.nix - ]; - - networking = { - interfaces.enp2s1.ip4 = singleton { - address = let - addr = "45.62.237.203"; - in assert config.krebs.build.host.nets.internet.ip4.addr == addr; addr; - prefixLength = 24; - }; - defaultGateway = "45.62.237.1"; - nameservers = ["8.8.8.8"]; - }; - - environment.systemPackages = with pkgs; [ - iftop - iotop - iptables - nethogs - tcpdump - ]; -} diff --git a/tv/1systems/cd/config.nix b/tv/1systems/cd/config.nix new file mode 100644 index 000000000..f78bcafeb --- /dev/null +++ b/tv/1systems/cd/config.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +with import ; + +{ + krebs.build.host = config.krebs.hosts.cd; + + imports = [ + + + + + + ]; + + networking = { + interfaces.enp2s1.ip4 = singleton { + address = let + addr = "45.62.237.203"; + in assert config.krebs.build.host.nets.internet.ip4.addr == addr; addr; + prefixLength = 24; + }; + defaultGateway = "45.62.237.1"; + nameservers = ["8.8.8.8"]; + }; + + environment.systemPackages = with pkgs; [ + iftop + iotop + iptables + nethogs + tcpdump + ]; +} diff --git a/tv/1systems/cd/source.nix b/tv/1systems/cd/source.nix new file mode 100644 index 000000000..019e8bc22 --- /dev/null +++ b/tv/1systems/cd/source.nix @@ -0,0 +1,3 @@ +import { + name = "cd"; +} diff --git a/tv/1systems/mu.nix b/tv/1systems/mu.nix deleted file mode 100644 index 3f3b2c2f4..000000000 --- a/tv/1systems/mu.nix +++ /dev/null @@ -1,160 +0,0 @@ -{ config, pkgs, ... }: - -with import ; - -{ - imports = [ - ../../krebs - ../2configs - ../3modules - ../2configs/exim-retiolum.nix - ../2configs/retiolum.nix - ]; - - krebs.build.host = config.krebs.hosts.mu; - krebs.build.user = mkForce config.krebs.users.vv; - - services.udev.extraRules = '' - SUBSYSTEM=="net", ATTR{address}=="00:90:f5:da:aa:c3", NAME="en0" - SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:1b:ae:6c", NAME="wl0" - - # for jack - KERNEL=="rtc0", GROUP="audio" - KERNEL=="hpet", GROUP="audio" - ''; - - - # hardware configuration - boot.initrd.luks.devices = [ - { name = "vgmu1"; device = "/dev/sda2"; } - ]; - boot.initrd.luks.cryptoModules = [ "aes" "sha512" "xts" ]; - boot.initrd.availableKernelModules = [ "ahci" ]; - boot.kernelModules = [ "fbcon" "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - boot.extraModprobeConfig = '' - options kvm_intel nested=1 - ''; - - fileSystems = { - "/" = { - device = "/dev/vgmu1/nixroot"; - fsType = "ext4"; - options = [ "defaults" "noatime" ]; - }; - "/home" = { - device = "/dev/vgmu1/home"; - options = [ "defaults" "noatime" ]; - }; - "/boot" = { - device = "/dev/sda1"; - }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = [ "nosuid" "nodev" "noatime" ]; - }; - }; - - swapDevices =[ ]; - - nixpkgs.config.allowUnfree = true; - hardware.opengl.driSupport32Bit = true; - - hardware.pulseaudio.enable = true; - - hardware.enableAllFirmware = true; - - boot.loader.gummiboot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.networkmanager.enable = true; - - environment.systemPackages = with pkgs; [ - slock - tinc_pre - iptables - vim - gimp - xsane - firefoxWrapper - chromium - skype - libreoffice - pidgin-with-plugins - pidginotr - - #foomatic_filters - #gutenprint - #cups_pdf_filter - #ghostscript - ]; - - - i18n.defaultLocale = "de_DE.UTF-8"; - - programs.ssh.startAgent = false; - - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - slock.source = "${pkgs.slock}/bin/slock"; - }; - - security.pam.loginLimits = [ - # for jack - { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; } - { domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; } - ]; - - fonts.fonts = [ - pkgs.xlibs.fontschumachermisc - ]; - - # Enable CUPS to print documents. - services.printing = { - enable = true; - #drivers = [ - # #pkgs.foomatic_filters - # #pkgs.gutenprint - # #pkgs.cups_pdf_filter - # #pkgs.ghostscript - #]; - #cupsdConf = '' - # LogLevel debug2 - #''; - }; - - services.xserver.enable = true; - services.xserver.layout = "de"; - services.xserver.xkbOptions = "eurosign:e"; - - # TODO this is host specific - services.xserver.synaptics = { - enable = true; - twoFingerScroll = true; - }; - - services.xserver.desktopManager.plasma5 = { - enable = true; - }; - services.xserver.displayManager.auto = { - enable = true; - user = "vv"; - }; - - users.users.vv = { - inherit (config.krebs.users.vv) home uid; - isNormalUser = true; - extraGroups = [ - "audio" - "video" - "networkmanager" - ]; - }; - - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; -} diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix new file mode 100644 index 000000000..239f333b5 --- /dev/null +++ b/tv/1systems/mu/config.nix @@ -0,0 +1,160 @@ +{ config, pkgs, ... }: + +with import ; + +{ + imports = [ + + + + + + ]; + + krebs.build.host = config.krebs.hosts.mu; + krebs.build.user = mkForce config.krebs.users.vv; + + services.udev.extraRules = '' + SUBSYSTEM=="net", ATTR{address}=="00:90:f5:da:aa:c3", NAME="en0" + SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:1b:ae:6c", NAME="wl0" + + # for jack + KERNEL=="rtc0", GROUP="audio" + KERNEL=="hpet", GROUP="audio" + ''; + + + # hardware configuration + boot.initrd.luks.devices = [ + { name = "vgmu1"; device = "/dev/sda2"; } + ]; + boot.initrd.luks.cryptoModules = [ "aes" "sha512" "xts" ]; + boot.initrd.availableKernelModules = [ "ahci" ]; + boot.kernelModules = [ "fbcon" "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + boot.extraModprobeConfig = '' + options kvm_intel nested=1 + ''; + + fileSystems = { + "/" = { + device = "/dev/vgmu1/nixroot"; + fsType = "ext4"; + options = [ "defaults" "noatime" ]; + }; + "/home" = { + device = "/dev/vgmu1/home"; + options = [ "defaults" "noatime" ]; + }; + "/boot" = { + device = "/dev/sda1"; + }; + "/tmp" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = [ "nosuid" "nodev" "noatime" ]; + }; + }; + + swapDevices =[ ]; + + nixpkgs.config.allowUnfree = true; + hardware.opengl.driSupport32Bit = true; + + hardware.pulseaudio.enable = true; + + hardware.enableAllFirmware = true; + + boot.loader.gummiboot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.networkmanager.enable = true; + + environment.systemPackages = with pkgs; [ + slock + tinc_pre + iptables + vim + gimp + xsane + firefoxWrapper + chromium + skype + libreoffice + pidgin-with-plugins + pidginotr + + #foomatic_filters + #gutenprint + #cups_pdf_filter + #ghostscript + ]; + + + i18n.defaultLocale = "de_DE.UTF-8"; + + programs.ssh.startAgent = false; + + security.wrappers = { + sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron + slock.source = "${pkgs.slock}/bin/slock"; + }; + + security.pam.loginLimits = [ + # for jack + { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; } + { domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; } + ]; + + fonts.fonts = [ + pkgs.xlibs.fontschumachermisc + ]; + + # Enable CUPS to print documents. + services.printing = { + enable = true; + #drivers = [ + # #pkgs.foomatic_filters + # #pkgs.gutenprint + # #pkgs.cups_pdf_filter + # #pkgs.ghostscript + #]; + #cupsdConf = '' + # LogLevel debug2 + #''; + }; + + services.xserver.enable = true; + services.xserver.layout = "de"; + services.xserver.xkbOptions = "eurosign:e"; + + # TODO this is host specific + services.xserver.synaptics = { + enable = true; + twoFingerScroll = true; + }; + + services.xserver.desktopManager.plasma5 = { + enable = true; + }; + services.xserver.displayManager.auto = { + enable = true; + user = "vv"; + }; + + users.users.vv = { + inherit (config.krebs.users.vv) home uid; + isNormalUser = true; + extraGroups = [ + "audio" + "video" + "networkmanager" + ]; + }; + + # see tmpfiles.d(5) + systemd.tmpfiles.rules = [ + "d /tmp 1777 root root - -" # does this work with mounted /tmp? + ]; +} diff --git a/tv/1systems/mu/source.nix b/tv/1systems/mu/source.nix new file mode 100644 index 000000000..7e148cf36 --- /dev/null +++ b/tv/1systems/mu/source.nix @@ -0,0 +1,3 @@ +import { + name = "mu"; +} diff --git a/tv/1systems/nomic.nix b/tv/1systems/nomic.nix deleted file mode 100644 index 9b9502254..000000000 --- a/tv/1systems/nomic.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import ; - -{ - krebs.build.host = config.krebs.hosts.nomic; - - imports = [ - ../. - ../2configs/hw/x220.nix - ../2configs/exim-retiolum.nix - ../2configs/gitrepos.nix - ../2configs/im.nix - ../2configs/mail-client.nix - ../2configs/nginx/public_html.nix - ../2configs/pulse.nix - ../2configs/retiolum.nix - ../2configs/xserver - ]; - - boot.initrd.luks = { - cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "luks1"; device = "/dev/sda2"; } - ]; - }; - - # Don't use UEFI because current disk was partitioned/formatted for AO753. - # TODO remove following bool.loader section after repartitioning/reformatting - boot.loader = { - grub = { - device = "/dev/sda"; - splashImage = null; - }; - systemd-boot.enable = mkForce false; - }; - - fileSystems."/" = - { device = "/dev/mapper/nomic1-root"; - fsType = "btrfs"; - }; - - fileSystems."/boot" = - { device = "/dev/sda1"; - fsType = "ext4"; - }; - - fileSystems."/home" = - { device = "/dev/mapper/nomic1-home"; - fsType = "btrfs"; - }; - - swapDevices = [ ]; - - # TODO base - boot.tmpOnTmpfs = true; - - environment.systemPackages = with pkgs; [ - (writeDashBin "play" '' - set -euf - mpv() { exec ${mpv}/bin/mpv "$@"; } - case $1 in - deepmix) mpv http://deepmix.ru/deepmix128.pls;; - groovesalad) mpv http://somafm.com/play/groovesalad;; - ntslive) mpv http://listen2.ntslive.co.uk/listen.pls;; - *) - echo "$0: bad argument: $*" >&2 - exit 23 - esac - '') - gnupg - tmux - ]; -} diff --git a/tv/1systems/nomic/config.nix b/tv/1systems/nomic/config.nix new file mode 100644 index 000000000..d0144986b --- /dev/null +++ b/tv/1systems/nomic/config.nix @@ -0,0 +1,74 @@ +{ config, lib, pkgs, ... }: + +with import ; + +{ + krebs.build.host = config.krebs.hosts.nomic; + + imports = [ + + + + + + + + + + + ]; + + boot.initrd.luks = { + cryptoModules = [ "aes" "sha512" "xts" ]; + devices = [ + { name = "luks1"; device = "/dev/sda2"; } + ]; + }; + + # Don't use UEFI because current disk was partitioned/formatted for AO753. + # TODO remove following bool.loader section after repartitioning/reformatting + boot.loader = { + grub = { + device = "/dev/sda"; + splashImage = null; + }; + systemd-boot.enable = mkForce false; + }; + + fileSystems."/" = + { device = "/dev/mapper/nomic1-root"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = + { device = "/dev/sda1"; + fsType = "ext4"; + }; + + fileSystems."/home" = + { device = "/dev/mapper/nomic1-home"; + fsType = "btrfs"; + }; + + swapDevices = [ ]; + + # TODO base + boot.tmpOnTmpfs = true; + + environment.systemPackages = with pkgs; [ + (writeDashBin "play" '' + set -euf + mpv() { exec ${mpv}/bin/mpv "$@"; } + case $1 in + deepmix) mpv http://deepmix.ru/deepmix128.pls;; + groovesalad) mpv http://somafm.com/play/groovesalad;; + ntslive) mpv http://listen2.ntslive.co.uk/listen.pls;; + *) + echo "$0: bad argument: $*" >&2 + exit 23 + esac + '') + gnupg + tmux + ]; +} diff --git a/tv/1systems/nomic/source.nix b/tv/1systems/nomic/source.nix new file mode 100644 index 000000000..f173b65a6 --- /dev/null +++ b/tv/1systems/nomic/source.nix @@ -0,0 +1,4 @@ +import { + name = "nomic"; + secure = true; +} diff --git a/tv/1systems/test/source.nix b/tv/1systems/test/source.nix new file mode 100644 index 000000000..f756b8586 --- /dev/null +++ b/tv/1systems/test/source.nix @@ -0,0 +1,3 @@ +import { + name = "test"; +} diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix deleted file mode 100644 index 4b3bf8538..000000000 --- a/tv/1systems/wu.nix +++ /dev/null @@ -1,174 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import ; - -{ - krebs.build.host = config.krebs.hosts.wu; - - imports = [ - ../. - ../2configs/hw/w110er.nix - ../2configs/exim-retiolum.nix - ../2configs/gitrepos.nix - ../2configs/im.nix - ../2configs/mail-client.nix - ../2configs/man.nix - ../2configs/nginx/public_html.nix - ../2configs/pulse.nix - ../2configs/retiolum.nix - ../2configs/xserver - { - environment.systemPackages = with pkgs; [ - # root - cryptsetup - - # tv - bc - bind # dig - cac-api - dic - file - get - gnupg1compat - haskellPackages.hledger - jq - mkpasswd - netcat - nix-repl - nmap - p7zip - push - qrencode - tmux - - #ack - #apache-httpd - #ascii - #emacs - #es - #esniper - #gcc - #gptfdisk - #graphviz - #haskellPackages.cabal2nix - #haskellPackages.ghc - #haskellPackages.shake - #hdparm - #i7z - #iftop - #imagemagick - #inotifyTools - #iodine - #iotop - #lshw - #lsof - #minicom - #mtools - #ncmpc - #neovim - #nethogs - #nix-prefetch-scripts #cvs bug - #openssl - #openswan - #parted - #perl - #powertop - #ppp - #proot - #pythonPackages.arandr - #pythonPackages.youtube-dl - #racket - #rxvt_unicode-with-plugins - #scrot - #sec - #silver-searcher - #sloccount - #smartmontools - #socat - #sshpass - #strongswan - #sysdig - #sysstat - #tcpdump - #tlsdate - #unetbootin - #utillinuxCurses - #wvdial - #xdotool - #xkill - #xl2tpd - #xsel - - unison - ]; - } - ]; - - boot.initrd.luks = { - cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "wuca"; device = "/dev/sda2"; } - ]; - }; - - fileSystems = { - "/" = { - device = "/dev/mapper/wuvga-root"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/bku" = { - device = "/dev/mapper/wuvga-bku"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/home" = { - device = "/dev/mapper/wuvga-home"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/boot" = { - device = "/dev/sda1"; - }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = ["nosuid" "nodev" "noatime"]; - }; - }; - - krebs.nixpkgs.allowUnfreePredicate = pkg: hasPrefix "nvidia-x11-" pkg.name; - hardware.bumblebee.enable = true; - hardware.bumblebee.group = "video"; - hardware.enableAllFirmware = true; - hardware.opengl.driSupport32Bit = true; - - environment.systemPackages = with pkgs; [ - ethtool - tinc_pre - iptables - #jack2 - ]; - - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - }; - - services.printing.enable = true; - - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; - - services.udev.extraRules = '' - SUBSYSTEM=="net", ATTR{address}=="00:90:f5:da:aa:c3", NAME="en0" - SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:1b:ae:6c", NAME="wl0" - - # for jack - KERNEL=="rtc0", GROUP="audio" - KERNEL=="hpet", GROUP="audio" - ''; - - virtualisation.virtualbox.host.enable = true; -} diff --git a/tv/1systems/wu/config.nix b/tv/1systems/wu/config.nix new file mode 100644 index 000000000..5b2542acd --- /dev/null +++ b/tv/1systems/wu/config.nix @@ -0,0 +1,174 @@ +{ config, lib, pkgs, ... }: + +with import ; + +{ + krebs.build.host = config.krebs.hosts.wu; + + imports = [ + + + + + + + + + + + + { + environment.systemPackages = with pkgs; [ + # root + cryptsetup + + # tv + bc + bind # dig + cac-api + dic + file + get + gnupg1compat + haskellPackages.hledger + jq + mkpasswd + netcat + nix-repl + nmap + p7zip + push + qrencode + tmux + + #ack + #apache-httpd + #ascii + #emacs + #es + #esniper + #gcc + #gptfdisk + #graphviz + #haskellPackages.cabal2nix + #haskellPackages.ghc + #haskellPackages.shake + #hdparm + #i7z + #iftop + #imagemagick + #inotifyTools + #iodine + #iotop + #lshw + #lsof + #minicom + #mtools + #ncmpc + #neovim + #nethogs + #nix-prefetch-scripts #cvs bug + #openssl + #openswan + #parted + #perl + #powertop + #ppp + #proot + #pythonPackages.arandr + #pythonPackages.youtube-dl + #racket + #rxvt_unicode-with-plugins + #scrot + #sec + #silver-searcher + #sloccount + #smartmontools + #socat + #sshpass + #strongswan + #sysdig + #sysstat + #tcpdump + #tlsdate + #unetbootin + #utillinuxCurses + #wvdial + #xdotool + #xkill + #xl2tpd + #xsel + + unison + ]; + } + ]; + + boot.initrd.luks = { + cryptoModules = [ "aes" "sha512" "xts" ]; + devices = [ + { name = "wuca"; device = "/dev/sda2"; } + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/mapper/wuvga-root"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/bku" = { + device = "/dev/mapper/wuvga-bku"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/home" = { + device = "/dev/mapper/wuvga-home"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/boot" = { + device = "/dev/sda1"; + }; + "/tmp" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = ["nosuid" "nodev" "noatime"]; + }; + }; + + krebs.nixpkgs.allowUnfreePredicate = pkg: hasPrefix "nvidia-x11-" pkg.name; + hardware.bumblebee.enable = true; + hardware.bumblebee.group = "video"; + hardware.enableAllFirmware = true; + hardware.opengl.driSupport32Bit = true; + + environment.systemPackages = with pkgs; [ + ethtool + tinc_pre + iptables + #jack2 + ]; + + security.wrappers = { + sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron + }; + + services.printing.enable = true; + + # see tmpfiles.d(5) + systemd.tmpfiles.rules = [ + "d /tmp 1777 root root - -" # does this work with mounted /tmp? + ]; + + services.udev.extraRules = '' + SUBSYSTEM=="net", ATTR{address}=="00:90:f5:da:aa:c3", NAME="en0" + SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:1b:ae:6c", NAME="wl0" + + # for jack + KERNEL=="rtc0", GROUP="audio" + KERNEL=="hpet", GROUP="audio" + ''; + + virtualisation.virtualbox.host.enable = true; +} diff --git a/tv/1systems/wu/source.nix b/tv/1systems/wu/source.nix new file mode 100644 index 000000000..2e9cdeb8a --- /dev/null +++ b/tv/1systems/wu/source.nix @@ -0,0 +1,4 @@ +import { + name = "wu"; + secure = true; +} diff --git a/tv/1systems/xu.nix b/tv/1systems/xu.nix deleted file mode 100644 index d82f45ac0..000000000 --- a/tv/1systems/xu.nix +++ /dev/null @@ -1,174 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import ; - -{ - krebs.build.host = config.krebs.hosts.xu; - - imports = [ - ../. - ../2configs/hw/x220.nix - ../2configs/exim-retiolum.nix - ../2configs/gitconfig.nix - ../2configs/gitrepos.nix - ../2configs/mail-client.nix - ../2configs/man.nix - ../2configs/nginx/public_html.nix - ../2configs/pulse.nix - ../2configs/retiolum.nix - ../2configs/binary-cache - ../2configs/xserver - { - environment.systemPackages = with pkgs; [ - - - # root - cryptsetup - - # tv - bc - bind # dig - brain - cac-api - dic - file - gnupg1compat - haskellPackages.hledger - jq - krebszones - mkpasswd - netcat - netcup - nix-repl - nmap - p7zip - pass - q - qrencode - texlive.combined.scheme-full - tmux - - #ack - #apache-httpd - #ascii - #emacs - #es - #esniper - #gcc - #gptfdisk - #graphviz - #haskellPackages.cabal2nix - #haskellPackages.ghc - #haskellPackages.shake - #hdparm - #i7z - #iftop - #imagemagick - #inotifyTools - #iodine - #iotop - #lshw - #lsof - #minicom - #mtools - #ncmpc - #nethogs - #nix-prefetch-scripts #cvs bug - #openssl - #openswan - #parted - #perl - #powertop - #ppp - #proot - #pythonPackages.arandr - #pythonPackages.youtube-dl - #racket - #rxvt_unicode-with-plugins - #scrot - #sec - #silver-searcher - #sloccount - #smartmontools - #socat - #sshpass - #strongswan - #sysdig - #sysstat - #tcpdump - #tlsdate - #unetbootin - #utillinuxCurses - #wvdial - #xdotool - #xkill - #xl2tpd - #xsel - - unison - ]; - } - ]; - - boot.initrd.luks = { - cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "xuca"; device = "/dev/sda2"; } - ]; - }; - - fileSystems = { - "/" = { - device = "/dev/mapper/xuvga-root"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/bku" = { - device = "/dev/mapper/xuvga-bku"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/home" = { - device = "/dev/mapper/xuvga-home"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/boot" = { - device = "/dev/sda1"; - }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = ["nosuid" "nodev" "noatime"]; - }; - }; - - environment.systemPackages = with pkgs; [ - ethtool - tinc_pre - iptables - #jack2 - - gptfdisk - ]; - - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - }; - - services.printing.enable = true; - - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; - - #services.bitlbee.enable = true; - #services.tor.client.enable = true; - #services.tor.enable = true; - #services.virtualboxHost.enable = true; - - - # The NixOS release to be compatible with for stateful data such as databases. - system.stateVersion = "15.09"; -} diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix new file mode 100644 index 000000000..2bffdddb3 --- /dev/null +++ b/tv/1systems/xu/config.nix @@ -0,0 +1,174 @@ +{ config, lib, pkgs, ... }: + +with import ; + +{ + krebs.build.host = config.krebs.hosts.xu; + + imports = [ + + + + + + + + + + + + + { + environment.systemPackages = with pkgs; [ + + + # root + cryptsetup + + # tv + bc + bind # dig + brain + cac-api + dic + file + gnupg1compat + haskellPackages.hledger + jq + krebszones + mkpasswd + netcat + netcup + nix-repl + nmap + p7zip + pass + q + qrencode + texlive.combined.scheme-full + tmux + + #ack + #apache-httpd + #ascii + #emacs + #es + #esniper + #gcc + #gptfdisk + #graphviz + #haskellPackages.cabal2nix + #haskellPackages.ghc + #haskellPackages.shake + #hdparm + #i7z + #iftop + #imagemagick + #inotifyTools + #iodine + #iotop + #lshw + #lsof + #minicom + #mtools + #ncmpc + #nethogs + #nix-prefetch-scripts #cvs bug + #openssl + #openswan + #parted + #perl + #powertop + #ppp + #proot + #pythonPackages.arandr + #pythonPackages.youtube-dl + #racket + #rxvt_unicode-with-plugins + #scrot + #sec + #silver-searcher + #sloccount + #smartmontools + #socat + #sshpass + #strongswan + #sysdig + #sysstat + #tcpdump + #tlsdate + #unetbootin + #utillinuxCurses + #wvdial + #xdotool + #xkill + #xl2tpd + #xsel + + unison + ]; + } + ]; + + boot.initrd.luks = { + cryptoModules = [ "aes" "sha512" "xts" ]; + devices = [ + { name = "xuca"; device = "/dev/sda2"; } + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/mapper/xuvga-root"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/bku" = { + device = "/dev/mapper/xuvga-bku"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/home" = { + device = "/dev/mapper/xuvga-home"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/boot" = { + device = "/dev/sda1"; + }; + "/tmp" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = ["nosuid" "nodev" "noatime"]; + }; + }; + + environment.systemPackages = with pkgs; [ + ethtool + tinc_pre + iptables + #jack2 + + gptfdisk + ]; + + security.wrappers = { + sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron + }; + + services.printing.enable = true; + + # see tmpfiles.d(5) + systemd.tmpfiles.rules = [ + "d /tmp 1777 root root - -" # does this work with mounted /tmp? + ]; + + #services.bitlbee.enable = true; + #services.tor.client.enable = true; + #services.tor.enable = true; + #services.virtualboxHost.enable = true; + + + # The NixOS release to be compatible with for stateful data such as databases. + system.stateVersion = "15.09"; +} diff --git a/tv/1systems/xu/source.nix b/tv/1systems/xu/source.nix new file mode 100644 index 000000000..46e1aee90 --- /dev/null +++ b/tv/1systems/xu/source.nix @@ -0,0 +1,4 @@ +import { + name = "xu"; + secure = true; +} diff --git a/tv/1systems/zu.nix b/tv/1systems/zu.nix deleted file mode 100644 index 4fae3ca75..000000000 --- a/tv/1systems/zu.nix +++ /dev/null @@ -1,170 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import ; - -{ - krebs.build.host = config.krebs.hosts.zu; - - imports = [ - { - options.tv.test.sercret-file = mkOption { - type = types.secret-file; - default = {}; - }; - } - ../. - ../2configs/hw/x220.nix - ../2configs/exim-retiolum.nix - ../2configs/gitrepos.nix - ../2configs/mail-client.nix - ../2configs/man.nix - ../2configs/nginx/public_html.nix - ../2configs/pulse.nix - ../2configs/retiolum.nix - ../2configs/xserver - { - environment.systemPackages = with pkgs; [ - - # root - cryptsetup - - # tv - bc - bind # dig - cac-api - dic - file - gnupg1compat - haskellPackages.hledger - jq - mkpasswd - netcat - nix-repl - nmap - p7zip - pass - q - qrencode - # XXX fails at systemd.services.dbus.unitConfig - #texlive - tmux - - #ack - #apache-httpd - #ascii - #emacs - #es - #esniper - #gcc - #gptfdisk - #graphviz - #haskellPackages.cabal2nix - #haskellPackages.ghc - #haskellPackages.shake - #hdparm - #i7z - #iftop - #imagemagick - #inotifyTools - #iodine - #iotop - #lshw - #lsof - #minicom - #mtools - #ncmpc - #nethogs - #nix-prefetch-scripts #cvs bug - #openssl - #openswan - #parted - #perl - #powertop - #ppp - #proot - #pythonPackages.arandr - #pythonPackages.youtube-dl - #racket - #rxvt_unicode-with-plugins - #scrot - #sec - #silver-searcher - #sloccount - #smartmontools - #socat - #sshpass - #strongswan - #sysdig - #sysstat - #tcpdump - #tlsdate - #unetbootin - #utillinuxCurses - #wvdial - #xdotool - #xkill - #xl2tpd - #xsel - - unison - ]; - } - ]; - - boot.initrd.luks = { - cryptoModules = [ "aes" "sha512" "xts" ]; - devices = [ - { name = "zuca"; device = "/dev/sda2"; } - ]; - }; - - fileSystems = { - "/" = { - device = "/dev/mapper/zuvga-root"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/home" = { - device = "/dev/mapper/zuvga-home"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/boot" = { - device = "/dev/sda1"; - }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = ["nosuid" "nodev" "noatime"]; - }; - }; - - environment.systemPackages = with pkgs; [ - ethtool - tinc_pre - iptables - #jack2 - - gptfdisk - ]; - - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - }; - - services.printing.enable = true; - - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; - - #services.bitlbee.enable = true; - #services.tor.client.enable = true; - #services.tor.enable = true; - #services.virtualboxHost.enable = true; - - - # The NixOS release to be compatible with for stateful data such as databases. - system.stateVersion = "15.09"; -} diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix new file mode 100644 index 000000000..d2aab8c51 --- /dev/null +++ b/tv/1systems/zu/config.nix @@ -0,0 +1,170 @@ +{ config, lib, pkgs, ... }: + +with import ; + +{ + krebs.build.host = config.krebs.hosts.zu; + + imports = [ + { + options.tv.test.sercret-file = mkOption { + type = types.secret-file; + default = {}; + }; + } + + + + + + + + + + + { + environment.systemPackages = with pkgs; [ + + # root + cryptsetup + + # tv + bc + bind # dig + cac-api + dic + file + gnupg1compat + haskellPackages.hledger + jq + mkpasswd + netcat + nix-repl + nmap + p7zip + pass + q + qrencode + # XXX fails at systemd.services.dbus.unitConfig + #texlive + tmux + + #ack + #apache-httpd + #ascii + #emacs + #es + #esniper + #gcc + #gptfdisk + #graphviz + #haskellPackages.cabal2nix + #haskellPackages.ghc + #haskellPackages.shake + #hdparm + #i7z + #iftop + #imagemagick + #inotifyTools + #iodine + #iotop + #lshw + #lsof + #minicom + #mtools + #ncmpc + #nethogs + #nix-prefetch-scripts #cvs bug + #openssl + #openswan + #parted + #perl + #powertop + #ppp + #proot + #pythonPackages.arandr + #pythonPackages.youtube-dl + #racket + #rxvt_unicode-with-plugins + #scrot + #sec + #silver-searcher + #sloccount + #smartmontools + #socat + #sshpass + #strongswan + #sysdig + #sysstat + #tcpdump + #tlsdate + #unetbootin + #utillinuxCurses + #wvdial + #xdotool + #xkill + #xl2tpd + #xsel + + unison + ]; + } + ]; + + boot.initrd.luks = { + cryptoModules = [ "aes" "sha512" "xts" ]; + devices = [ + { name = "zuca"; device = "/dev/sda2"; } + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/mapper/zuvga-root"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/home" = { + device = "/dev/mapper/zuvga-home"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; + "/boot" = { + device = "/dev/sda1"; + }; + "/tmp" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = ["nosuid" "nodev" "noatime"]; + }; + }; + + environment.systemPackages = with pkgs; [ + ethtool + tinc_pre + iptables + #jack2 + + gptfdisk + ]; + + security.wrappers = { + sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron + }; + + services.printing.enable = true; + + # see tmpfiles.d(5) + systemd.tmpfiles.rules = [ + "d /tmp 1777 root root - -" # does this work with mounted /tmp? + ]; + + #services.bitlbee.enable = true; + #services.tor.client.enable = true; + #services.tor.enable = true; + #services.virtualboxHost.enable = true; + + + # The NixOS release to be compatible with for stateful data such as databases. + system.stateVersion = "15.09"; +} diff --git a/tv/1systems/zu/source.nix b/tv/1systems/zu/source.nix new file mode 100644 index 000000000..7a5c4f523 --- /dev/null +++ b/tv/1systems/zu/source.nix @@ -0,0 +1,4 @@ +import { + name = "zu"; + secure = true; +} diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index 3d95d6dee..07496fd1f 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -6,23 +6,7 @@ with import ; in { krebs.enable = true; - krebs.build = { - user = config.krebs.users.tv; - source = let inherit (config.krebs.build) host; in { - nixos-config.symlink = "stockholm/tv/1systems/${host.name}.nix"; - secrets.file = getAttr builder { - buildbot = toString ; - tv = "/home/tv/secrets/${host.name}"; - }; - secrets-common.file = "/home/tv/secrets/common"; - nixpkgs.git = { - url = https://github.com/NixOS/nixpkgs; - ref = "057f89b9344e5341796046f25ae4f269be6d4529"; # nixos-17.03 - }; - } // optionalAttrs host.secure { - secrets-master.file = "/home/tv/secrets/master"; - }; - }; + krebs.build.user = config.krebs.users.tv; networking.hostName = config.krebs.build.host.name; diff --git a/tv/source.nix b/tv/source.nix new file mode 100644 index 000000000..7306cd954 --- /dev/null +++ b/tv/source.nix @@ -0,0 +1,22 @@ +with import ; +host@{ name, secure ? false }: let + builder = if getEnv "dummy_secrets" == "true" + then "buildbot" + else "tv"; + _file = + "/tv/1systems/${name}/source.nix"; +in + evalSource (toString _file) { + nixos-config.symlink = "stockholm/tv/1systems/${name}/config.nix"; + secrets.file = getAttr builder { + buildbot = toString ; + tv = "/home/tv/secrets/${name}"; + }; + stockholm.file = toString ; + secrets-common.file = "/home/tv/secrets/common"; + nixpkgs.git = { + url = https://github.com/NixOS/nixpkgs; + ref = "1b57bf274ae5c76e91b2b264d8aa8bfcecb72102"; # nixos-17.03 + }; + } // optionalAttrs secure { + secrets-master.file = "/home/tv/secrets/master"; + } -- cgit v1.2.3 From 8fc6574c63d5727ef36292f24297bb291b9b4f06 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Jul 2017 16:56:14 +0200 Subject: whatsupnix: exit != 0 on Nix errors --- krebs/5pkgs/simple/whatsupnix/whatsupnix.bash | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash b/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash index 2ad9aadc9..e21e0f1b3 100644 --- a/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash +++ b/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash @@ -14,15 +14,30 @@ # # 1 Usage error; arguments couldn't be parsed. # -# 2 Build error; at least one failed derivation could be found. +# 2 Nix error; input looks like Nix failed. +# +# 3 Build error; at least one failed derivation could be found. # -failed_drvs=$(mktemp --tmpdir whatsupnix.XXXXXXXX) -trap 'rm -f -- "$failed_drvs"' EXIT +tmpdir=$(mktemp -d --tmpdir whatsupnix.XXXXXXXX) +failed_drvs=$tmpdir/failed_drvs; touch "$failed_drvs" +nix_errors=$tmpdir/nix_errors; touch "$nix_errors" +cleanup() { + rm "$failed_drvs" + rm "$nix_errors" + rmdir "$tmpdir" +} +trap cleanup EXIT exec >&2 -gawk -v failed_drvs="$failed_drvs" ' +gawk \ + -v failed_drvs="$failed_drvs" \ + -v nix_errors="$nix_errors" \ +' + /^(\033\[31;1m)?error:/ { + print $0 >> nix_errors + } match($0, /^builder for ‘(\/nix\/store\/[^’]+\.drv)’ failed/, m) { print m[1] >> failed_drvs } @@ -73,8 +88,10 @@ while read -r drv; do echo done < "$failed_drvs" -if test -s "$failed_drvs"; then +if test -s "$nix_errors"; then exit 2 +elif test -s "$failed_drvs"; then + exit 3 else exit 0 fi -- cgit v1.2.3 From cc4b146ff6c2a05cd7a96f2121335de904591465 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Jul 2017 17:25:23 +0200 Subject: tv x220: enable{All => Redistributable}Firmware --- tv/2configs/hw/x220.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/2configs/hw/x220.nix b/tv/2configs/hw/x220.nix index 6cc295dc5..e0a04e214 100644 --- a/tv/2configs/hw/x220.nix +++ b/tv/2configs/hw/x220.nix @@ -11,7 +11,7 @@ networking.wireless.enable = true; # Required for Centrino. - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; hardware.opengl.extraPackages = [ pkgs.vaapiIntel pkgs.vaapiVdpau ]; -- cgit v1.2.3 From eb4a9b17627b2eadb4cabc9758d1cd7815dc53ec Mon Sep 17 00:00:00 2001 From: nin Date: Tue, 27 Jun 2017 17:38:23 +0200 Subject: nin nixpkgs: 0afb6d7 -> 6916f24 --- nin/2configs/nixpkgs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nin/2configs/nixpkgs.nix b/nin/2configs/nixpkgs.nix index 14ddb7920..4c6f5189b 100644 --- a/nin/2configs/nixpkgs.nix +++ b/nin/2configs/nixpkgs.nix @@ -3,6 +3,6 @@ { krebs.build.source.nixpkgs.git = { url = https://github.com/nixos/nixpkgs; - ref = "0afb6d7"; + ref = "6916f24"; }; } -- cgit v1.2.3 From 8cc4a36b42eeff734b58a91164f6cabc5c55db38 Mon Sep 17 00:00:00 2001 From: nin Date: Tue, 4 Jul 2017 22:41:16 +0200 Subject: nin nixpkgs 6916f24 -> 01c3847 --- nin/2configs/nixpkgs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nin/2configs/nixpkgs.nix b/nin/2configs/nixpkgs.nix index 4c6f5189b..c46331b0d 100644 --- a/nin/2configs/nixpkgs.nix +++ b/nin/2configs/nixpkgs.nix @@ -3,6 +3,6 @@ { krebs.build.source.nixpkgs.git = { url = https://github.com/nixos/nixpkgs; - ref = "6916f24"; + ref = "01c3847"; }; } -- cgit v1.2.3 From 070d282df215eb891f298ef2e3c147a78e139119 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 10 Jul 2017 10:25:35 +0200 Subject: l nixpkgs: 2e983f1 -> d72efac --- lass/2configs/nixpkgs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/2configs/nixpkgs.nix b/lass/2configs/nixpkgs.nix index 151242e45..f5a3bbf88 100644 --- a/lass/2configs/nixpkgs.nix +++ b/lass/2configs/nixpkgs.nix @@ -3,6 +3,6 @@ { krebs.build.source.nixpkgs.git = { url = https://cgit.lassul.us/nixpkgs; - ref = "2e983f1"; + ref = "d72efac"; }; } -- cgit v1.2.3 From a543ef02ce6f2565823d56ae3bfed4794db15392 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 10 Jul 2017 19:49:14 +0200 Subject: l wine: add user to video group --- lass/2configs/wine.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lass/2configs/wine.nix b/lass/2configs/wine.nix index ee688e18c..d4a91e645 100644 --- a/lass/2configs/wine.nix +++ b/lass/2configs/wine.nix @@ -13,7 +13,10 @@ in { description = "user for running wine"; home = "/home/wine"; useDefaultShell = true; - extraGroups = [ "audio" ]; + extraGroups = [ + "audio" + "video" + ]; createHome = true; }; }; -- cgit v1.2.3 From 2ff81c4a0d81e8387925dfcc66685e7206c131cf Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 11 Jul 2017 00:07:22 +0200 Subject: l mail: use reverse_names --- lass/2configs/mail.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index e39c09b84..9a3c4e829 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -43,10 +43,14 @@ let set nm_record = yes set nm_record_tags = "-inbox me archive" set virtual_spoolfile=yes # enable virtual folders - set sendmail="${msmtp}/bin/msmtp" # enables parsing of outgoing mail + + + set sendmail="${msmtp}/bin/msmtp" # enables parsing of outgoing mail set from="lassulus@lassul.us" + alternates ^.*@lassul\.us$ ^.*@.*\.r$ set use_from=yes set envelope_from=yes + set reverse_name set sort=threads -- cgit v1.2.3 From 9215b5b6880c833721caa7572b7480c7912d7fd6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 11 Jul 2017 00:08:05 +0200 Subject: l mail: show recipent in mutt index --- lass/2configs/mail.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index 9a3c4e829..6555b1b45 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -54,7 +54,15 @@ let set sort=threads - set index_format="%4C %Z %?GI?%GI& ? %[%d/%b] %-16.15F %?M?(%3M)& ? %s %> %?g?%g?" + set index_format="${pkgs.writeDash "mutt-index" '' + # http://www.mutt.org/doc/manual/#formatstrings + recipent="$(echo $1 | sed 's/.*<\([^>]*\).*/\1/')" + # output to mutt + # V + echo "%4C %Z %?GI?%GI& ? %[%d/%b] %-20.20a %?M?(%3M)& ? %s %> $recipent %?g?%g?%" + # args to mutt-index dash script + # V + ''} %r |" virtual-mailboxes \ "INBOX" "notmuch://?query=tag:inbox and NOT tag:killed"\ -- cgit v1.2.3 From 3363a8746c9152709abcd5adbbcdc00c2df0ff39 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 11 Jul 2017 11:26:24 +0200 Subject: move source config from module system to 1systems/*/source.nix --- lass/1systems/cloudkrebs.nix | 35 --- lass/1systems/cloudkrebs/config.nix | 34 +++ lass/1systems/cloudkrebs/source.nix | 3 + lass/1systems/dishfire.nix | 97 ------- lass/1systems/dishfire/config.nix | 96 +++++++ lass/1systems/dishfire/source.nix | 3 + lass/1systems/echelon.nix | 70 ----- lass/1systems/echelon/config.nix | 65 +++++ lass/1systems/echelon/source.nix | 3 + lass/1systems/icarus.nix | 61 ----- lass/1systems/icarus/config.nix | 60 +++++ lass/1systems/icarus/source.nix | 4 + lass/1systems/iso.nix | 11 +- lass/1systems/mors.nix | 195 -------------- lass/1systems/mors/config.nix | 194 ++++++++++++++ lass/1systems/mors/source.nix | 4 + lass/1systems/prism.nix | 296 ---------------------- lass/1systems/prism/config.nix | 292 +++++++++++++++++++++ lass/1systems/prism/source.nix | 3 + lass/1systems/shodan.nix | 108 -------- lass/1systems/shodan/config.nix | 108 ++++++++ lass/1systems/shodan/source.nix | 3 + lass/1systems/uriel.nix | 100 -------- lass/1systems/uriel/config.nix | 100 ++++++++ lass/1systems/uriel/source.nix | 3 + lass/2configs/default.nix | 12 +- lass/2configs/nixpkgs.nix | 8 - lass/source.nix | 24 ++ shared/1systems/test-all-krebs-modules.nix | 54 ---- shared/1systems/test-all-krebs-modules/config.nix | 54 ++++ shared/1systems/test-all-krebs-modules/source.nix | 3 + shared/1systems/test-arch.nix | 32 --- shared/1systems/test-arch/config.nix | 32 +++ shared/1systems/test-arch/source.nix | 3 + shared/1systems/test-centos6.nix | 30 --- shared/1systems/test-centos6/config.nix | 30 +++ shared/1systems/test-centos6/source.nix | 3 + shared/1systems/test-centos7.nix | 16 -- shared/1systems/test-centos7/config.nix | 16 ++ shared/1systems/test-centos7/source.nix | 3 + shared/1systems/test-failing.nix | 9 - shared/1systems/test-failing/config.nix | 9 + shared/1systems/test-failing/source.nix | 3 + shared/1systems/test-minimal-deploy.nix | 16 -- shared/1systems/test-minimal-deploy/config.nix | 16 ++ shared/1systems/test-minimal-deploy/source.nix | 3 + shared/1systems/wolf.nix | 106 -------- shared/1systems/wolf/config.nix | 107 ++++++++ shared/1systems/wolf/source.nix | 3 + shared/2configs/default.nix | 12 - shared/source.nix | 19 ++ 51 files changed, 1309 insertions(+), 1262 deletions(-) delete mode 100644 lass/1systems/cloudkrebs.nix create mode 100644 lass/1systems/cloudkrebs/config.nix create mode 100644 lass/1systems/cloudkrebs/source.nix delete mode 100644 lass/1systems/dishfire.nix create mode 100644 lass/1systems/dishfire/config.nix create mode 100644 lass/1systems/dishfire/source.nix delete mode 100644 lass/1systems/echelon.nix create mode 100644 lass/1systems/echelon/config.nix create mode 100644 lass/1systems/echelon/source.nix delete mode 100644 lass/1systems/icarus.nix create mode 100644 lass/1systems/icarus/config.nix create mode 100644 lass/1systems/icarus/source.nix delete mode 100644 lass/1systems/mors.nix