Deadnix cleanup

https://github.com/astro/deadnix
This commit is contained in:
Emery Hemingway 2022-04-24 18:17:48 -05:00
parent 9a12b98960
commit 2033bd8af1
24 changed files with 28 additions and 51 deletions

View File

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

View File

@ -2,7 +2,6 @@
with lib;
let
localPackages = pkgs.buildPackages;
utils = import ../lib {
inherit (config.nixpkgs) system localSystem crossSystem;
inherit pkgs;

View File

@ -2,7 +2,6 @@
with lib;
let
localPackages = pkgs.buildPackages;
utils = import ../lib {
inherit (config.nixpkgs) system localSystem crossSystem;
inherit pkgs;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ config, lib, ... }:
with lib;

View File

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

View File

@ -2,7 +2,6 @@
with lib;
let
localPackages = pkgs.buildPackages;
utils = import ../lib {
inherit (config.nixpkgs) system localSystem crossSystem;
inherit pkgs;

View File

@ -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 = ''

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,8 +2,6 @@
let
lib = flake.lib;
nixpkgs = flake.legacyPackages.${system};
legacyPackages = flake.legacyPackages.${system};
testingPython =
# Mostly lifted from Nixpkgs.

View File

@ -1,6 +1,6 @@
{
name = "graphics";
machine = { config, lib, pkgs, ... }: {
machine = { pkgs, ... }: {
genode.gui.consoleLog.enable = true;

View File

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

View File

@ -1,6 +1,6 @@
{
name = "log";
machine = { lib, pkgs, ... }: {
machine = { pkgs, ... }: {
genode.init.children.log = {
package = pkgs.genodePackages.test-log;

View File

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

View File

@ -1,6 +1,6 @@
{
name = "tor";
machine = { config, lib, pkgs, ... }: {
machine = {
documentation.nixos = {
enable = true;