Skip to content

Commit e56d8c5

Browse files
use dev profile
1 parent 05540d8 commit e56d8c5

File tree

3 files changed

+16
-28
lines changed

3 files changed

+16
-28
lines changed

.github/workflows/build-nix-package.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,5 @@ jobs:
1414
- uses: DeterminateSystems/nix-installer-action@main
1515
- uses: DeterminateSystems/magic-nix-cache-action@main
1616

17-
- name: Build Nix Package
18-
run: nix build .nix --print-build-logs
19-
20-
build-without-resources:
21-
runs-on: ubuntu-latest
22-
permissions:
23-
contents: read
24-
steps:
25-
- uses: actions/checkout@v4
26-
- uses: DeterminateSystems/nix-installer-action@main
27-
- uses: DeterminateSystems/magic-nix-cache-action@main
28-
29-
- name: Build Nix Package Without Resources
30-
run: nix build .nix#graphite-without-resources --print-build-logs
17+
- name: Build Nix Package Dev
18+
run: nix build .nix#graphite-dev --print-build-logs

.nix/flake.nix

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,18 @@
100100
in
101101
{
102102
packages = rec {
103-
default = graphite;
104-
graphite = (import ./pkgs/graphite.nix {
105-
pkgs = pkgs // { inherit graphene-raster-nodes-shaders; };
106-
inherit info inputs deps libs tools;
107-
}) {};
108-
graphite-without-resources = (import ./pkgs/graphite.nix {
103+
graphiteWithArgs = args: (import ./pkgs/graphite.nix {
109104
pkgs = pkgs // { inherit graphene-raster-nodes-shaders; };
110105
inherit info inputs deps libs tools;
111-
}) { embeddedResources = false; };
106+
}) args;
107+
graphite = graphiteWithArgs { };
108+
graphite-dev = graphiteWithArgs { dev = true; };
109+
graphite-without-resources = graphiteWithArgs { embeddedResources = false; };
110+
graphite-without-resources-dev = graphiteWithArgs { embeddedResources = false; dev = true; };
112111
#TODO: graphene-cli = import ./pkgs/graphene-cli.nix { inherit info pkgs inputs deps libs tools; };
113112
graphene-raster-nodes-shaders = import ./pkgs/graphene-raster-nodes-shaders.nix { inherit info pkgs inputs deps libs tools; };
113+
114+
default = graphite;
114115
};
115116

116117
devShells.default = import ./dev.nix { inherit pkgs deps libs tools; };

.nix/pkgs/graphite.nix

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{
44
embeddedResources ? true,
5+
dev ? false,
56
}:
67

78
let
@@ -47,9 +48,11 @@ let
4748
strictDeps = true;
4849
buildInputs = libs.desktop-all;
4950
nativeBuildInputs = tools.desktop ++ [ pkgs.makeWrapper ];
50-
env = deps.cef.env;
51-
doCheck = false;
51+
env = deps.cef.env // {
52+
CARGO_PROFILE = if dev then "dev" else "release";
53+
};
5254
cargoExtraArgs = "-p graphite-desktop${if embeddedResources then "" else " --no-default-features --features recommended"}";
55+
doCheck = false;
5356
};
5457
in
5558

@@ -62,13 +65,9 @@ deps.crane.lib.buildPackage (common // {
6265
EMBEDDED_RESOURCES = resources;
6366
} else {});
6467

65-
buildPhase = ''
66-
cargo build -r ${common.cargoExtraArgs}
67-
'';
68-
6968
installPhase = ''
7069
mkdir -p $out/bin
71-
cp target/release/graphite $out/bin/graphite
70+
cp target/${if dev then "debug" else "release"}/graphite $out/bin/graphite
7271
7372
mkdir -p $out/share/applications
7473
cp $src/desktop/assets/*.desktop $out/share/applications/

0 commit comments

Comments
 (0)