Compare commits

..

No commits in common. "feat/flake-compat" and "main" have entirely different histories.

4 changed files with 25 additions and 87 deletions

View file

@ -1,22 +0,0 @@
let
lockFile = builtins.fromJSON (builtins.readFile ./flake.lock);
flake-compat-node = lockFile.nodes.${lockFile.nodes.root.inputs.flake-compat};
flake-compat = builtins.fetchTarball {
inherit (flake-compat-node.locked) url;
sha256 = flake-compat-node.locked.narHash;
};
flake' = (
import flake-compat {
src = ./.;
}
);
flake = flake'.defaultNix;
in
{
useFlake ? true,
nixpkgs ? if useFlake then flake.inputs.nixpkgs else <nixpkgs>,
pkgs ? import nixpkgs { },
}:
pkgs.callPackage ./scope.nix { }

15
flake.lock generated
View file

@ -1,19 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1751685974,
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/flake-compat/archive/549f2762aebeff29a2e5ece7a7dc0f955281a1d1.tar.gz?rev=549f2762aebeff29a2e5ece7a7dc0f955281a1d1"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -52,7 +38,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View file

@ -3,10 +3,6 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
flake-compat = {
url = "https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz";
flake = false;
};
}; };
outputs = outputs =
@ -20,7 +16,27 @@
perSystem = perSystem =
{ pkgs, ... }: { pkgs, ... }:
let let
scope = pkgs.callPackage ./scope.nix { }; buildEnvVars = {
BIN_XDG_PERMISSION_STORE = "${pkgs.xdg-desktop-portal}/libexec/xdg-permission-store";
BIN_XDG_DOCUMENT_PORTAL = "${pkgs.xdg-desktop-portal}/libexec/xdg-document-portal";
BIN_VIRTIOFSD = "${pkgs.virtiofsd}/bin/virtiofsd";
};
rustPackage =
crate:
let
cargoToml = builtins.fromTOML (builtins.readFile ./${crate}/Cargo.toml);
in
pkgs.rustPlatform.buildRustPackage {
inherit (cargoToml.package) name version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
cargoLock.outputHashes = {
"busd-0.5.0" = "sha256-IZZ2MeEmUbzRrH6SUz0pnecMH4f8Mh54WdhI4q44YfI=";
};
buildAndTestSubdir = crate;
env = buildEnvVars;
};
in in
{ {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
@ -30,11 +46,11 @@
rust-analyzer rust-analyzer
clippy clippy
]; ];
env = scope.buildEnvVars; env = buildEnvVars;
};
packages = {
inherit (scope) sidebus-agent sidebus-broker;
}; };
packages.sidebus-agent = rustPackage "sidebus-agent";
packages.sidebus-broker = rustPackage "sidebus-broker";
}; };
flake = { flake = {

View file

@ -1,41 +0,0 @@
{ lib, newScope }:
lib.makeScope newScope (self: {
forgetScope = lib.flip lib.removeAttrs [
"override"
"overrideDerivation"
"overrideScope"
"newScope"
"packages"
"forgetScope"
];
buildEnvVars = self.forgetScope (
self.callPackage (
{ xdg-desktop-portal, virtiofsd }:
{
BIN_XDG_PERMISSION_STORE = "${xdg-desktop-portal}/libexec/xdg-permission-store";
BIN_XDG_DOCUMENT_PORTAL = "${xdg-desktop-portal}/libexec/xdg-document-portal";
BIN_VIRTIOFSD = "${virtiofsd}/bin/virtiofsd";
}
) { }
);
rustPackage =
{
crate,
cargoToml ? builtins.fromTOML (builtins.readFile ./${crate}/Cargo.toml),
rustPlatform,
buildEnvVars,
}:
rustPlatform.buildRustPackage {
inherit (cargoToml.package) name version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
cargoLock.outputHashes = {
"busd-0.5.0" = "sha256-IZZ2MeEmUbzRrH6SUz0pnecMH4f8Mh54WdhI4q44YfI=";
};
buildAndTestSubdir = crate;
env = buildEnvVars;
};
sidebus-agent = self.callPackage self.rustPackage { crate = "sidebus-agent"; };
sidebus-broker = self.callPackage self.rustPackage { crate = "sidebus-broker"; };
})