1
Fork 0
mirror of https://github.com/RGBCube/dix synced 2025-07-27 03:37:45 +00:00

feat: working nix flake

This commit is contained in:
Bloxx12 2025-05-09 20:53:03 +02:00
parent 50a9a673bd
commit 5a532c2b82
No known key found for this signature in database
4 changed files with 37 additions and 8 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/.direnv
/target
/result

10
flake.lock generated
View file

@ -24,16 +24,16 @@
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"repo": "default",
"type": "github"
}
}

View file

@ -1,5 +1,5 @@
{
description = "Diff Nix";
description = "Dix - Diff Nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@ -11,8 +11,18 @@
pkgsFor = inputs.nixpkgs.legacyPackages;
in {
packages = eachSystem (system: {
default = inputs.self.packages.${system}.ralc;
ralc = pkgsFor.${system}.callPackage ./nix/package.nix {};
default = inputs.self.packages.${system}.dix;
dix = pkgsFor.${system}.callPackage ./nix/package.nix {};
});
apps = eachSystem (system: let
inherit (inputs.self.packages.${system}) dix;
in {
default = inputs.self.apps.${system}.dix;
dix = {
type = "app";
program = "${dix}/bin/dix";
};
});
devShells = eachSystem (system: {

18
nix/package.nix Normal file
View file

@ -0,0 +1,18 @@
{
rustPlatform,
lib,
...
}: let
toml = (lib.importTOML ../Cargo.toml).package;
pname = toml.name;
inherit (toml) version;
in
rustPlatform.buildRustPackage {
inherit pname version;
src = builtins.path {
name = "${pname}-${version}";
path = lib.sources.cleanSource ../.;
};
cargoLock.lockFile = ../Cargo.lock;
doCheck = true;
}