summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2020-02-23 16:12:11 +0100
committerSergiusz Bazanski <q3k@q3k.org>2020-02-23 18:07:00 +0100
commit621016bd9c16d64b4d51a6cb7a87e390d510508f (patch)
tree1bd1ea8f41cd230ba3811a155bcac98c3892bbab
parent1735eb0cf6f0cf20580555a5989ef4efd786fd2b (diff)
downloadbitvend-621016bd9c16d64b4d51a6cb7a87e390d510508f.tar.gz
bitvend-621016bd9c16d64b4d51a6cb7a87e390d510508f.tar.bz2
bitvend-621016bd9c16d64b4d51a6cb7a87e390d510508f.tar.xz
bitvend-621016bd9c16d64b4d51a6cb7a87e390d510508f.zip
module.nix: run as root
-rw-r--r--cygpio/cygpio.pyx2
-rw-r--r--default.nix6
-rw-r--r--module.nix22
3 files changed, 6 insertions, 24 deletions
diff --git a/cygpio/cygpio.pyx b/cygpio/cygpio.pyx
index dd0a931..4c689e3 100644
--- a/cygpio/cygpio.pyx
+++ b/cygpio/cygpio.pyx
@@ -52,7 +52,7 @@ cdef class CythonRaspiBackend(object):
self.tx_pin = tx_pin
cpdef open(self):
- # Enable full on debug
+ # Enable startup debug
gpioCfgSetInternals(gpioCfgGetInternals() | 8);
# Force usage of non-mailbox DMA
diff --git a/default.nix b/default.nix
index b83484f..de8951b 100644
--- a/default.nix
+++ b/default.nix
@@ -94,15 +94,17 @@ in with upstream; let
pigpio = stdenv.mkDerivation rec {
pname = "pigpio";
version = "74-q3k";
+ buildFlags = [ "STRIPLIB=echo" "STRIP=echo" "CFLAGS=-g" ];
installFlags = [ "DESTDIR=$(out)" "prefix=" ];
src = pkgs.fetchFromGitHub {
owner = "q3k";
repo = "pigpio";
- rev = "5a0b27c997631b3ba1a7778a176b6f5462233be4";
- sha256 = "1b55bzfsyghd2lrfqmz6g935zsmwnhbcscb4g11hxm3g7a68g9vv";
+ rev = "fa8c3ec41cb70da4d1868caec655d5f7d474573f";
+ sha256 = "0shd2p1w8k0iz7v5j81w8hw6hy67zxd6r4mvz2xflabiwblr5zi3";
};
+ dontStrip = true;
propagatedBuildInputs = [ raspberrypi-tools ];
};
diff --git a/module.nix b/module.nix
index b8149f5..bdfd06e 100644
--- a/module.nix
+++ b/module.nix
@@ -5,9 +5,6 @@ let
cfg = config.services.bitvend;
- bitvendUser = "bitvend";
- bitvendGroup = "bitvend";
-
bitvend = (import ./default.nix);
cfgFile = pkgs.writeText "bitvend.cfg"
''
@@ -58,20 +55,6 @@ in {
};
};
config = mkIf cfg.enable {
- ids.uids.bitvend = 2137;
- ids.gids.bitvend = 2137;
-
- users.users.bitvend = {
- name = bitvendUser;
- group = bitvendGroup;
- uid = config.ids.uids.bitvend;
- description = "Bitvend daemon user";
- home = cfg.stateDir;
- };
- users.groups.bitvend = {
- name = bitvendGroup;
- gid = config.ids.gids.bitvend;
- };
systemd.services.bitvend = {
environment = {
BITVEND_SETTINGS = cfgFile;
@@ -80,12 +63,9 @@ in {
script = ''
${bitvend}/bin/bitvend-run.py
'';
- serviceConfig = {
- User = bitvendUser;
- };
};
systemd.tmpfiles.rules = [
- "d '${cfg.stateDir}' 0750 '${bitvendUser}' '${bitvendGroup}' - -"
+ "d '${cfg.stateDir}' 0750 'root' 'root' - -"
];
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {