From 2033bd8af137e58fa9b99de1eed1973f1f514b76 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 24 Apr 2022 18:17:48 -0500 Subject: [PATCH] Deadnix cleanup https://github.com/astro/deadnix --- flake.nix | 7 +++---- nixos-modules/base-hw-pc.nix | 1 - nixos-modules/base-hw-virt_qemu.nix | 1 - nixos-modules/file-systems.nix | 4 ++-- nixos-modules/genode-core.nix | 5 ++--- nixos-modules/genode-init.nix | 2 +- nixos-modules/gui/default.nix | 7 ------- nixos-modules/hardware/ahci.nix | 2 +- nixos-modules/hardware/default.nix | 2 -- nixos-modules/nova.nix | 1 - nixos-modules/qemu-vm.nix | 1 - nixos-modules/services/tor.nix | 4 +--- overlay/default.nix | 15 ++++++--------- overlay/llvm-11/default.nix | 1 - packages/default.nix | 2 +- packages/genodelabs/default.nix | 6 +++--- packages/genodelabs/toolchain.nix | 2 +- tests/bash.nix | 2 +- tests/default.nix | 2 -- tests/graphics.nix | 2 +- tests/lib/build-vms.nix | 2 +- tests/log.nix | 2 +- tests/nim.nix | 4 ++-- tests/tor.nix | 2 +- 24 files changed, 28 insertions(+), 51 deletions(-) diff --git a/flake.nix b/flake.nix index 1019132..0369e66 100644 --- a/flake.nix +++ b/flake.nix @@ -89,9 +89,8 @@ let pkg' = prev.getOutput output pkg; path' = "${pkg'}/${output}/${file}"; - erisInfo = - fromJSON (builtins.unsafeDiscardStringContext - (readFile "${pkg'}/nix-support/eris-manifest.json")); + erisInfo = fromJSON (builtins.unsafeDiscardStringContext + (readFile "${pkg'}/nix-support/eris-manifest.json")); caps = filter ({ path, ... }: path == path') (prev.attrsets.mapAttrsToList (path: { cap, closure }: { @@ -214,7 +213,7 @@ # Genode native packages, not packages in the traditional # sense in that these cannot be installed within a profile. forAllCrossSystems ({ system, localSystem, crossSystem }: - nixpkgs.lib.filterAttrs (n: v: v != null) + nixpkgs.lib.filterAttrs (_: v: v != null) self.legacyPackages.${system}.genodePackages); devShell = diff --git a/nixos-modules/base-hw-pc.nix b/nixos-modules/base-hw-pc.nix index 5e4e57d..a596faf 100644 --- a/nixos-modules/base-hw-pc.nix +++ b/nixos-modules/base-hw-pc.nix @@ -2,7 +2,6 @@ with lib; let - localPackages = pkgs.buildPackages; utils = import ../lib { inherit (config.nixpkgs) system localSystem crossSystem; inherit pkgs; diff --git a/nixos-modules/base-hw-virt_qemu.nix b/nixos-modules/base-hw-virt_qemu.nix index 3e67eea..667a2c8 100644 --- a/nixos-modules/base-hw-virt_qemu.nix +++ b/nixos-modules/base-hw-virt_qemu.nix @@ -2,7 +2,6 @@ with lib; let - localPackages = pkgs.buildPackages; utils = import ../lib { inherit (config.nixpkgs) system localSystem crossSystem; inherit pkgs; diff --git a/nixos-modules/file-systems.nix b/nixos-modules/file-systems.nix index e956383..56ad7ba 100644 --- a/nixos-modules/file-systems.nix +++ b/nixos-modules/file-systems.nix @@ -27,7 +27,7 @@ with lib; { }; fileSystems = lib.mkOption { - type = types.attrsOf (types.submodule ({ name, config, ... }: { + type = types.attrsOf (types.submodule { options.block = { device = lib.mkOption { type = types.int; }; @@ -37,7 +37,7 @@ with lib; { partition = lib.mkOption { type = types.ints.positive; }; }; - })); + }); }; }; diff --git a/nixos-modules/genode-core.nix b/nixos-modules/genode-core.nix index eab33c0..aef7172 100644 --- a/nixos-modules/genode-core.nix +++ b/nixos-modules/genode-core.nix @@ -230,8 +230,7 @@ in { }]; genode.core.romModules = with builtins; - let getBin = name: "${getAttr name pkgs.genodePackages}/bin/${name}"; - in listToAttrs (lib.lists.flatten + listToAttrs (lib.lists.flatten ((map (getAttr "roms") (attrValues children')) ++ (map ({ cap, path, ... }: { name = cap; @@ -269,7 +268,7 @@ in { # Create the tarball of the store to live in core ROM system.build.tarball = pkgs.callPackage "${modulesPath}/../lib/make-system-tarball.nix" { - extraInputs = lib.attrsets.mapAttrsToList (name: child: child.package) + extraInputs = lib.attrsets.mapAttrsToList (_: child: child.package) config.genode.init.children; contents = erisContents; compressCommand = "cat"; diff --git a/nixos-modules/genode-init.nix b/nixos-modules/genode-init.nix index a39bd78..5799a1e 100644 --- a/nixos-modules/genode-init.nix +++ b/nixos-modules/genode-init.nix @@ -96,7 +96,7 @@ in { (map (label: '' , { service = { name = "Nic" - , label = Sigil.Init.LabelSelector.prefix "${child}" + , label = Sigil.Init.LabelSelector.prefix "${child} -> ${label}" } , route = Sigil.Init.Route.parent (None Text) } diff --git a/nixos-modules/gui/default.nix b/nixos-modules/gui/default.nix index 58a29b7..ddcc684 100644 --- a/nixos-modules/gui/default.nix +++ b/nixos-modules/gui/default.nix @@ -3,13 +3,6 @@ let toDhall = lib.generators.toDhall { }; cfg = config.genode.gui; - - domains' = lib.attrsets.mapAttrsToList (mapKey: attrs: { - inherit mapKey; - mapValue = lib.attrsets.mapAttrsToList - (mapKey: mapValue: { inherit mapKey mapValue; }) attrs; - }) cfg.domains; - in { options.genode.gui = { enable = lib.mkEnableOption "Genode Gui service"; diff --git a/nixos-modules/hardware/ahci.nix b/nixos-modules/hardware/ahci.nix index 30fb070..935afdd 100644 --- a/nixos-modules/hardware/ahci.nix +++ b/nixos-modules/hardware/ahci.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, lib, ... }: with lib; diff --git a/nixos-modules/hardware/default.nix b/nixos-modules/hardware/default.nix index 006377d..5dee78b 100644 --- a/nixos-modules/hardware/default.nix +++ b/nixos-modules/hardware/default.nix @@ -20,8 +20,6 @@ in { }; config = let - cfg = config.hardware.genode; - deviceManagerEnable = cfg.ahci.enable || cfg.usb.enable; ahciEris = lib.getEris "bin" pkgs.genodePackages.ahci_drv; diff --git a/nixos-modules/nova.nix b/nixos-modules/nova.nix index 377ccf9..b9d362f 100644 --- a/nixos-modules/nova.nix +++ b/nixos-modules/nova.nix @@ -2,7 +2,6 @@ with lib; let - localPackages = pkgs.buildPackages; utils = import ../lib { inherit (config.nixpkgs) system localSystem crossSystem; inherit pkgs; diff --git a/nixos-modules/qemu-vm.nix b/nixos-modules/qemu-vm.nix index c0a899b..11ffb53 100644 --- a/nixos-modules/qemu-vm.nix +++ b/nixos-modules/qemu-vm.nix @@ -18,7 +18,6 @@ let else throw "No EFI firmware available for platform"; efiFirmware = "${efiPrefix}_CODE.fd"; - efiVarsDefault = "${efiPrefix}_VARS.fd"; # Shell script to start the VM. startVM = '' diff --git a/nixos-modules/services/tor.nix b/nixos-modules/services/tor.nix index 8cecfe6..0c679b1 100644 --- a/nixos-modules/services/tor.nix +++ b/nixos-modules/services/tor.nix @@ -1,8 +1,6 @@ { config, lib, pkgs, ... }: -let - toDhall = lib.generators.toDhall { }; - cfg = config.services.tor; +let toDhall = lib.generators.toDhall { }; in { config = lib.mkIf config.services.tor.enable { diff --git a/overlay/default.nix b/overlay/default.nix index b373685..d339bba 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -9,9 +9,6 @@ let overrideHost = attrs: drv: if hostPlatform.isGenode then drv.override attrs else drv; - overrideTarget = attrs: drv: - if targetPlatform.isGenode then drv.override attrs else drv; - overrideAttrsHost = f: drv: if hostPlatform.isGenode then drv.overrideAttrs f else drv; @@ -24,8 +21,8 @@ let addPatchesTarget = ps: overrideAttrsTarget (addPatches' ps); - autoreconfHost = overrideAttrsHost - (attrs: { nativeBuildInputs = [ final.autoreconfHook ]; }); + autoreconfHost = + overrideAttrsHost (_: { nativeBuildInputs = [ final.autoreconfHook ]; }); nullPkgs = # Nullify these packages to find problems early. @@ -72,7 +69,7 @@ in nullPkgs // { coreutils = overrideHost { gmp = null; libiconv = null; - } (overrideAttrsHost (attrs: { + } (overrideAttrsHost (_: { configureFlags = [ "--disable-acl" "--disable-largefile" @@ -188,7 +185,7 @@ in nullPkgs // { nimblePackages = # Packages from the Nimble flake with adjustments. let pkgs' = flake.inputs.nimble.overlay (final // pkgs') final; - in pkgs'.nimblePackages.extend (final: prev: { + in pkgs'.nimblePackages.extend (_: prev: { genode = prev.genode.overrideAttrs (attrs: rec { version = "20.11.1"; @@ -225,7 +222,7 @@ in nullPkgs // { rsync = overrideHost { enableACLs = false; popt = null; - } (overrideAttrsHost (attrs: { outputs = [ "out" "man" ]; }) rsync); + } (overrideAttrsHost (_: { outputs = [ "out" "man" ]; }) rsync); solo5-tools = callPackage ./solo5-tools { }; @@ -254,7 +251,7 @@ in nullPkgs // { zstd = let static = true; legacySupport = false; - in overrideAttrsHost (attrs: rec { + in overrideAttrsHost (_: rec { cmakeFlags = lib.attrsets.mapAttrsToList (name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") { BUILD_SHARED = !static; diff --git a/overlay/llvm-11/default.nix b/overlay/llvm-11/default.nix index d827f93..50b811d 100644 --- a/overlay/llvm-11/default.nix +++ b/overlay/llvm-11/default.nix @@ -8,7 +8,6 @@ let release_version = "11.0.0"; version = release_version; # differentiating these (variables) is important for RCs - targetConfig = stdenv.targetPlatform.config; fetch = name: sha256: fetchurl { diff --git a/packages/default.nix b/packages/default.nix index 06f7e51..9439193 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -4,7 +4,7 @@ let upstream = import ./genodelabs { inherit flake pkgs; }; inherit (upstream) genodeSources; - inherit (pkgs) buildPackages callPackage fetchFromGitHub fetchgit stdenv; + inherit (pkgs) buildPackages callPackage fetchFromGitHub; dhallPackages = flake.inputs.nixpkgs.legacyPackages.x86_64-linux.callPackage ./dhall { }; diff --git a/packages/genodelabs/default.nix b/packages/genodelabs/default.nix index b0c01c9..f9f81e6 100644 --- a/packages/genodelabs/default.nix +++ b/packages/genodelabs/default.nix @@ -1,7 +1,7 @@ { flake, pkgs }: let - inherit (pkgs) lib buildPackages targetPackages; + inherit (pkgs) lib buildPackages; platform = pkgs.targetPlatform; @@ -207,8 +207,8 @@ let # to their inputs. The Genode depot mechanism links programs and # libraries to facsimilie stub libraries which are not guaranteed # to have the same ABI as the current version as the real library. - { name, apiOnly ? false, portInputs ? [ ], depotInputs ? [ ] - , nativeBuildInputs ? [ ], buildInputs ? [ ], meta ? { }, ... }@extraAttrs: + { name, portInputs ? [ ], depotInputs ? [ ], nativeBuildInputs ? [ ] + , buildInputs ? [ ], meta ? { }, ... }@extraAttrs: let getDepotInputs = lib.concatMap (x: diff --git a/packages/genodelabs/toolchain.nix b/packages/genodelabs/toolchain.nix index a450a52..f00ddb6 100644 --- a/packages/genodelabs/toolchain.nix +++ b/packages/genodelabs/toolchain.nix @@ -75,6 +75,6 @@ let wrapped = wrapCC cc; - wrapped' = wrapped.overrideAttrs (attrs: { inherit (cc) src targetPrefix; }); + wrapped' = wrapped.overrideAttrs (_: { inherit (cc) src targetPrefix; }); in wrapped' diff --git a/tests/bash.nix b/tests/bash.nix index a2362eb..92a95dd 100644 --- a/tests/bash.nix +++ b/tests/bash.nix @@ -1,6 +1,6 @@ { name = "bash"; - machine = { config, lib, modulesPath, pkgs, ... }: + machine = { lib, pkgs, ... }: let toDhall = lib.generators.toDhall { }; in { genode.init.children.bash = let diff --git a/tests/default.nix b/tests/default.nix index c4c7e6c..136ddba 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -2,8 +2,6 @@ let lib = flake.lib; - nixpkgs = flake.legacyPackages.${system}; - legacyPackages = flake.legacyPackages.${system}; testingPython = # Mostly lifted from Nixpkgs. diff --git a/tests/graphics.nix b/tests/graphics.nix index 2b58c8e..b1667c9 100644 --- a/tests/graphics.nix +++ b/tests/graphics.nix @@ -1,6 +1,6 @@ { name = "graphics"; - machine = { config, lib, pkgs, ... }: { + machine = { pkgs, ... }: { genode.gui.consoleLog.enable = true; diff --git a/tests/lib/build-vms.nix b/tests/lib/build-vms.nix index fdcf22a..82f0fc1 100644 --- a/tests/lib/build-vms.nix +++ b/tests/lib/build-vms.nix @@ -18,7 +18,7 @@ rec { # hostname and `configX' is a NixOS system configuration. Each # machine is given an arbitrary IP address in the virtual network. buildVirtualNetwork = nodes: - let nodesOut = mapAttrs (n: buildVM nodesOut) (assignIPAddresses nodes); + let nodesOut = mapAttrs (_: buildVM nodesOut) (assignIPAddresses nodes); in nodesOut; buildVM = nodes: configurations: diff --git a/tests/log.nix b/tests/log.nix index 3cd1c30..15d2887 100644 --- a/tests/log.nix +++ b/tests/log.nix @@ -1,6 +1,6 @@ { name = "log"; - machine = { lib, pkgs, ... }: { + machine = { pkgs, ... }: { genode.init.children.log = { package = pkgs.genodePackages.test-log; diff --git a/tests/nim.nix b/tests/nim.nix index 0e507bb..770a9e1 100644 --- a/tests/nim.nix +++ b/tests/nim.nix @@ -1,6 +1,6 @@ { name = "nim"; - machine = { pkgs, lib, ... }: { + machine = { pkgs, ... }: { genode.init.children.test_nim = let testNim = with pkgs; stdenv.mkDerivation { @@ -45,7 +45,7 @@ } , config = Libc.toConfig Libc.default } - ''; + ''; }; }; diff --git a/tests/tor.nix b/tests/tor.nix index dcf25b9..cb9a348 100644 --- a/tests/tor.nix +++ b/tests/tor.nix @@ -1,6 +1,6 @@ { name = "tor"; - machine = { config, lib, pkgs, ... }: { + machine = { documentation.nixos = { enable = true;