Skip to content

chore: update Nix flake #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ indent_size = 4
[*.rs]
indent_style = space
indent_size = 4

[*.nix]
indent_style = space
indent_size = 2
27 changes: 21 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 26 additions & 26 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
description = "Swhkd devel";
description = "wayshot devel and build";

inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; };
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";

# shell.nix compatibility
inputs.flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";

outputs = { self, nixpkgs, ... }:
let
pkgsFor = system:
import nixpkgs {
inherit system;
overlays = [ ];
};
# System types to support.
targetSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];

targetSystems = [ "aarch64-linux" "x86_64-linux" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs targetSystems;
in {
devShells = nixpkgs.lib.genAttrs targetSystems (system:
let pkgs = pkgsFor system;
in {
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
name = "Swhkd-devel";
strictDeps = true;
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
nativeBuildInputs = with pkgs; [
# Compilers
cargo
rustc
scdoc

# libs
udev

# Tools
pkg-config

rustfmt
clippy
gdb
gnumake
rust-analyzer
rustfmt
strace
valgrind
zip

scdoc
];

buildInputs = with pkgs; [
udev # libudev-sys
];
};
});
}
);
};
}