Compare commits
No commits in common. "d20bcf6a2d957da8f5c0a88b0ca1046aa02dedec" and "dd36dab4978f6844520a6fc1de4228f72a701195" have entirely different histories.
d20bcf6a2d
...
dd36dab497
1029
Cargo.lock
generated
1029
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
23
flake.lock
generated
23
flake.lock
generated
@ -1,12 +1,17 @@
|
||||
{
|
||||
"nodes": {
|
||||
"crane": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736101677,
|
||||
"narHash": "sha256-iKOPq86AOWCohuzxwFy/MtC8PcSVGnrxBOvxpjpzrAY=",
|
||||
"lastModified": 1717469187,
|
||||
"narHash": "sha256-UVvFGiWFGPfVXG7Xr6HPKChx9hhtzkGaGAS/Ph1Khjg=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "61ba163d85e5adeddc7b3a69bb174034965965b2",
|
||||
"rev": "7e86136dc729cdf237aa59a5a02687bc0d1144b6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -20,11 +25,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -35,11 +40,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1736241350,
|
||||
"narHash": "sha256-CHd7yhaDigUuJyDeX0SADbTM9FXfiWaeNyY34FL1wQU=",
|
||||
"lastModified": 1716715802,
|
||||
"narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8c9fd3e564728e90829ee7dbac6edc972971cd0f",
|
||||
"rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
200
flake.nix
200
flake.nix
@ -3,124 +3,124 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
crane = {
|
||||
url = "github:ipetkov/crane";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
crane.url = "github:ipetkov/crane";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
crane,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
let
|
||||
packageOutputs = flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
craneLib = crane.mkLib pkgs;
|
||||
craneLib = crane.mkLib pkgs;
|
||||
|
||||
dbMigrationsFilter = path: _type: builtins.match ".*sql$" path != null;
|
||||
dbMigrationsOrCargoFilter =
|
||||
path: type: (dbMigrationsFilter path type) || (craneLib.filterCargoSources path type);
|
||||
dbMigrationsFilter = path: _type: builtins.match ".*sql$" path != null;
|
||||
dbMigrationsOrCargoFilter =
|
||||
path: type: (dbMigrationsFilter path type) || (craneLib.filterCargoSources path type);
|
||||
|
||||
dbMigrations = pkgs.lib.cleanSourceWith {
|
||||
src = craneLib.path ./db-migrations; # The original, unfiltered source
|
||||
filter = dbMigrationsFilter;
|
||||
dbMigrations = pkgs.lib.cleanSourceWith {
|
||||
src = craneLib.path ./db-migrations; # The original, unfiltered source
|
||||
filter = dbMigrationsFilter;
|
||||
};
|
||||
|
||||
# Common arguments can be set here to avoid repeating them later
|
||||
# Note: changes here will rebuild all dependency crates
|
||||
commonArgs = rec {
|
||||
strictDeps = true; # When this is not set, all dependency crates will be compiled again
|
||||
src = pkgs.lib.cleanSourceWith {
|
||||
src = craneLib.path ./.; # The original, unfiltered source
|
||||
filter = dbMigrationsOrCargoFilter;
|
||||
};
|
||||
|
||||
# Common arguments can be set here to avoid repeating them later
|
||||
# Note: changes here will rebuild all dependency crates
|
||||
commonArgs = rec {
|
||||
strictDeps = true; # When this is not set, all dependency crates will be compiled again
|
||||
src = pkgs.lib.cleanSourceWith {
|
||||
src = craneLib.path ./.; # The original, unfiltered source
|
||||
filter = dbMigrationsOrCargoFilter;
|
||||
};
|
||||
# Add icons.toml to $src when compiling dependencies (needed by relm4-icons)
|
||||
extraDummyScript = ''
|
||||
cp --no-preserve=mode,ownership ${./icons.toml} $out/icons.toml
|
||||
'';
|
||||
|
||||
# Add icons.toml to $src when compiling dependencies (needed by relm4-icons)
|
||||
extraDummyScript = ''
|
||||
cp --no-preserve=mode,ownership ${./icons.toml} $out/icons.toml
|
||||
nativeBuildInputs = with pkgs; [ pkg-config ];
|
||||
|
||||
buildInputs =
|
||||
with pkgs;
|
||||
[
|
||||
gtk4
|
||||
xournalpp # not needed for building
|
||||
]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||
# Additional darwin specific inputs can be set here
|
||||
pkgs.libiconv
|
||||
];
|
||||
};
|
||||
|
||||
# Build *just* the cargo dependencies, so we can reuse
|
||||
# all of that work (e.g. via cachix) when running in CI
|
||||
cargoArtifacts = craneLib.buildDepsOnly (commonArgs);
|
||||
|
||||
# Run clippy (and deny all warnings) on the crate source,
|
||||
# reusing the dependency artifacts (e.g. from build scripts or
|
||||
# proc-macros) from above.
|
||||
#
|
||||
# Note that this is done as a separate derivation so it
|
||||
# does not impact building just the crate by itself.
|
||||
myCrateClippy = craneLib.cargoClippy (
|
||||
commonArgs
|
||||
// {
|
||||
# Again we apply some extra arguments only to this derivation
|
||||
# and not every where else. In this case we add some clippy flags
|
||||
inherit cargoArtifacts;
|
||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||
}
|
||||
);
|
||||
|
||||
# Build the actual crate itself, reusing the dependency
|
||||
# artifacts from above.
|
||||
myCrate = craneLib.buildPackage (
|
||||
commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
}
|
||||
// {
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/applications
|
||||
cp ${./sheet-organizer.desktop} $out/share/applications/sheet-organizer.desktop
|
||||
|
||||
mkdir -p $out/share/icons
|
||||
cp ${./sheet-organizer.png} $out/share/icons/sheet-organizer.png
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
nativeBuildInputs = with pkgs; [ pkg-config ];
|
||||
# Also run the crate tests under cargo-tarpaulin so that we can keep
|
||||
# track of code coverage
|
||||
myCrateCoverage = craneLib.cargoTarpaulin (commonArgs // { inherit cargoArtifacts; });
|
||||
|
||||
buildInputs =
|
||||
with pkgs;
|
||||
[
|
||||
gtk4
|
||||
xournalpp # not needed for building
|
||||
]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||
# Additional darwin specific inputs can be set here
|
||||
pkgs.libiconv
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.default = myCrate;
|
||||
checks = {
|
||||
inherit
|
||||
# Build the crate as part of `nix flake check` for convenience
|
||||
myCrate
|
||||
myCrateClippy
|
||||
myCrateCoverage
|
||||
;
|
||||
};
|
||||
|
||||
# Build *just* the cargo dependencies, so we can reuse
|
||||
# all of that work (e.g. via cachix) when running in CI
|
||||
cargoArtifacts = craneLib.buildDepsOnly (commonArgs);
|
||||
|
||||
# Run clippy (and deny all warnings) on the crate source,
|
||||
# reusing the dependency artifacts (e.g. from build scripts or
|
||||
# proc-macros) from above.
|
||||
#
|
||||
# Note that this is done as a separate derivation so it
|
||||
# does not impact building just the crate by itself.
|
||||
myCrateClippy = craneLib.cargoClippy (
|
||||
commonArgs
|
||||
// {
|
||||
# Again we apply some extra arguments only to this derivation
|
||||
# and not every where else. In this case we add some clippy flags
|
||||
inherit cargoArtifacts;
|
||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||
}
|
||||
);
|
||||
|
||||
# Build the actual crate itself, reusing the dependency
|
||||
# artifacts from above.
|
||||
myCrate = craneLib.buildPackage (
|
||||
commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
}
|
||||
// {
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/applications
|
||||
cp ${./sheet-organizer.desktop} $out/share/applications/sheet-organizer.desktop
|
||||
|
||||
mkdir -p $out/share/icons
|
||||
cp ${./sheet-organizer.png} $out/share/icons/sheet-organizer.png
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
# Also run the crate tests under cargo-tarpaulin so that we can keep
|
||||
# track of code coverage
|
||||
myCrateCoverage = craneLib.cargoTarpaulin (commonArgs // { inherit cargoArtifacts; });
|
||||
|
||||
in
|
||||
{
|
||||
packages.default = myCrate;
|
||||
checks = {
|
||||
inherit
|
||||
# Build the crate as part of `nix flake check` for convenience
|
||||
myCrate
|
||||
myCrateClippy
|
||||
myCrateCoverage
|
||||
;
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
packageOutputs
|
||||
// {
|
||||
hydraJobs = {
|
||||
x86_64-linux.sheet-organizer = packageOutputs.packages.x86_64-linux;
|
||||
aarch64-linux.sheet-organizer = packageOutputs.packages.aarch64-linux;
|
||||
};
|
||||
};
|
||||
hydraJobs = {
|
||||
"sheet-organizer" = myCrate;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user