remove flake-utils, clean up

This commit is contained in:
Artemis Tosini 2024-07-15 20:15:52 +00:00
parent 6656b07f2c
commit 0ceb6d3a5f
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
2 changed files with 45 additions and 73 deletions

View file

@ -18,41 +18,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
} }
} }
}, },

View file

@ -3,42 +3,28 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
}; };
outputs = outputs =
{ { self, nixpkgs }:
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (
system:
let let
pkgs = import nixpkgs { inherit (nixpkgs) lib;
makePkgs =
system:
import nixpkgs {
inherit system; inherit system;
overlays = [ self.overlays.default ]; overlays = [ self.overlays.default ];
}; };
inherit (pkgs) lib; forAllSystems =
names = builtins.attrNames (self.overlays.default pkgs pkgs); f:
in lib.listToAttrs (
{ map (system: {
devShells = { name = system;
plotter = pkgs.callPackage ./shells/plotter { }; value = f (makePkgs system);
ryujinx = pkgs.callPackage ./shells/ryujinx { }; }) lib.systems.flakeExposed
zephyr = pkgs.callPackage ./shells/zephyr { }; );
}; makeDummy =
pkg:
formatter = pkgs.nixfmt-rfc-style;
packages = builtins.listToAttrs (
lib.concatMap (
name:
let
pkg = pkgs.${name};
in
lib.optional (builtins.typeOf pkg == "set") {
inherit name;
value =
if lib.isDerivation pkg then if lib.isDerivation pkg then
pkg pkg
else else
@ -47,12 +33,32 @@
type = "derivation"; type = "derivation";
name = "dummy-attrset"; name = "dummy-attrset";
}; };
in
{
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
devShells = forAllSystems (pkgs: {
plotter = pkgs.callPackage ./shells/plotter { };
ryujinx = pkgs.callPackage ./shells/ryujinx { };
zephyr = pkgs.callPackage ./shells/zephyr { };
});
packages = forAllSystems (
pkgs:
builtins.listToAttrs (
let
names = builtins.attrNames (self.overlays.default pkgs pkgs);
in
lib.concatMap (
name:
lib.optional (builtins.typeOf pkgs.${name} == "set") {
inherit name;
value = makeDummy pkgs.${name};
} }
) names ) names
);
}
) )
// { );
overlays.default = final: prev: { overlays.default = final: prev: {
apotris = final.callPackage ./packages/apotris { }; apotris = final.callPackage ./packages/apotris { };
attic = final.callPackage ./packages/attic { }; attic = final.callPackage ./packages/attic { };