diff --git a/.editorconfig b/.editorconfig index 922dc19..09f4db2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,7 @@ indent_size = 4 [*.rs] indent_style = space indent_size = 4 + +[*.nix] +indent_style = space +indent_size = 2 diff --git a/flake.lock b/flake.lock index b80c063..2b89ef0 100644 --- a/flake.lock +++ b/flake.lock @@ -1,23 +1,38 @@ { "nodes": { + "flake-compat": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, "nixpkgs": { "locked": { - "lastModified": 1715499532, - "narHash": "sha256-9UJLb8rdi2VokYcfOBQHUzP3iNxOPNWcbK++ENElpk0=", - "owner": "nixos", + "lastModified": 1743813633, + "narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "af8b9db5c00f1a8e4b83578acc578ff7d823b786", + "rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", + "owner": "NixOS", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { + "flake-compat": "flake-compat", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index eb5bfcd..f2a5b1e 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; }; - }); + } + ); }; }