flake.nix: cleanup

This commit is contained in:
Bloxx12
2025-06-23 10:04:06 +02:00
parent 398a4048e3
commit 227300ce51
2 changed files with 39 additions and 66 deletions

34
flake.lock generated
View File

@@ -16,24 +16,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"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"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1749903597,
@@ -53,7 +35,6 @@
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
@@ -77,21 +58,6 @@
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@@ -3,7 +3,6 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
@@ -17,37 +16,39 @@
outputs = {
self,
nixpkgs,
flake-utils,
rust-overlay,
...
}:
{
overlays.default = final: prev: {inherit (self.packages.${prev.system}) swww;};
}
// flake-utils.lib.eachDefaultSystem (
system: let
inherit (nixpkgs) lib;
}: let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
pkgsFor = lib.genAttrs systems (system:
import nixpkgs {
localSystem.system = system;
overlays = [(import rust-overlay)];
});
cargoToml = lib.importTOML ./Cargo.toml;
inherit (cargoToml.workspace.package) rust-version;
in {
packages =
lib.mapAttrs (system: pkgs: {
swww = let
rust = pkgs.rust-bin.stable.${rust-version}.default;
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
cargo-toml = lib.importTOML ./Cargo.toml;
inherit (cargo-toml.workspace.package) rust-version;
rust = pkgs.rust-bin.stable.${rust-version}.default;
rustPlatform = pkgs.makeRustPlatform {
cargo = rust;
rustc = rust;
};
in {
packages = {
swww = rustPlatform.buildRustPackage {
rustPlatform = pkgs.makeRustPlatform {
cargo = rust;
rustc = rust;
};
in
rustPlatform.buildRustPackage {
pname = "swww";
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
inherit (cargo-toml.workspace.package) version;
inherit (cargoToml.workspace.package) version;
cargoLock.lockFile = ./Cargo.lock;
@@ -87,16 +88,22 @@
};
};
default = self.packages.${system}.swww;
};
default = self.packages.${system}.swww;
})
pkgsFor;
formatter = pkgs.alejandra;
formatter = lib.mapAttrs (_: pkgs: pkgs.alejandra) pkgsFor;
devShells.default = pkgs.mkShell {
devShells =
lib.mapAttrs (system: pkgs: {
default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.swww];
packages = [pkgs.rust-bin.stable.${rust-version}.default];
};
}
);
})
pkgsFor;
overlays.default = final: prev: {inherit (self.packages.${prev.system}) swww;};
};
}