mirror of
https://github.com/RGBCube/dix
synced 2025-07-27 11:47:46 +00:00
feat: working nix flake
This commit is contained in:
parent
50a9a673bd
commit
5a532c2b82
4 changed files with 37 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
/.direnv
|
/.direnv
|
||||||
/target
|
/target
|
||||||
|
/result
|
||||||
|
|
10
flake.lock
generated
10
flake.lock
generated
|
@ -24,16 +24,16 @@
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689347949,
|
"lastModified": 1681028828,
|
||||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
"owner": "nix-systems",
|
"owner": "nix-systems",
|
||||||
"repo": "default-linux",
|
"repo": "default",
|
||||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-systems",
|
"owner": "nix-systems",
|
||||||
"repo": "default-linux",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
flake.nix
16
flake.nix
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
description = "Diff Nix";
|
description = "Dix - Diff Nix";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
@ -11,8 +11,18 @@
|
||||||
pkgsFor = inputs.nixpkgs.legacyPackages;
|
pkgsFor = inputs.nixpkgs.legacyPackages;
|
||||||
in {
|
in {
|
||||||
packages = eachSystem (system: {
|
packages = eachSystem (system: {
|
||||||
default = inputs.self.packages.${system}.ralc;
|
default = inputs.self.packages.${system}.dix;
|
||||||
ralc = pkgsFor.${system}.callPackage ./nix/package.nix {};
|
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: {
|
devShells = eachSystem (system: {
|
||||||
|
|
18
nix/package.nix
Normal file
18
nix/package.nix
Normal 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;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue