From 6e03df40e751080c8308101753168ed1c6c79471 Mon Sep 17 00:00:00 2001 From: Stefan Ellmauthaler Date: Mon, 30 May 2022 16:06:21 +0200 Subject: [PATCH] Add communication tools module --- flake.lock | 7 ++- flake.nix | 2 +- machines/stel-xps/software.nix | 9 ++- modules/communication.nix | 20 +++++++ modules/graphical.nix | 100 ++++++++++++++++----------------- 5 files changed, 79 insertions(+), 59 deletions(-) create mode 100644 modules/communication.nix diff --git a/flake.lock b/flake.lock index 3c724cd..e94d454 100644 --- a/flake.lock +++ b/flake.lock @@ -219,15 +219,16 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1653643505, - "narHash": "sha256-VReVQKEfedov22lbZYQjOcIoxjOcLCSVWF8A2szoZ/k=", + "lastModified": 1652510778, + "narHash": "sha256-zldZ4SiwkISFXxrbY/UdwooIZ3Z/I6qKxtpc3zD0T/o=", "owner": "NixOS", "repo": "nix", - "rev": "ec07a70979a86cc436de7e46e03789b4606d25ab", + "rev": "65cd26eebbbf80eaf0d74092f09b737606cb4b5a", "type": "github" }, "original": { "owner": "NixOS", + "ref": "latest-release", "repo": "nix", "type": "github" } diff --git a/flake.nix b/flake.nix index 4cf74d3..b88b99e 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,7 @@ nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nix = { - url = "github:NixOS/nix"; + url = "github:NixOS/nix?ref=latest-release"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/machines/stel-xps/software.nix b/machines/stel-xps/software.nix index 396a74e..03ec831 100644 --- a/machines/stel-xps/software.nix +++ b/machines/stel-xps/software.nix @@ -1,11 +1,8 @@ -{ config, pkgs, ...}: +{ config, pkgs, ... }: { environment.systemPackages = with pkgs; [ brightnessctl - element-desktop - signal-desktop - teams - zoom-us + libreoffice-fresh ]; programs = { @@ -19,6 +16,8 @@ elss = { programs = { aspell.enable = true; + # Enable communication programs + communication.enable = true; emacs.enable = true; obsstudio.enable = true; python.enable = true; diff --git a/modules/communication.nix b/modules/communication.nix new file mode 100644 index 0000000..deee606 --- /dev/null +++ b/modules/communication.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: +with lib; { + options.elss.programs.communication.enable = mkEnableOption "enable the basic graphical communication tools"; + + config = + let + cfg = config.elss.programs.communication; + in + mkIf cfg.enable { + elss.graphical.enable = true; + environment.systemPackages = [ + element-desktop + jitsi-meet-electron + signal-dektop + skypeforlinux + teams + zoom-us + ]; + }; +} diff --git a/modules/graphical.nix b/modules/graphical.nix index 9fb2875..1783d61 100644 --- a/modules/graphical.nix +++ b/modules/graphical.nix @@ -1,8 +1,8 @@ { config, pkgs, lib, ... }: with lib; { - options.elss.graphical= { + options.elss.graphical = { enable = mkEnableOption "configure i3-based graphical layer"; - greeterCursorsize = mkOption{ + greeterCursorsize = mkOption { type = types.int; default = 16; description = '' @@ -17,63 +17,63 @@ with lib; { ''; }; }; - config = + config = let cfg = config.elss.graphical; #cursorsize = if config.variables.hostName == "nucturne" then 14 else 16; #xserverDPI = if config.variables.hostName == "stel-xps" then 180 else null; in - { - elss.users.x11.enable = true; - networking.networkmanager.enable = true; + mkIf cfg.enable { + elss.users.x11.enable = true; + networking.networkmanager.enable = true; - services = { - xserver = { + services = { + xserver = { + enable = true; + dpi = cfg.dpi; + displayManager.lightdm = { enable = true; - dpi = cfg.dpi; - displayManager.lightdm = { - enable = true; - greeters.gtk.cursorTheme.size = cfg.greeterCursorsize; - }; - windowManager.i3 = { - enable = true; - extraPackages = with pkgs; [ - rofi # launcher - polybarFull # bar - i3lock # lock screen - xss-lock - autorandr - ]; - extraSessionCommands = '' - ${pkgs.autorandr}/bin/autorandr -c - ''; - }; - layout = "us"; - xkbOptions = "eurosign:e"; + greeters.gtk.cursorTheme.size = cfg.greeterCursorsize; }; - gnome.gnome-keyring.enable = true; - - printing.enable = true; + windowManager.i3 = { + enable = true; + extraPackages = with pkgs; [ + rofi # launcher + polybarFull # bar + i3lock # lock screen + xss-lock + autorandr + ]; + extraSessionCommands = '' + ${pkgs.autorandr}/bin/autorandr -c + ''; + }; + layout = "us"; + xkbOptions = "eurosign:e"; }; + gnome.gnome-keyring.enable = true; - sound.enable = true; - - hardware = { - pulseaudio.enable = true; - bluetooth.enable = true; - }; - - services.blueman.enable = true; - - environment.systemPackages = with pkgs; [ - firefox - thunderbird - okular - texlive.combined.scheme-full - usbutils - keepassxc - gnome.libsecret - arandr - ]; + printing.enable = true; }; + + sound.enable = true; + + hardware = { + pulseaudio.enable = true; + bluetooth.enable = true; + }; + + services.blueman.enable = true; + + environment.systemPackages = with pkgs; [ + firefox + thunderbird + okular + texlive.combined.scheme-full + usbutils + keepassxc + gnome.libsecret + arandr + ]; + }; }