From 1361348bf1aed2494ce5d51e30ca4a76384483f1 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Wed, 27 Apr 2022 13:10:16 +0200 Subject: [PATCH] cups: Add module --- hosts/nishimiya.nix | 6 ++++-- modules/default.nix | 1 + modules/services/cups/default.nix | 23 +++++++++++++++++++++++ modules/users/alexander.nix | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 modules/services/cups/default.nix diff --git a/hosts/nishimiya.nix b/hosts/nishimiya.nix index 8082639..85b80f3 100644 --- a/hosts/nishimiya.nix +++ b/hosts/nishimiya.nix @@ -36,7 +36,7 @@ # NOTE: See https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/e495/default.nix#L12 kernelParams = [ "acpi_backlight=native" ]; }; - + ptw = { programs = { alacritty.enable = true; @@ -51,9 +51,11 @@ zsh.enable = true; git.enable = true; office.enable = true; + plasma.enable = true; }; services = { - gdm.enable = true; + cups.enable = true; + gnome.enable = true; kanshi = let horizontal = "Samsung Electric Company C27F398 H4ZR101145"; diff --git a/modules/default.nix b/modules/default.nix index 8de4e45..bbcc38b 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -32,6 +32,7 @@ ./services/gamemode ./services/i18n ./services/greetd + ./services/cups # User #./users/default.nix diff --git a/modules/services/cups/default.nix b/modules/services/cups/default.nix new file mode 100644 index 0000000..0bbd285 --- /dev/null +++ b/modules/services/cups/default.nix @@ -0,0 +1,23 @@ +{ lib, config, pkgs, ...}: + +let + cfg = config.ptw.services.cups; +in { + options.ptw.services.cups = { + enable = lib.mkEnableOption "Enable Cups"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ gnome.simple-scan ]; + + services.printing = { + enable = true; + drivers = with pkgs; [ hplip ]; + }; + + hardware.sane = { + enable = true; + extraBackends = with pkgs; [ sane-airscan hplip ]; + }; + }; +} diff --git a/modules/users/alexander.nix b/modules/users/alexander.nix index d029d21..2c817a6 100644 --- a/modules/users/alexander.nix +++ b/modules/users/alexander.nix @@ -4,7 +4,7 @@ config = lib.mkIf (config.ptw.system.singleUser == "alexander") { users.users.alexander = { isNormalUser = true; - extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" ]; + extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" "scanner" "lp" ]; hashedPassword = "$5$i4aZuQ/WXP.rFOc$lCzDqbrVsqBQt5954O.3bFPknD0jn27MmqzmE4DIAEC"; shell = pkgs.zsh; useDefaultShell = false;