From 57ae89a63d1d21884861df02b5b552696353eb7a Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 2 Jan 2017 14:48:45 +0100 Subject: machines/managed: Implement a preliminary profile Currently I just needed to support HP printers and scanners among all the managed machines, so I thought it would be a good oportunity to start a common profile for end user machines. Right now there isn't that much factored out yet, but instead of copy & pasting the printer/scanner config into all three machines I'm putting it into the profile. Signed-off-by: aszlig --- modules/user/aszlig/profiles/managed.nix | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 modules/user/aszlig/profiles/managed.nix (limited to 'modules/user') diff --git a/modules/user/aszlig/profiles/managed.nix b/modules/user/aszlig/profiles/managed.nix new file mode 100644 index 00000000..4ad4d897 --- /dev/null +++ b/modules/user/aszlig/profiles/managed.nix @@ -0,0 +1,39 @@ +{ pkgs, unfreeAndNonDistributablePkgs, config, lib, ... }: + +let + inherit (lib) mkIf mkEnableOption mkOption; + cfg = config.vuizvui.user.aszlig.profiles.managed; + inherit (cfg) mainUser; + +in { + options.vuizvui.user.aszlig.profiles.managed = { + enable = mkEnableOption "common profile for aszlig's managed machines"; + mainUser = mkOption { + example = "foobar"; + description = '' + Main user account of the managed system. + ''; + }; + }; + + config = mkIf cfg.enable { + # Printing for the most common printers among the managed machines. + services.printing.enable = true; + services.printing.drivers = [ + pkgs.gutenprint + unfreeAndNonDistributablePkgs.hplipWithPlugin + ]; + + # And also most common scanners are also HP ones. + hardware.sane.enable = true; + hardware.sane.extraBackends = [ + unfreeAndNonDistributablePkgs.hplipWithPlugin + ]; + + users.users.${mainUser} = { + isNormalUser = true; + uid = 1000; + extraGroups = [ "networkmanager" "scanner" "video" "wheel" ]; + }; + }; +} -- cgit 1.4.1