-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
224 additions
and
172 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ self, ... }: | ||
{ | ||
perSystem = | ||
{ pkgs, ... }: | ||
{ | ||
checks = { | ||
inherit ((pkgs.callPackage ./crane.nix { inherit self; })) | ||
centerpiece | ||
index-git-repositories | ||
cargoArtifacts | ||
cargoClippy | ||
cargoTest | ||
; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
self, | ||
lib, | ||
pkgs, | ||
makeWrapper, | ||
pkgconf, | ||
dbus, | ||
}: | ||
let | ||
cargoTOML = builtins.fromTOML (builtins.readFile (self + "/Cargo.toml")); | ||
inherit (cargoTOML.workspace.package) version; | ||
pname = "centerpiece"; | ||
meta = import ./meta.nix { inherit lib; }; | ||
craneLib = self.inputs.crane.mkLib pkgs; | ||
commonArgs = { | ||
nativeBuildInputs = [ | ||
makeWrapper | ||
# wifi plugin | ||
# cargo networkmanager dependency | ||
pkgconf | ||
dbus | ||
]; | ||
buildInputs = [ dbus ]; | ||
inherit | ||
meta | ||
version | ||
pname | ||
; | ||
src = | ||
let | ||
fontFilter = path: _type: builtins.match ".*ttf$" path != null; | ||
configFilter = path: _type: builtins.match ".*config.yml$" path != null; | ||
assetOrCargo = | ||
path: type: | ||
(configFilter path type) || (fontFilter path type) || (craneLib.filterCargoSources path type); | ||
in | ||
lib.cleanSourceWith { | ||
src = craneLib.path ../.; | ||
filter = assetOrCargo; | ||
}; | ||
}; | ||
cargoArtifacts = craneLib.buildDepsOnly commonArgs; | ||
cargoClippy = craneLib.cargoClippy ( | ||
commonArgs | ||
// { | ||
inherit cargoArtifacts; | ||
cargoClippyExtraArgs = "--all-targets --all-features"; | ||
} | ||
); | ||
cargoTest = craneLib.cargoNextest (commonArgs // { inherit cargoArtifacts; }); | ||
in | ||
{ | ||
centerpiece = craneLib.buildPackage ( | ||
commonArgs | ||
// { | ||
env = import ./env.nix { inherit self; }; | ||
postFixup = pkgs.lib.optional pkgs.stdenv.isLinux '' | ||
rpath=$(patchelf --print-rpath $out/bin/${pname}) | ||
patchelf --set-rpath "$rpath:${pkgs.callPackage ./lib.nix { }}" $out/bin/${pname} | ||
''; | ||
doCheck = false; | ||
inherit | ||
cargoArtifacts | ||
; | ||
} | ||
); | ||
index-git-repositories = craneLib.buildPackage ( | ||
commonArgs | ||
// { | ||
cargoExtraArgs = "-p index-git-repositories"; | ||
pname = "index-git-repositories"; | ||
doCheck = false; | ||
inherit | ||
cargoArtifacts | ||
; | ||
} | ||
); | ||
inherit | ||
cargoClippy | ||
cargoArtifacts | ||
cargoTest | ||
; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ flake-parts, ... }@inputs: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = [ | ||
"x86_64-linux" | ||
"aarch64-linux" | ||
]; | ||
|
||
imports = [ | ||
./devshells.nix | ||
./formatter.nix | ||
./packages.nix | ||
./checks.nix | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ self, ... }: | ||
{ | ||
perSystem = | ||
{ pkgs, self', ... }: | ||
{ | ||
devShells = { | ||
default = pkgs.mkShellNoCC { | ||
name = "centerpiece"; | ||
inputsFrom = [ self'.packages.default ]; | ||
packages = [ | ||
pkgs.clippy | ||
self'.formatter.outPath | ||
]; | ||
env = import ./env.nix { inherit self; }; | ||
LD_LIBRARY_PATH = pkgs.callPackage ./lib.nix { }; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ self, ... }: | ||
{ | ||
GIT_DATE = "${builtins.substring 0 4 self.lastModifiedDate}-${ | ||
builtins.substring 4 2 self.lastModifiedDate | ||
}-${builtins.substring 6 2 self.lastModifiedDate}"; | ||
GIT_REV = self.shortRev or self.dirtyShortRev; | ||
} |
Oops, something went wrong.