Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
79 changes: 48 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,62 +25,79 @@
inherit system;
overlays = [(import rust-overlay)];
};
inherit (pkgs) lib;
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
cargoToml = lib.importTOML ./Cargo.toml;

nativeBuildInputs = with pkgs; [
pkg-config
];

buildInputs = with pkgs; [
glib-networking
gobject-introspection
gtk4
libadwaita
libxkbcommon
wayland
glib
];

naersk-package = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
clippy = toolchain;
};
in {
devShell = with pkgs;
devShells.default = with pkgs;
mkShell {
buildInputs = [
cargo
cargo-info
rustc
rustfmt
clippy
rust-analyzer
just

eza
fd
fzf
bat
packages =
[
toolchain
cargo-info
rust-analyzer
just

pkg-config
libxkbcommon
glib
gobject-introspection
gtk4
libadwaita
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
eza
fd
fzf
bat
]
++ nativeBuildInputs
++ buildInputs;
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";

shellHook = ''
alias ls=eza
alias find=fd
'';
};

devShell = self.devShells.${system}.default;

packages.default = naersk-package.buildPackage {
name = "nmrs";
version = self.shortRev or self.dirtyShortRev;
pname = "nmrs-gui";
version = cargoToml.package.version;
src = ./.;

buildInputs = with pkgs; [
pkg-config
wrapGAppsHook4
libxkbcommon
glib
];
nativeBuildInputs =
nativeBuildInputs
++ (with pkgs; [
wrapGAppsHook4
]);
inherit buildInputs;

postInstall = ''
install -D nmrs.desktop -t $out/share/applications
'';

meta.mainProgram = "nmrs-gui";
meta = with lib; {
description = cargoToml.package.description;
homepage = cargoToml.package.repository;
license = licenses.mit;
mainProgram = "nmrs-gui";
platforms = platforms.linux;
};
};
}
);
Expand Down