Skip to content

Commit

Permalink
[META/NIX] Add devShell and formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Bwc9876 committed Dec 27, 2023
1 parent 816b4b6 commit 85a97ed
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
20 changes: 12 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
(import
(
import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
{src = ./.;}
)
.defaultNix
6 changes: 2 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
owmods-gui = pkgs.owmods-gui;
default = pkgs.owmods-cli;
};
# For `nix develop`:
#devShell = pkgs.mkShell {
# nativeBuildInputs = with pkgs; [ rustc cargo openssl libsoup ];
#};
}
)
// {
formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".alejandra;
devShell = import ./nix/shell.nix;
overlay.owmods = import ./nix/overlay.nix;
nixosModules.owmods = import ./nix/modules/nixos.nix;
homeManagerModules.owmods = import ./nix/modules/hm.nix;
Expand Down
3 changes: 1 addition & 2 deletions nix/owmods-gui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ rustPlatform.buildRustPackage rec {
buildAndTestSubdir = "owmods_gui/backend";

postPatch = let
frontend-drv = mkPnpmPackage rec {
frontend = mkPnpmPackage rec {
src = ../owmods_gui/frontend;
installInPlace = true;
distDir = "../dist";
};
frontend = frontend-drv; # assert lib.assertMsg (owmods-gui-frontend.version == version) "Frontend (${owmods-gui-frontend.version}) and backend (${version}) Version Mismatch"; owmods-gui-frontend;
in ''
substituteInPlace owmods_gui/backend/tauri.conf.json \
--replace '"distDir": "../dist"' '"distDir": "${frontend}"'
Expand Down
6 changes: 2 additions & 4 deletions shell.nix → nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
{pkg}: pkgs.mkShell {
name = "owmods-shell";
buildInputs = with pkgs; [
rustc
Expand All @@ -22,4 +20,4 @@ pkgs.mkShell {
shellHook = ''
export GIO_MODULE_DIR=${pkgs.glib-networking}/lib/gio/modules/
'';
}
};

0 comments on commit 85a97ed

Please sign in to comment.