upgrade to nixos 20.03

This commit is contained in:
Sebastien Bourdeauducq 2020-04-20 14:21:48 +08:00
parent b37f00336e
commit 7f6d54c6cd
4 changed files with 14 additions and 131 deletions

View File

@ -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";

View File

@ -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
}

View File

@ -1,111 +0,0 @@
From e2015bbfcbcf7594824755e39f838d7aab258b6e Mon Sep 17 00:00:00 2001
From: Graham Christensen <graham@grahamc.com>
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 <nixpkgs>` 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 <nixpkgs/nixos/lib/eval-config.nix> {
+
+ 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 <nixpkgs/nixos/lib/eval-config.nix> {
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;

View File

@ -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"; };
}