Skip to content

Commit

Permalink
feat: add udev rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnossiom committed May 4, 2024
1 parent 83ec01e commit d2d97f0
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@
- `pkgs`: Custom packages either not eligible or missing from repositories
- `secrets`: `agenix` encrypted secrets
- `templates`: Quickstart files for different languages

## Add a new device

- Rekey secrets with device root ssh key, and create a session age key.

---

Milo Moisson © 2023-2024
6 changes: 3 additions & 3 deletions flake.lock

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

19 changes: 17 additions & 2 deletions nixos/profiles/laptop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ with lib;
"wireless.nix"
];

networking.hosts = {
"127.0.0.1" = [ "www.youtube.com" ];
};

hardware.opengl = {
enable = true;
driSupport = true;
Expand Down Expand Up @@ -60,7 +64,14 @@ with lib;
services.geoclue2.enable = true;

fonts = {
packages = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) inter noto-fonts noto-fonts-cjk-sans noto-fonts-emoji font-awesome ];
packages = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
inter
noto-fonts
noto-fonts-cjk-sans
upkgs.noto-fonts-emoji
font-awesome
];
fontconfig = {
defaultFonts = rec {
monospace = [ "JetBrainsMono Nerd Font" "Noto Sans Mono" ];
Expand All @@ -83,7 +94,11 @@ with lib;
environment.shellAliases = { ls = null; ll = null; l = null; };
programs.fish.enable = true;

services.udev.packages = with pkgs; [ numworks-udev-rules ];
services.udev.packages = with pkgs; [
arduino-udev-rules
numworks-udev-rules
probe-rs-udev-rules
];

services.devmon.enable = true;

Expand Down
28 changes: 28 additions & 0 deletions pkgs/arduino-udev-rules.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ lib
, stdenv
, writeText
}:

stdenv.mkDerivation rec {
pname = "arduino-udev-rules";
version = "0.0.0";

src = writeText pname ''
# Arduino Nano
ATTRS{idVendor}=="2341", ATTRS{idProduct}=="8037", MODE="0666", TAG+="uaccess"
'';

dontUnpack = true;

installPhase = ''
install -Dm 644 "${src}" "$out/lib/udev/rules.d/70-arduino.rules"
'';

meta = with lib; {
description = "UDev rules for Arduino boards";
homepage = "https://www.arduino.cc/";
maintainers = [ "mrnossiom" ];
platforms = platforms.linux;
};
}

3 changes: 3 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ in
{
# Commented packages are broken

arduino-udev-rules = pkgs.callPackage ./arduino-udev-rules.nix { };
# cspell-lsp = pkgs.callPackage ./cspell-lsp { };
findUnicode = pkgs.callPackage ./findUnicode.nix { };
git-along = pkgs.callPackage ./git-along.nix { };
# greenlight = pkgs.callPackage ./greenlight.nix { };
names = pkgs.callPackage ./names.nix { };
# overlayed = pkgs.callPackage ./overlayed.nix { };
probe-rs-udev-rules = pkgs.callPackage ./probe-rs-udev-rules.nix { };
rust-sloth = pkgs.callPackage ./rust-sloth.nix { };
rusty-rain = pkgs.callPackage ./rusty-rain { };
serenityos-emoji-font = pkgs.callPackage ./serenityos-emoji-font.nix { };
srgn = pkgs.callPackage ./srgn.nix { };

# Import packages defined in foreign repositories
Expand Down
27 changes: 27 additions & 0 deletions pkgs/probe-rs-udev-rules.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ lib
, stdenv
, fetchurl
}:

stdenv.mkDerivation rec {
pname = "probe-rs-udev-rules";
version = "0.0.0";

src = fetchurl {
url = "https://probe.rs/files/69-probe-rs.rules";
hash = "sha256-SdwESnOuvOKMsTvxyA5c4UwtcS3kU33SlNttepMm7HY=";
};

dontUnpack = true;

installPhase = ''
install -Dm 644 "${src}" "$out/lib/udev/rules.d/69-probe-rs.rules"
'';

meta = with lib; {
description = "UDev rules for Probe-rs supported probes calculators";
homepage = "https://probe.rs/";
maintainers = [ "mrnossiom" ];
platforms = platforms.linux;
};
}
28 changes: 28 additions & 0 deletions pkgs/serenityos-emoji-font.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ lib
, stdenv
, fetchurl
, ...
}:

stdenv.mkDerivation {
pname = "serenityos-emoji-font";
version = "0.0.0";

src = fetchurl {
url = "https://linusg.github.io/serenityos-emoji-font/SerenityOS-Emoji.ttf";
hash = "sha256-j3icyvz8BVI1i8erLj80yuoilxdhodQvBMaTwxs9Xm4=";
};

dontUnpack = true;

installPhase = ''
install -Dm644 $src $out/share/fonts/truetype/SerenityOS-Emoji.ttf
'';

meta = with lib; {
description = "SerenityOS🐞 emoji set is a fantastic pixel art🎨 set built for SerenityOS but now available for everyone, each glyph is at most 10x10px🔍";
homepage = "https://emoji.serenityos.org/";
license = licenses.bsd2;
maintainers = with maintainers; [ "mrnossiom" ];
};
}

0 comments on commit d2d97f0

Please sign in to comment.