diff options
author | aszlig <aszlig@redmoonstudios.org> | 2017-01-02 14:48:45 +0100 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2017-01-02 15:25:56 +0100 |
commit | 57ae89a63d1d21884861df02b5b552696353eb7a (patch) | |
tree | 2581ff4ca52492ee7b126d7eb5c411343aa11b0b /modules/user | |
parent | 64daeabbb7b85f1c24156173673f8bfb9c3d5fcb (diff) |
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/aszlig/profiles/managed.nix | 39 |
1 files changed, 39 insertions, 0 deletions
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" ]; + }; + }; +} |