Deadnix cleanup

https://github.com/astro/deadnix
This commit is contained in:
Ehmry - 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 let
pkg' = prev.getOutput output pkg; pkg' = prev.getOutput output pkg;
path' = "${pkg'}/${output}/${file}"; path' = "${pkg'}/${output}/${file}";
erisInfo = erisInfo = fromJSON (builtins.unsafeDiscardStringContext
fromJSON (builtins.unsafeDiscardStringContext (readFile "${pkg'}/nix-support/eris-manifest.json"));
(readFile "${pkg'}/nix-support/eris-manifest.json"));
caps = filter ({ path, ... }: path == path') caps = filter ({ path, ... }: path == path')
(prev.attrsets.mapAttrsToList (path: (prev.attrsets.mapAttrsToList (path:
{ cap, closure }: { { cap, closure }: {
@ -214,7 +213,7 @@
# Genode native packages, not packages in the traditional # Genode native packages, not packages in the traditional
# sense in that these cannot be installed within a profile. # sense in that these cannot be installed within a profile.
forAllCrossSystems ({ system, localSystem, crossSystem }: forAllCrossSystems ({ system, localSystem, crossSystem }:
nixpkgs.lib.filterAttrs (n: v: v != null) nixpkgs.lib.filterAttrs (_: v: v != null)
self.legacyPackages.${system}.genodePackages); self.legacyPackages.${system}.genodePackages);
devShell = devShell =

View File

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

View File

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

View File

@ -27,7 +27,7 @@ with lib; {
}; };
fileSystems = lib.mkOption { fileSystems = lib.mkOption {
type = types.attrsOf (types.submodule ({ name, config, ... }: { type = types.attrsOf (types.submodule {
options.block = { options.block = {
device = lib.mkOption { type = types.int; }; device = lib.mkOption { type = types.int; };
@ -37,7 +37,7 @@ with lib; {
partition = lib.mkOption { type = types.ints.positive; }; partition = lib.mkOption { type = types.ints.positive; };
}; };
})); });
}; };
}; };

View File

@ -230,8 +230,7 @@ in {
}]; }];
genode.core.romModules = with builtins; genode.core.romModules = with builtins;
let getBin = name: "${getAttr name pkgs.genodePackages}/bin/${name}"; listToAttrs (lib.lists.flatten
in listToAttrs (lib.lists.flatten
((map (getAttr "roms") (attrValues children')) ++ (map ((map (getAttr "roms") (attrValues children')) ++ (map
({ cap, path, ... }: { ({ cap, path, ... }: {
name = cap; name = cap;
@ -269,7 +268,7 @@ in {
# Create the tarball of the store to live in core ROM # Create the tarball of the store to live in core ROM
system.build.tarball = system.build.tarball =
pkgs.callPackage "${modulesPath}/../lib/make-system-tarball.nix" { 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; config.genode.init.children;
contents = erisContents; contents = erisContents;
compressCommand = "cat"; compressCommand = "cat";

View File

@ -96,7 +96,7 @@ in {
(map (label: '' (map (label: ''
, { service = , { service =
{ name = "Nic" { name = "Nic"
, label = Sigil.Init.LabelSelector.prefix "${child}" , label = Sigil.Init.LabelSelector.prefix "${child} -> ${label}"
} }
, route = Sigil.Init.Route.parent (None Text) , route = Sigil.Init.Route.parent (None Text)
} }

View File

@ -3,13 +3,6 @@
let let
toDhall = lib.generators.toDhall { }; toDhall = lib.generators.toDhall { };
cfg = config.genode.gui; 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 { in {
options.genode.gui = { options.genode.gui = {
enable = lib.mkEnableOption "Genode Gui service"; enable = lib.mkEnableOption "Genode Gui service";

View File

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

View File

@ -20,8 +20,6 @@ in {
}; };
config = let config = let
cfg = config.hardware.genode;
deviceManagerEnable = cfg.ahci.enable || cfg.usb.enable; deviceManagerEnable = cfg.ahci.enable || cfg.usb.enable;
ahciEris = lib.getEris "bin" pkgs.genodePackages.ahci_drv; ahciEris = lib.getEris "bin" pkgs.genodePackages.ahci_drv;

View File

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

View File

@ -18,7 +18,6 @@ let
else else
throw "No EFI firmware available for platform"; throw "No EFI firmware available for platform";
efiFirmware = "${efiPrefix}_CODE.fd"; efiFirmware = "${efiPrefix}_CODE.fd";
efiVarsDefault = "${efiPrefix}_VARS.fd";
# Shell script to start the VM. # Shell script to start the VM.
startVM = '' startVM = ''

View File

@ -1,8 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let toDhall = lib.generators.toDhall { };
toDhall = lib.generators.toDhall { };
cfg = config.services.tor;
in { in {
config = lib.mkIf config.services.tor.enable { config = lib.mkIf config.services.tor.enable {

View File

@ -9,9 +9,6 @@ let
overrideHost = attrs: drv: overrideHost = attrs: drv:
if hostPlatform.isGenode then drv.override attrs else 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: overrideAttrsHost = f: drv:
if hostPlatform.isGenode then drv.overrideAttrs f else drv; if hostPlatform.isGenode then drv.overrideAttrs f else drv;
@ -24,8 +21,8 @@ let
addPatchesTarget = ps: overrideAttrsTarget (addPatches' ps); addPatchesTarget = ps: overrideAttrsTarget (addPatches' ps);
autoreconfHost = overrideAttrsHost autoreconfHost =
(attrs: { nativeBuildInputs = [ final.autoreconfHook ]; }); overrideAttrsHost (_: { nativeBuildInputs = [ final.autoreconfHook ]; });
nullPkgs = nullPkgs =
# Nullify these packages to find problems early. # Nullify these packages to find problems early.
@ -72,7 +69,7 @@ in nullPkgs // {
coreutils = overrideHost { coreutils = overrideHost {
gmp = null; gmp = null;
libiconv = null; libiconv = null;
} (overrideAttrsHost (attrs: { } (overrideAttrsHost (_: {
configureFlags = [ configureFlags = [
"--disable-acl" "--disable-acl"
"--disable-largefile" "--disable-largefile"
@ -188,7 +185,7 @@ in nullPkgs // {
nimblePackages = nimblePackages =
# Packages from the Nimble flake with adjustments. # Packages from the Nimble flake with adjustments.
let pkgs' = flake.inputs.nimble.overlay (final // pkgs') final; 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 { genode = prev.genode.overrideAttrs (attrs: rec {
version = "20.11.1"; version = "20.11.1";
@ -225,7 +222,7 @@ in nullPkgs // {
rsync = overrideHost { rsync = overrideHost {
enableACLs = false; enableACLs = false;
popt = null; popt = null;
} (overrideAttrsHost (attrs: { outputs = [ "out" "man" ]; }) rsync); } (overrideAttrsHost (_: { outputs = [ "out" "man" ]; }) rsync);
solo5-tools = callPackage ./solo5-tools { }; solo5-tools = callPackage ./solo5-tools { };
@ -254,7 +251,7 @@ in nullPkgs // {
zstd = let zstd = let
static = true; static = true;
legacySupport = false; legacySupport = false;
in overrideAttrsHost (attrs: rec { in overrideAttrsHost (_: rec {
cmakeFlags = lib.attrsets.mapAttrsToList cmakeFlags = lib.attrsets.mapAttrsToList
(name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") { (name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") {
BUILD_SHARED = !static; BUILD_SHARED = !static;

View File

@ -8,7 +8,6 @@ let
release_version = "11.0.0"; release_version = "11.0.0";
version = version =
release_version; # differentiating these (variables) is important for RCs release_version; # differentiating these (variables) is important for RCs
targetConfig = stdenv.targetPlatform.config;
fetch = name: sha256: fetch = name: sha256:
fetchurl { fetchurl {

View File

@ -4,7 +4,7 @@ let
upstream = import ./genodelabs { inherit flake pkgs; }; upstream = import ./genodelabs { inherit flake pkgs; };
inherit (upstream) genodeSources; inherit (upstream) genodeSources;
inherit (pkgs) buildPackages callPackage fetchFromGitHub fetchgit stdenv; inherit (pkgs) buildPackages callPackage fetchFromGitHub;
dhallPackages = dhallPackages =
flake.inputs.nixpkgs.legacyPackages.x86_64-linux.callPackage ./dhall { }; flake.inputs.nixpkgs.legacyPackages.x86_64-linux.callPackage ./dhall { };

View File

@ -1,7 +1,7 @@
{ flake, pkgs }: { flake, pkgs }:
let let
inherit (pkgs) lib buildPackages targetPackages; inherit (pkgs) lib buildPackages;
platform = pkgs.targetPlatform; platform = pkgs.targetPlatform;
@ -207,8 +207,8 @@ let
# to their inputs. The Genode depot mechanism links programs and # to their inputs. The Genode depot mechanism links programs and
# libraries to facsimilie stub libraries which are not guaranteed # libraries to facsimilie stub libraries which are not guaranteed
# to have the same ABI as the current version as the real library. # to have the same ABI as the current version as the real library.
{ name, apiOnly ? false, portInputs ? [ ], depotInputs ? [ ] { name, portInputs ? [ ], depotInputs ? [ ], nativeBuildInputs ? [ ]
, nativeBuildInputs ? [ ], buildInputs ? [ ], meta ? { }, ... }@extraAttrs: , buildInputs ? [ ], meta ? { }, ... }@extraAttrs:
let let
getDepotInputs = lib.concatMap (x: getDepotInputs = lib.concatMap (x:

View File

@ -75,6 +75,6 @@ let
wrapped = wrapCC cc; wrapped = wrapCC cc;
wrapped' = wrapped.overrideAttrs (attrs: { inherit (cc) src targetPrefix; }); wrapped' = wrapped.overrideAttrs (_: { inherit (cc) src targetPrefix; });
in wrapped' in wrapped'

View File

@ -1,6 +1,6 @@
{ {
name = "bash"; name = "bash";
machine = { config, lib, modulesPath, pkgs, ... }: machine = { lib, pkgs, ... }:
let toDhall = lib.generators.toDhall { }; let toDhall = lib.generators.toDhall { };
in { in {
genode.init.children.bash = let genode.init.children.bash = let

View File

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

View File

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

View File

@ -18,7 +18,7 @@ rec {
# hostname and `configX' is a NixOS system configuration. Each # hostname and `configX' is a NixOS system configuration. Each
# machine is given an arbitrary IP address in the virtual network. # machine is given an arbitrary IP address in the virtual network.
buildVirtualNetwork = nodes: buildVirtualNetwork = nodes:
let nodesOut = mapAttrs (n: buildVM nodesOut) (assignIPAddresses nodes); let nodesOut = mapAttrs (_: buildVM nodesOut) (assignIPAddresses nodes);
in nodesOut; in nodesOut;
buildVM = nodes: configurations: buildVM = nodes: configurations:

View File

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

View File

@ -1,6 +1,6 @@
{ {
name = "nim"; name = "nim";
machine = { pkgs, lib, ... }: { machine = { pkgs, ... }: {
genode.init.children.test_nim = let genode.init.children.test_nim = let
testNim = with pkgs; testNim = with pkgs;
stdenv.mkDerivation { stdenv.mkDerivation {
@ -45,7 +45,7 @@
} }
, config = Libc.toConfig Libc.default , config = Libc.toConfig Libc.default
} }
''; '';
}; };
}; };

View File

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