diff --git a/default.nix b/default.nix deleted file mode 100644 index 8bbf5d6..0000000 --- a/default.nix +++ /dev/null @@ -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 , - pkgs ? import nixpkgs { }, -}: - -pkgs.callPackage ./scope.nix { } diff --git a/flake.lock b/flake.lock index b8b89ac..8445fa1 100644 --- a/flake.lock +++ b/flake.lock @@ -1,19 +1,5 @@ { "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": { "inputs": { "nixpkgs-lib": [ @@ -52,7 +38,6 @@ }, "root": { "inputs": { - "flake-compat": "flake-compat", "flake-parts": "flake-parts", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 90ec3e8..c2050d0 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,6 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; 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 = @@ -20,7 +16,27 @@ perSystem = { pkgs, ... }: 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 { devShells.default = pkgs.mkShell { @@ -30,11 +46,11 @@ rust-analyzer clippy ]; - env = scope.buildEnvVars; - }; - packages = { - inherit (scope) sidebus-agent sidebus-broker; + env = buildEnvVars; }; + + packages.sidebus-agent = rustPackage "sidebus-agent"; + packages.sidebus-broker = rustPackage "sidebus-broker"; }; flake = { diff --git a/scope.nix b/scope.nix deleted file mode 100644 index f41fc24..0000000 --- a/scope.nix +++ /dev/null @@ -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"; }; -})