eufon

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

module.nix (1841B)


      1 { config, lib, pkgs, ... }:
      2 let eufon = pkgs.callPackage ./default.nix {}; in
      3 {
      4   systemd.services."eufon" = {
      5     wants = [
      6       "systemd-machined.service"
      7       "accounts-daemon.service"
      8       "systemd-udev-settle.service"
      9       "dbus.socket"
     10     ];
     11     aliases = [ "display-manager.service" ];
     12     after =  [
     13       "rc-local.service"
     14       "systemd-machined.service"
     15       "systemd-user-sessions.service"
     16       "getty@tty2.service"
     17       "plymouth-quit.service"
     18       "plymouth-start.service"
     19       "systemd-logind.service"
     20       "systemd-udev-settle.service"
     21     ];
     22     conflicts = [
     23       "getty@tty1.service"      # not sure if needed
     24       "getty@tty2.service"
     25       "plymouth-quit.service"
     26     ];
     27     wantedBy = [ "multi-user.target" ];
     28     serviceConfig =
     29       let run-eufon = pkgs.writeScript "run-eufon" ''
     30           #!${pkgs.bash}/bin/bash
     31           source ${config.system.build.setEnvironment}
     32           ${pkgs.dbus}/bin/dbus-run-session ${eufon}/bin/eufon
     33           systemd-cat echo "dbus-run-session $?"
     34         '';
     35       in {
     36         WorkingDirectory = "${eufon}";
     37         TTYPath = "/dev/tty2";
     38         TTYReset = "yes";
     39         TTYVHangup = "yes";
     40         TTYVTDisallocate = "yes";
     41         PAMName = "login";
     42         StandardInput = "tty";
     43         StandardError = "journal";
     44         StandardOutput = "journal";
     45         SyslogIdentifier = "eufon";
     46         User = "dan";
     47         ExecStart = run-eufon;
     48         Restart = "always";
     49       };
     50     environment = {
     51       NIX_PATH = "nixpkgs=${<nixpkgs>}";
     52     };
     53   };
     54   environment.systemPackages = with pkgs; [
     55     git eufon
     56   ];
     57 
     58   boot.postBootCommands = lib.mkOrder (-1) ''
     59     brightness=4000
     60     echo "Setting brightness to $brightness"
     61     echo $brightness > /sys/class/backlight/wled/brightness
     62   '';
     63 
     64   services.logind.extraConfig = ''
     65     HandlePowerKey=ignore
     66   '';
     67 }