system-manager-wakasu
  1{
  2  libx,
  3  pkgs,
  4  lib,
  5  globals,
  6  ...
  7}:
  8{
  9
 10  imports = [
 11    ../common/hardware/laptop.nix
 12    ../common/programs/direnv.nix
 13    ../common/programs/git.nix
 14    ../common/programs/tmux.nix
 15    ../common/services/networkmanager.nix
 16    ../common/services/containers.nix
 17    ../common/services/docker.nix
 18    ../common/services/libvirt.nix
 19
 20    ../redhat
 21  ];
 22
 23  programs.obs-studio = {
 24    enable = true;
 25    plugins = with pkgs.obs-studio-plugins; [
 26      wlrobs
 27      obs-backgroundremoval
 28      obs-pipewire-audio-capture
 29      input-overlay
 30    ];
 31  };
 32
 33  services = {
 34    getty = {
 35      autologinOnce = true;
 36      autologinUser = "vincent";
 37    };
 38    # TODO probably migrate elsewhere
 39    kanata = {
 40      enable = true;
 41      package = pkgs.kanata-with-cmd;
 42      keyboards.x1 = {
 43        devices = [ "/dev/input/event0" ]; # internal keyboard
 44        config = builtins.readFile (./. + "/main.kbd");
 45        extraDefCfg = ''
 46          	danger-enable-cmd yes
 47            process-unmapped-keys yes
 48            override-release-on-activation yes
 49            concurrent-tap-hold yes
 50        '';
 51      };
 52    };
 53    dictd = {
 54      enable = true;
 55      DBs = with pkgs.dictdDBs; [
 56        wiktionary
 57        wordnet
 58        fra2eng
 59        eng2fra
 60      ];
 61    };
 62    locate = {
 63      enable = true;
 64      pruneBindMounts = true;
 65    };
 66    wireguard = {
 67      enable = true;
 68      ips = libx.wg-ips globals.machines.kyushu.net.vpn.ips;
 69      endpoint = "${globals.net.vpn.endpoint}";
 70      endpointPublicKey = "${globals.machines.kerkouane.net.vpn.pubkey}";
 71    };
 72    hardware.bolt.enable = true;
 73    printing = {
 74      enable = true;
 75      drivers = with pkgs; [
 76        cnijfilter2
 77        gutenprint
 78        gutenprintBin
 79      ];
 80    };
 81  };
 82
 83  # XXX: it doesn't really work...
 84  # hardware.printers = {
 85  #   ensurePrinters = [
 86  #     {
 87  #       name = "Canon_MX530_series";
 88  #       location = "Home";
 89  #       deviceUri = "dnssd://Canon%20MX530%20series._ipp._tcp.local/?uuid=00000000-0000-1000-8000-D8492F0F31CC";
 90  #       model = "gutenprint.5.3://bjc-MX530-series/expert Canon MX530 series - CUPS+Gutenprint v5.3.4";
 91  #       # deviceUri = "http://192.168.178.2:631/printers/Dell_1250c";
 92  #       # model = "drv:///sample.drv/generic.ppd";
 93  #       ppdOptions = {
 94  #         PageSize = "A4";
 95  #       };
 96  #     }
 97  #   ];
 98  #   ensureDefaultPrinter = "Canon_MX530_series";
 99  # };
100
101  hardware.keyboard.qmk.enable = true;
102
103  services.udev.packages = [ pkgs.sane-airscan ];
104  hardware.sane = {
105    enable = true;
106    extraBackends = [ pkgs.sane-airscan ];
107    openFirewall = true;
108    netConf = "192.168.12.70";
109  };
110
111  environment.systemPackages = with pkgs; [
112    kanata
113    nixos-rebuild-ng
114    # go-org-readwise # FIXME: will add it back from its new place.
115    battery-monitor
116    # backup
117    restic # TODO: will probably move this to it's own configuration some day
118    virt-manager
119  ];
120
121  # Make sure we don't start docker until required
122  systemd.services.docker.wantedBy = lib.mkForce [ ];
123}