From 20ac269ade85e546e0742342f851d6fff58dccde Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Tue, 15 Mar 2022 08:30:37 +0100 Subject: [PATCH] Add probe-rs udev rules --- home-manager/modules/fish/default.nix | 2 +- modules/base/default.nix | 7 ++++++ modules/base/probe-rs/default.nix | 36 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 modules/base/probe-rs/default.nix diff --git a/home-manager/modules/fish/default.nix b/home-manager/modules/fish/default.nix index 46f5f09..8c61f67 100644 --- a/home-manager/modules/fish/default.nix +++ b/home-manager/modules/fish/default.nix @@ -30,7 +30,7 @@ in { shellAliases = { # code = "${pkgs.vscode}/bin/code --enable-features=UseOzonePlatform --ozone-platform=wayland"; - ls = "${pkgs.exa}/bin/exa -Fb"; + ls = "${pkgs.exa}/bin/exa -Fb --git"; vimdiff = mkIf (config.eboskma.programs.neovim.enable) "nvim -d"; vim = mkIf (config.eboskma.programs.neovim.enable) "nvim"; diff --git a/modules/base/default.nix b/modules/base/default.nix index c024696..2c62af8 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -7,6 +7,10 @@ with lib; let cfg = config.eboskma.base; qmkUdevRules = builtins.readFile ./qmk.rules; + probersRules = pkgs.callPackage ./probe-rs { + inherit (pkgs.stdenv) mkDerivation; + inherit lib; + }; in { options.eboskma.base = { kernel = mkOption { @@ -60,6 +64,9 @@ in { services.udev = { extraRules = qmkUdevRules; + packages = [ + probersRules + ]; }; }; } diff --git a/modules/base/probe-rs/default.nix b/modules/base/probe-rs/default.nix new file mode 100644 index 0000000..21a74ed --- /dev/null +++ b/modules/base/probe-rs/default.nix @@ -0,0 +1,36 @@ +{ + mkDerivation, + lib, +}: +mkDerivation { + pname = "probe-rs-udev-rules"; + version = "20220312131009"; + + src = builtins.fetchurl { + url = "https://probe.rs/files/69-probe-rs.rules"; + sha256 = "00p6jywj43szcmjg13qh3kqhd98swnv7p9kwrcs1n5xr8hkx7lnm"; + }; + + dontUnpack = true; + dontBuild = true; + dontConfigure = true; + + installPhase = '' + mkdir -p $out/lib/udev/rules.d + cp $src $out/lib/udev/rules.d/69-probe-rs.rules + ''; + + meta = with lib; { + description = "udev rules for probe.rs"; + license = licenses.gpl2Only; + maintainers = [ + { + email = "erwin@datarift.nl"; + github = "eboskma"; + name = "Erwin Boskma"; + } + ]; + platforms = platforms.linux; + homepage = "https://probe.rs"; + }; +}