From 7f6d54c6cd86d37e328701b9398e68f2546b251e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 20 Apr 2020 14:21:48 +0800 Subject: [PATCH] upgrade to nixos 20.03 --- nixbld-etc-nixos/configuration.nix | 15 ++- .../matterbridge-disable-github.patch | 9 +- nixbld-etc-nixos/nixops-665.patch | 111 ------------------ nixops/nixops.nix | 10 +- 4 files changed, 14 insertions(+), 131 deletions(-) delete mode 100644 nixbld-etc-nixos/nixops-665.patch diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index 3fdbee9..38686c9 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -151,10 +151,10 @@ in }; # Select internationalisation properties. - i18n = { - consoleFont = "Lat2-Terminus16"; - consoleKeyMap = "de"; - defaultLocale = "en_US.UTF-8"; + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "de"; }; # Set your time zone. @@ -358,16 +358,13 @@ in nixpkgs.config.packageOverrides = super: let self = super.pkgs; in { firmwareLinuxNonfree = super.callPackage ./firmware-linux-nonfree.nix {}; - hydra = super.hydra.overrideAttrs(oa: { + hydra-migration = super.hydra-migration.overrideAttrs(oa: { patches = oa.patches or [] ++ [ ./hydra-conda.patch ./hydra-retry.patch ]; hydraPath = oa.hydraPath + ":" + super.lib.makeBinPath [ super.jq ]; }); matterbridge = super.matterbridge.overrideAttrs(oa: { patches = oa.patches or [] ++ [ ./matterbridge-disable-github.patch ]; }); - nixops = super.nixops.overrideAttrs(oa: { - patches = oa.patches or [] ++ [ ./nixops-665.patch ]; - }); # https://github.com/NixOS/nixpkgs/issues/70930 # perl 5.30 breaks plugins munin = super.munin.override { @@ -378,6 +375,8 @@ in }; }; + security.acme.acceptTerms = true; + security.acme.email = "sb" + "@m-labs.hk"; security.acme.certs = { "nixbld.m-labs.hk" = { webroot = "/var/lib/acme/acme-challenge"; diff --git a/nixbld-etc-nixos/matterbridge-disable-github.patch b/nixbld-etc-nixos/matterbridge-disable-github.patch index 7438005..dc659c2 100644 --- a/nixbld-etc-nixos/matterbridge-disable-github.patch +++ b/nixbld-etc-nixos/matterbridge-disable-github.patch @@ -1,7 +1,8 @@ -diff -Naur matterbridge-1.11.0.orig/bridge/mattermost/mattermost.go matterbridge-1.11.0/bridge/mattermost/mattermost.go ---- matterbridge-1.11.0.orig/bridge/mattermost/mattermost.go 2018-06-19 06:28:16.000000000 +0800 -+++ matterbridge-1.11.0/bridge/mattermost/mattermost.go 2019-04-26 20:40:11.831475087 +0800 -@@ -444,6 +444,10 @@ +diff --git a/bridge/mattermost/helpers.go b/bridge/mattermost/helpers.go +index 14b7469d..d9b77bdf 100644 +--- a/bridge/mattermost/helpers.go ++++ b/bridge/mattermost/helpers.go +@@ -206,6 +206,10 @@ func (b *Bmattermost) skipMessage(message *matterclient.Message) bool { return true } diff --git a/nixbld-etc-nixos/nixops-665.patch b/nixbld-etc-nixos/nixops-665.patch deleted file mode 100644 index e40299e..0000000 --- a/nixbld-etc-nixos/nixops-665.patch +++ /dev/null @@ -1,111 +0,0 @@ -From e2015bbfcbcf7594824755e39f838d7aab258b6e Mon Sep 17 00:00:00 2001 -From: Graham Christensen -Date: Sat, 13 May 2017 08:53:07 -0400 -Subject: [PATCH] Support multiple versions of nixpkgs in one network - -Having a machine named foo, described as: - - foo = { # ...snipped... - deployment.nix_path.nixpkgs = (builtins.filterSource - (path: type: type != "directory" || baseNameOf path != ".git") - ./../nixpkgs); - }); - -will have the custom nixpkgs set in the `NIX_PATH` as -`nixpkgs=path-to-custom-nixpkgs`. - -Note this does not work with foo = { config, ... }: {... machines, but -having a second nix file in the network would work, and also: - - let - canary = machine: { - deployment.nix_path.nixpkgs = (builtins.filterSource - (path: type: type != "directory" || baseNameOf path != ".git") - ./../nixpkgs); - imports = [machine]; - }; - - machine = { ... }: { - # your machine config - }; - in { - machineA = machine; - machineB = canary machine; - } - -Note that because this uses scopedImport, the nixops network and -machines may use `import ` and have a consistent view of -nixpkgs. ---- - nix/eval-machine-info.nix | 35 ++++++++++++++++++++++++++++++++--- - nix/options.nix | 7 +++++++ - 2 files changed, 39 insertions(+), 3 deletions(-) - -diff --git a/nix/eval-machine-info.nix b/nix/eval-machine-info.nix -index 503b4c25d..085452cd4 100644 ---- a/nix/eval-machine-info.nix -+++ b/nix/eval-machine-info.nix -@@ -39,13 +39,42 @@ rec { - # Get the configuration of this machine from each network - # expression, attaching _file attributes so the NixOS module - # system can give sensible error messages. -+ - modules = - concatMap (n: optional (hasAttr machineName n) - { imports = [(getAttr machineName n)]; inherit (n) _file; }) - networks; -- in -- { name = machineName; -- value = import { -+ -+ machineConfs = -+ concatMap (n: optional (hasAttr machineName n) -+ (getAttr machineName n)) -+ networks; -+ -+ nameToPath = attrs: name: { -+ prefix = name; -+ path = attrs."${name}"; -+ }; -+ -+ attrsetToPaths = attrset: map (nameToPath attrset) -+ (builtins.attrNames attrset); -+ -+ importSources = -+ (concatMap (module: -+ if (!builtins.isFunction module -+ && builtins.hasAttr "deployment" module) -+ && (builtins.hasAttr "nix_path" module.deployment) -+ then attrsetToPaths module.deployment.nix_path -+ else []) -+ machineConfs) ++ builtins.nixPath; -+ -+ __nixPath = importSources; -+ -+ machineImport = builtins.scopedImport { -+ inherit __nixPath; -+ }; -+ in { -+ name = machineName; -+ value = machineImport { - modules = - modules ++ - defaults ++ -diff --git a/nix/options.nix b/nix/options.nix -index 0866c3ab8..117b44a7b 100644 ---- a/nix/options.nix -+++ b/nix/options.nix -@@ -103,6 +103,13 @@ in - ''; - }; - -+ deployment.nix_path = mkOption { -+ default = {}; -+ type = types.attrsOf types.str; -+ description = '' -+ ''; -+ }; -+ - deployment.hasFastConnection = mkOption { - default = false; - type = types.bool; diff --git a/nixops/nixops.nix b/nixops/nixops.nix index b8bb715..2123ea9 100644 --- a/nixops/nixops.nix +++ b/nixops/nixops.nix @@ -1,14 +1,8 @@ { rpi-1 = import ./rpi.nix { host = "rpi-1"; rpi4 = false; }; rpi-2 = import ./rpi.nix { host = "rpi-2"; rpi4 = false; }; - rpi-3 = { - deployment.nix_path.nixpkgs = "https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz"; - imports = [(import ./rpi.nix { host = "rpi-3"; rpi4 = true; })]; - }; - rpi-4 = { - deployment.nix_path.nixpkgs = "https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz"; - imports = [(import ./rpi.nix { host = "rpi-4"; rpi4 = true; })]; - }; + rpi-3 = import ./rpi.nix { host = "rpi-3"; rpi4 = true; }; + rpi-4 = import ./rpi.nix { host = "rpi-4"; rpi4 = true; }; juno = import ./desktop.nix { host = "juno"; }; cnc = import ./desktop.nix { host = "cnc"; }; }