switch from flake-utils to flake-parts

there is not so much of a difference in this project, but
it means adding this project to clan, one less flake input
and also more consistency with other projects in clan.
This commit is contained in:
Jörg Thalheim 2026-01-16 15:10:12 +01:00
parent 06a26e7dee
commit 2d7860294d
2 changed files with 113 additions and 112 deletions

59
flake.lock generated
View file

@ -1,5 +1,25 @@
{ {
"nodes": { "nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -22,24 +42,6 @@
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
@ -123,7 +125,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-parts": "flake-parts",
"libkrun-src": "libkrun-src", "libkrun-src": "libkrun-src",
"libkrunfw-src": "libkrunfw-src", "libkrunfw-src": "libkrunfw-src",
"muvm-src": "muvm-src", "muvm-src": "muvm-src",
@ -155,7 +157,7 @@
}, },
"sidebus": { "sidebus": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -207,24 +209,9 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"virtwl": { "virtwl": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]

View file

@ -6,9 +6,13 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
virtwl.url = "git+https://github.com/valpackett/wayland-proxy-virtwl?shallow=1&submodules=1&ref=wip"; virtwl.url = "git+https://github.com/valpackett/wayland-proxy-virtwl?shallow=1&submodules=1&ref=wip";
virtwl.inputs.nixpkgs.follows = "nixpkgs"; virtwl.inputs.nixpkgs.follows = "nixpkgs";
sidebus.url = "git+https://git.clan.lol/clan/sidebus?shallow=1&ref=main"; sidebus.url = "git+https://git.clan.lol/clan/sidebus?shallow=1&ref=main";
sidebus.inputs.nixpkgs.follows = "nixpkgs"; sidebus.inputs.nixpkgs.follows = "nixpkgs";
@ -28,10 +32,10 @@
}; };
outputs = outputs =
{ inputs@{
self, self,
nixpkgs, nixpkgs,
flake-utils, flake-parts,
virtwl, virtwl,
sidebus, sidebus,
muvm-src, muvm-src,
@ -39,7 +43,13 @@
libkrunfw-src, libkrunfw-src,
... ...
}: }:
{ flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
flake = {
nixosModules.testvm = nixpkgs.lib.modules.importApply ./nixosModules/testvm.nix { inherit virtwl; }; nixosModules.testvm = nixpkgs.lib.modules.importApply ./nixosModules/testvm.nix { inherit virtwl; };
nixosModules.default = nixpkgs.lib.modules.importApply ./nixosModules/default.nix { nixosModules.default = nixpkgs.lib.modules.importApply ./nixosModules/default.nix {
inherit self virtwl sidebus; inherit self virtwl sidebus;
@ -67,20 +77,24 @@
{ nixpkgs.config.allowUnfree = true; } { nixpkgs.config.allowUnfree = true; }
]; ];
}; };
} };
// flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (
system: perSystem =
let {
pkgs = import nixpkgs { pkgs,
system,
self',
...
}:
{
_module.args.pkgs = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
in
{
checks = checks =
(pkgs.lib.mapAttrs' (n: pkgs.lib.nameValuePair "package-${n}") self.packages.${system}) (pkgs.lib.mapAttrs' (n: pkgs.lib.nameValuePair "package-${n}") self'.packages)
// (pkgs.lib.mapAttrs' (n: pkgs.lib.nameValuePair "devShell-${n}") self.devShells.${system}) // (pkgs.lib.mapAttrs' (n: pkgs.lib.nameValuePair "devShell-${n}") self'.devShells)
// (pkgs.lib.optionalAttrs (system == "x86_64-linux") { // (pkgs.lib.optionalAttrs (system == "x86_64-linux") {
nixos-testvm = self.nixosConfigurations.testvm-x86_64.config.system.build.toplevel; nixos-testvm = self.nixosConfigurations.testvm-x86_64.config.system.build.toplevel;
}) })
@ -96,20 +110,20 @@
}; };
libkrun = pkgs.callPackage ./packages/libkrun { libkrun = pkgs.callPackage ./packages/libkrun {
libkrunfw = self.packages.${system}.libkrunfw; libkrunfw = self'.packages.libkrunfw;
libkrun-src = libkrun-src; libkrun-src = libkrun-src;
}; };
mesa = pkgs.callPackage ./packages/mesa { }; mesa = pkgs.callPackage ./packages/mesa { };
muvm = pkgs.callPackage ./packages/muvm { muvm = pkgs.callPackage ./packages/muvm {
libkrun = self.packages.${system}.libkrun; libkrun = self'.packages.libkrun;
muvm-src = muvm-src; muvm-src = muvm-src;
}; };
munix = pkgs.callPackage ./packages/munix { munix = pkgs.callPackage ./packages/munix {
mesa = self.packages.${system}.mesa; mesa = self'.packages.mesa;
muvm = self.packages.${system}.muvm; muvm = self'.packages.muvm;
sidebus-broker = sidebus.packages.${system}.sidebus-broker; sidebus-broker = sidebus.packages.${system}.sidebus-broker;
}; };
@ -117,10 +131,10 @@
}; };
devShells.default = pkgs.callPackage ./devShells { devShells.default = pkgs.callPackage ./devShells {
libkrun = self.packages.${system}.libkrun; libkrun = self'.packages.libkrun;
muvm = self.packages.${system}.muvm; muvm = self'.packages.muvm;
sidebus-broker = sidebus.packages.${system}.sidebus-broker; sidebus-broker = sidebus.packages.${system}.sidebus-broker;
}; };
} };
); };
} }