From 852a3e7686f5a0c3b5a1fe7ab3219230ef0c99a9 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 10 May 2023 23:32:31 +0000 Subject: [PATCH 1/7] nixpkgs: 2023-04-25 -> 2023-05-06 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` • Updated input 'mobile-nixos': 'github:nixos/mobile-nixos/4aa0afd84005b79be4d5361b56a60df9e9bd4ea3' (2023-04-03) → 'github:nixos/mobile-nixos/ba4638836e94a8f16d1d1f9e8c0530b86078029c' (2023-05-07) • Updated input 'nixpkgs-unpatched': 'github:nixos/nixpkgs/d0ea36ece469a71a909ebff90777c2f7a49478bb' (2023-04-25) → 'github:nixos/nixpkgs/897876e4c484f1e8f92009fd11b7d988a121a4e7' (2023-05-06) • Updated input 'sops-nix': 'github:Mic92/sops-nix/7c8e9727a2ecf9994d4a63d577ad5327e933b6a4' (2023-04-24) → 'github:Mic92/sops-nix/36b062a2c85a0efb37de1300c79c54602a094fab' (2023-05-08) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/ee7ec1c71adc47d2e3c2d5eb0d6b8fbbd42a8d1c' (2023-04-22) → 'github:NixOS/nixpkgs/ba0086c178d4ed60a7899f739caea553eca2e046' (2023-05-08) ``` --- flake.lock | 26 +++++++++++++------------- flake.nix | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 29169602..b490b5f1 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ "mobile-nixos": { "flake": false, "locked": { - "lastModified": 1680563603, - "narHash": "sha256-gxSci3NTlzgkAOhaC93Q4lReX/Pjd7++imD85JOAlps=", + "lastModified": 1683422260, + "narHash": "sha256-79zaClbubRkBNlJ04OSADILuLQHH48N5fu296hEWYlw=", "owner": "nixos", "repo": "mobile-nixos", - "rev": "4aa0afd84005b79be4d5361b56a60df9e9bd4ea3", + "rev": "ba4638836e94a8f16d1d1f9e8c0530b86078029c", "type": "github" }, "original": { @@ -66,11 +66,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1682173319, - "narHash": "sha256-tPhOpJJ+wrWIusvGgIB2+x6ILfDkEgQMX0BTtM5vd/4=", + "lastModified": 1683504292, + "narHash": "sha256-jlZbBIKGa6IMGkcJkQ08pbKnouTAPfeq1fD5I7l/rBw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ee7ec1c71adc47d2e3c2d5eb0d6b8fbbd42a8d1c", + "rev": "ba0086c178d4ed60a7899f739caea553eca2e046", "type": "github" }, "original": { @@ -82,16 +82,16 @@ }, "nixpkgs-unpatched": { "locked": { - "lastModified": 1682404149, - "narHash": "sha256-vilYNldFXiu56HGD0lPcWsiED7EmjGMViCLZoQsv7Jk=", + "lastModified": 1683408522, + "narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d0ea36ece469a71a909ebff90777c2f7a49478bb", + "rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7", "type": "github" }, "original": { "owner": "nixos", - "ref": "staging-next", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -113,11 +113,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1682338428, - "narHash": "sha256-T7AL/Us6ecxowjMAlO77GETTQO2SO+1XX2+Y/OSfHk8=", + "lastModified": 1683545104, + "narHash": "sha256-48wC0zzHAej/wLFWIgV+uj63AvQ2UUk85g7wmXJzTqk=", "owner": "Mic92", "repo": "sops-nix", - "rev": "7c8e9727a2ecf9994d4a63d577ad5327e933b6a4", + "rev": "36b062a2c85a0efb37de1300c79c54602a094fab", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a3073a2f..581c607c 100644 --- a/flake.nix +++ b/flake.nix @@ -43,8 +43,8 @@ # - use `staging` if no staging-next branch has been cut. # # - # nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=staging-next"; + nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + # nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=staging-next"; # nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=staging"; mobile-nixos = { From a23f5c148c31d65d66304037fe38f95c2e4b856e Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 11 May 2023 08:16:21 +0000 Subject: [PATCH 2/7] sublime-music-mobile: bump dependencies to fix build --- .../sublime-music-mobile/default.nix | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/pkgs/additional/sublime-music-mobile/default.nix b/pkgs/additional/sublime-music-mobile/default.nix index 4ca01a20..8087ccbd 100644 --- a/pkgs/additional/sublime-music-mobile/default.nix +++ b/pkgs/additional/sublime-music-mobile/default.nix @@ -48,7 +48,8 @@ , gtk-doc , lib , libhandy -, python3Packages +, fetchFromGitHub +, python3 , gobject-introspection , gtk3 , pango @@ -61,7 +62,22 @@ , networkSupport ? true, networkmanager }: -python3Packages.buildPythonApplication rec { +let + python = python3.override { + packageOverrides = self: super: { + semver = super.semver.overridePythonAttrs (oldAttrs: rec { + version = "2.13.0"; + src = fetchFromGitHub { + owner = "python-semver"; + repo = "python-semver"; + rev = "refs/tags/${version}"; + hash = "sha256-IWTo/P9JRxBQlhtcH3JMJZZrwAA8EALF4dtHajWUc4w="; + }; + }); + }; + }; +in +python.pkgs.buildPythonApplication rec { pname = "sublime-music-mobile"; version = "0.11.16"; format = "pyproject"; @@ -82,16 +98,17 @@ python3Packages.buildPythonApplication rec { domain = "git.uninsane.org"; owner = "colin"; repo = "sublime-music"; - rev = "5d8eb1f15c946a43dcf15266ce109f6bec810ce3"; - sha256 = "sha256-qMCyRNPtmd29dQKKcPi+Jy5gr39crZUBizprdOZlmY4="; + rev = "b64498960147c705f530f3d8f91c6217ed66a8f8"; + sha256 = "sha256-jyC3Fh+b+MBLjHlFr3nOOM7eT/3PPF7dynHsPJaIzLU="; }; nativeBuildInputs = [ gobject-introspection - python3Packages.poetry-core - python3Packages.pythonRelaxDepsHook wrapGAppsHook - ]; + ] ++ (with python.pkgs; [ + poetry-core + pythonRelaxDepsHook + ]); # Can be removed in later versions (probably > 0.11.16) pythonRelaxDeps = [ @@ -122,7 +139,7 @@ python3Packages.buildPythonApplication rec { ++ lib.optional networkSupport networkmanager ; - propagatedBuildInputs = with python3Packages; [ + propagatedBuildInputs = with python.pkgs; [ bleach dataclasses-json deepdiff @@ -135,7 +152,7 @@ python3Packages.buildPythonApplication rec { requests semver ] - ++ lib.optional chromecastSupport PyChromecast + ++ lib.optional chromecastSupport pychromecast ++ lib.optional keyringSupport keyring ++ lib.optional serverSupport bottle ; @@ -152,7 +169,7 @@ python3Packages.buildPythonApplication rec { # https://github.com/NixOS/nixpkgs/issues/56943 strictDeps = false; - checkInputs = with python3Packages; [ + checkInputs = with python.pkgs; [ pytest ]; From 46baec344d22842ace01db052bd459dc6b5e5e56 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 11 May 2023 21:31:23 +0000 Subject: [PATCH 3/7] don't ship wireshark on non-desktop machines --- hosts/common/programs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/common/programs/default.nix b/hosts/common/programs/default.nix index 6b279a6e..882167c3 100644 --- a/hosts/common/programs/default.nix +++ b/hosts/common/programs/default.nix @@ -61,7 +61,6 @@ let tree usbutils wget - wireshark ; }; sysadminExtraPkgs = { @@ -213,11 +212,12 @@ let kdenlive kid3 # audio tagging krita - libreoffice-fresh # XXX colin: maybe don't want this on mobile + libreoffice-fresh mumble obsidian slic3r steam + wireshark # could maybe ship the cli as sysadmin pkg ; }; x86GuiPkgs = { From a0770090647b634f62b20ffe4dd1b9666471dff2 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 11 May 2023 21:31:41 +0000 Subject: [PATCH 4/7] fix moby cross compilation --- hosts/common/cross/default.nix | 45 +++++++--------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/hosts/common/cross/default.nix b/hosts/common/cross/default.nix index 11314f91..bb4f701b 100644 --- a/hosts/common/cross/default.nix +++ b/hosts/common/cross/default.nix @@ -246,6 +246,7 @@ let buildInputs = lib.subtractLists buildInputs (upstream.buildInputs or []); nativeBuildInputs = lib.subtractLists nativeBuildInputs (upstream.nativeBuildInputs or []); }); + rmNativeBuildInputs = nativeBuildInputs: rmInputs { inherit nativeBuildInputs; }; # move items from buildInputs into nativeBuildInputs, or vice-versa. # arguments represent the final location of specific inputs. mvInputs = { buildInputs ? [], nativeBuildInputs ? [] }: pkg: @@ -511,15 +512,6 @@ in # }; # }; - # TODO(REMOVE AFTER MERGE): https://github.com/NixOS/nixpkgs/pull/225977 - aprutil = prev.aprutil.overrideAttrs (upstream: { - # nixpkgs patches the ldb version only for the package itself, but derivative packages (serf -> subversion) inherit the wrong -ldb-6.9 flag. - postConfigure = upstream.postConfigure + lib.optionalString (next.stdenv.buildPlatform != next.stdenv.hostPlatform) '' - substituteInPlace apu-1-config \ - --replace "-ldb-6.9" "-ldb" - ''; - }); - blueman = prev.blueman.overrideAttrs (orig: { # configure: error: ifconfig or ip not found, install net-tools or iproute2 nativeBuildInputs = orig.nativeBuildInputs ++ [ next.iproute2 ]; @@ -960,7 +952,7 @@ in ./kitty-no-docs.patch ]; }); - libgweather = (prev.libgweather.override { + libgweather = rmNativeBuildInputs [ next.glib ] (prev.libgweather.override { # alternative to emulating python3 is to specify it in `buildInputs` instead of `nativeBuildInputs` (upstream), # but presumably that's just a different way to emulate it. # the python gobject-introspection stuff is a tangled mess that's impossible to debug: @@ -979,14 +971,6 @@ in # buildInputs = upstream.buildInputs ++ [ next.vala ]; # }); - # TODO(REMOVE AFTER MERGE): https://github.com/NixOS/nixpkgs/pull/225977 - libqmi = prev.libqmi.overrideAttrs (upstream: { - # fixes "failed to produce output devdoc"; nixpkgs only builds that output conditionally - outputs = [ "out" "dev" ] ++ lib.optionals (prev.stdenv.buildPlatform == prev.stdenv.hostPlatform) [ - "devdoc" - ]; - }); - libsForQt5 = prev.libsForQt5.overrideScope' (self: super: { qgpgme = super.qgpgme.overrideAttrs (orig: { # fix so it can find the MOC compiler @@ -1032,8 +1016,13 @@ in # fixes "properties/gresource.xml: Permission denied" # - by providing glib-compile-resources networkmanager-openvpn = mvToNativeInputs [ next.glib ] prev.networkmanager-openvpn; - # fixes "gdbus-codegen: command not found" - networkmanager-sstp = mvToNativeInputs [ next.glib ] prev.networkmanager-sstp; + networkmanager-sstp = ( + # fixes "gdbus-codegen: command not found" + mvToNativeInputs [ next.glib ] ( + # fixes gtk4-builder-tool wrong format + addNativeInputs [ next.gtk4.dev ] prev.networkmanager-sstp + ) + ); networkmanager-vpnc = mvToNativeInputs [ next.glib ] prev.networkmanager-vpnc; # fixes "properties/gresource.xml: Permission denied" # - by providing glib-compile-resources @@ -1128,10 +1117,6 @@ in # nativeBuildInputs = upstream.nativeBuildInputs ++ [ next.gpgme ]; # }); - # TODO(REMOVE AFTER MERGE): https://github.com/NixOS/nixpkgs/pull/225977 - # fixes: "perl: command not found" - pam_mount = mvToNativeInputs [ next.perl ] prev.pam_mount; - # phoc = prev.phoc.override { # # fixes "Program wayland-scanner found: NO" # inherit (emulated) stdenv; @@ -1316,10 +1301,6 @@ in # inherit (emulated) stdenv; # }; - # TODO(REMOVE AFTER MERGE): https://github.com/NixOS/nixpkgs/pull/225977 - # fixes "sh: line 1: ar: command not found" - serf = addNativeInputs [ next.bintools ] prev.serf; - spandsp = prev.spandsp.overrideAttrs (upstream: { configureFlags = upstream.configureFlags or [] ++ [ # fixes runtime error: "undefined symbol: rpl_realloc" @@ -1381,14 +1362,6 @@ in wrapGAppsHook # introduces a competing gtk3 at link-time, unless emulated ; }; - # TODO(REMOVE AFTER MERGE): https://github.com/NixOS/nixpkgs/pull/225977 - subversion = prev.subversion.overrideAttrs (upstream: { - configureFlags = upstream.configureFlags ++ [ - # configure can't find APR and APR-util, unclear why (are they not placed on PATH?) - "--with-apr=${next.apr.dev}/bin/apr-1-config" - "--with-apr-util=${next.aprutil.dev}/bin/apu-1-config" - ]; - }); # fixes: "src/meson.build:12:2: ERROR: Program 'gdbus-codegen' not found or not executable" sysprof = mvToNativeInputs [ next.glib ] ( From 3bdbd9db7b7960e94858f60688e57fc4e909424b Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 11 May 2023 22:39:08 +0000 Subject: [PATCH 5/7] `nixpkgs.hostPlatform`: set as default, to allow hosts to customize it later --- flake.nix | 6 ++++-- hosts/instantiate.nix | 12 +----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 581c607c..a6bfa31d 100644 --- a/flake.nix +++ b/flake.nix @@ -116,10 +116,12 @@ self.overlays.pkgs # self.overlays.optimizations ]; - nixpkgs.hostPlatform = target; + } + ({ lib, ... }: { + nixpkgs.hostPlatform = lib.mkDefault target; # nixpkgs.buildPlatform = local; # set by instantiate.nix instead # nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv; - } + }) ]; }); in { diff --git a/hosts/instantiate.nix b/hosts/instantiate.nix index 1f5f445a..f823df25 100644 --- a/hosts/instantiate.nix +++ b/hosts/instantiate.nix @@ -4,7 +4,7 @@ { hostName, localSystem }: # module args -{ config, lib, ... }: +{ lib, ... }: { imports = [ @@ -16,14 +16,4 @@ networking.hostName = hostName; nixpkgs.buildPlatform = lib.mkIf (localSystem != null) localSystem; sane.cross.enablePatches = localSystem != null; - - # nixpkgs.overlays = [ - # (next: prev: { - # # for local != target we by default just emulate the target while building. - # # provide a `pkgs.cross.` alias that consumers can use instead of `pkgs.` - # # to explicitly opt into non-emulated cross compilation for any specific package. - # # this is most beneficial for large packages with few pre-requisites -- like Linux. - # cross = prev.crossFrom."${localSystem}"; - # }) - # ]; } From dd25c26845f56955ec6dd6c2e4570718bd58f375 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 11 May 2023 23:46:59 +0000 Subject: [PATCH 6/7] add colin to `wireshark` group --- hosts/common/users.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hosts/common/users.nix b/hosts/common/users.nix index 20550596..09ff86ce 100644 --- a/hosts/common/users.nix +++ b/hosts/common/users.nix @@ -33,13 +33,13 @@ in ]; group = "users"; extraGroups = [ - "wheel" - "nixbuild" - "networkmanager" - # phosh/mobile. XXX colin: unsure if necessary - "video" + "dialout" # required for modem access (moby) "feedbackd" - "dialout" # required for modem access + "networkmanager" + "nixbuild" + "video" # phosh/mobile. XXX colin: unsure if necessary + "wheel" + "wireshark" ]; # initial password is empty, in case anything goes wrong. From 3c2715648c8a0bf07d9ac779025c362f13ae7468 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 12 May 2023 06:49:59 +0000 Subject: [PATCH 7/7] moby: ship compressed kernel images i've verified that .gz images boot. don't know about zImage, etc. --- flake.nix | 2 +- hosts/by-name/moby/default.nix | 1 + hosts/by-name/moby/kernel.nix | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index a6bfa31d..5b97a221 100644 --- a/flake.nix +++ b/flake.nix @@ -118,7 +118,7 @@ ]; } ({ lib, ... }: { - nixpkgs.hostPlatform = lib.mkDefault target; + nixpkgs.hostPlatform.system = target; # nixpkgs.buildPlatform = local; # set by instantiate.nix instead # nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv; }) diff --git a/hosts/by-name/moby/default.nix b/hosts/by-name/moby/default.nix index e0460b07..35bb1dd3 100644 --- a/hosts/by-name/moby/default.nix +++ b/hosts/by-name/moby/default.nix @@ -31,6 +31,7 @@ }; sane.user.persist.plaintext = [ + # TODO: make this just generally conditional upon pulse being enabled? ".config/pulse" # persist pulseaudio volume ]; diff --git a/hosts/by-name/moby/kernel.nix b/hosts/by-name/moby/kernel.nix index fb3c164c..02831c75 100644 --- a/hosts/by-name/moby/kernel.nix +++ b/hosts/by-name/moby/kernel.nix @@ -65,4 +65,19 @@ in # boot.kernelPatches = manjaroPatches ++ [ # (patchDefconfig kernelConfig) # ]; + + nixpkgs.hostPlatform.linux-kernel = { + # defaults: + name = "aarch64-multiplatform"; + baseConfig = "defconfig"; + DTB = true; + autoModules = true; + preferBuiltin = true; + # extraConfig = ... + # ^-- raspberry pi stuff: we don't need it. + + # target = "Image"; # <-- default + target = "Image.gz"; # <-- compress the kernel image + # target = "zImage"; # <-- confuses other parts of nixos :-( + }; }