Merge pull request #49876 from etu/add-dmrconfig-module-udev-rules

Add dmrconfig module udev rules
This commit is contained in:
adisbladis 2018-11-09 12:04:20 +00:00 committed by GitHub
commit 86559259e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 5 deletions

View File

@ -90,6 +90,7 @@
./programs/criu.nix
./programs/dconf.nix
./programs/digitalbitbox/default.nix
./programs/dmrconfig.nix
./programs/environment.nix
./programs/firejail.nix
./programs/fish.nix

View File

@ -0,0 +1,38 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.dmrconfig;
in {
meta.maintainers = [ maintainers.etu ];
###### interface
options = {
programs.dmrconfig = {
enable = mkOption {
default = false;
type = types.bool;
description = ''
Whether to configure system to enable use of dmrconfig. This
enables the required udev rules and installs the program.
'';
relatedPackages = [ "dmrconfig" ];
};
package = mkOption {
default = pkgs.dmrconfig;
type = types.package;
defaultText = "pkgs.dmrconfig";
description = "dmrconfig derivation to use";
};
};
};
###### implementation
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
services.udev.packages = [ cfg.package ];
};
}

View File

@ -3,13 +3,13 @@
stdenv.mkDerivation rec {
name = "dmrconfig-${version}";
version = "2018-10-29";
version = "2018-11-07";
src = fetchFromGitHub {
owner = "sergev";
repo = "dmrconfig";
rev = "4924d00283c3c81a4b8251669e42aecd96b6145a";
sha256 = "00a4hmbr71g0d4faskb8q96y6z212g2r4n533yvp88z8rq8vbxxn";
rev = "b58985d3c848b927e91699d97f96d9de014c3fc7";
sha256 = "083f21hz6vqjpndkn27nsjnhnc5a4bw0cr26ryfqcvz275rj4k18";
};
buildInputs = [
@ -20,8 +20,10 @@ stdenv.mkDerivation rec {
substituteInPlace Makefile --replace /usr/local/bin/dmrconfig $out/bin/dmrconfig
'';
preInstall = ''
mkdir -p $out/bin
installPhase = ''
mkdir -p $out/bin $out/lib/udev/rules.d
make install
install 99-dmr.rules $out/lib/udev/rules.d/99-dmr.rules
'';
meta = with stdenv.lib; {