Skip to content

Commit 197ac60

Browse files
authored
Merge pull request #109 from darkone-linux/108-fix-imprimantes
#108 Fixes impression et scan
2 parents db8664e + f5d65a8 commit 197ac60

File tree

3 files changed

+61
-37
lines changed

3 files changed

+61
-37
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ result- # Generated by nix fast build
88
*.qcow2
99
iso
1010
__pycache__/
11-
./docs/_site
11+
./docs/_site
12+
.idea

modules/default/printing.nix

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,71 @@
1-
{ lib, config, pkgs, ... }:
2-
31
{
2+
lib,
3+
config,
4+
pkgs,
5+
...
6+
}:
47

8+
{
59
options.glf.printing.enable = lib.mkOption {
610
description = "Enable GLF printing configurations.";
711
type = lib.types.bool;
812
default = true;
913
};
1014

11-
config = lib.mkIf config.glf.printing.enable (let
12-
allUsers = builtins.attrNames config.users.users;
13-
normalUsers = builtins.filter (user: config.users.users.${user}.isNormalUser == true) allUsers;
14-
in {
15-
# Configure printer
16-
services.printing = {
17-
enable = true;
18-
startWhenNeeded = true;
19-
drivers = with pkgs; [
20-
gutenprint
21-
hplip
22-
samsung-unified-linux-driver
23-
splix
24-
brlaser
25-
brgenml1lpr
26-
cnijfilter2
27-
];
28-
};
15+
config = lib.mkIf config.glf.printing.enable (
16+
let
17+
allUsers = builtins.attrNames config.users.users;
18+
normalUsers = builtins.filter (user: config.users.users.${user}.isNormalUser) allUsers;
19+
in
20+
{
2921

30-
# Enable autodiscovery
31-
services.avahi = {
32-
enable = true;
33-
nssmdns4 = true;
34-
openFirewall = true;
35-
};
22+
# Configure printer
23+
services.printing = {
24+
enable = true;
25+
startWhenNeeded = true;
26+
drivers = with pkgs; [
27+
brgenml1cupswrapper
28+
brgenml1lpr
29+
brlaser
30+
cnijfilter2
31+
epkowa
32+
gutenprint
33+
gutenprintBin
34+
hplip
35+
hplipWithPlugin
36+
samsung-unified-linux-driver
37+
splix
38+
];
39+
};
3640

37-
# Scanner support
38-
hardware.sane = {
39-
enable = true;
40-
extraBackends = with pkgs; [ sane-airscan epkowa ];
41-
};
41+
# To install printers manually
42+
programs.system-config-printer.enable = true;
4243

43-
# Add all users to group scanner and lp
44-
users.groups.scanner.members = normalUsers;
45-
users.groups.lp.members = normalUsers;
46-
});
44+
# Enable autodiscovery
45+
services.avahi = {
46+
enable = true;
47+
nssmdns4 = true;
48+
openFirewall = true;
49+
};
50+
51+
# systemd.services.cups-browsed.enable = false;
52+
hardware.sane = {
53+
enable = true;
54+
extraBackends = with pkgs; [
55+
hplipWithPlugin
56+
sane-airscan
57+
epkowa
58+
utsushi
59+
];
60+
};
61+
services.udev.packages = with pkgs; [
62+
sane-airscan
63+
utsushi
64+
];
4765

66+
# add all users to group scanner and lp
67+
users.groups.scanner.members = normalUsers;
68+
users.groups.lp.members = normalUsers;
69+
}
70+
);
4871
}

patches/calamares-nixos-extensions/modules/nixos/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def run():
550550
# Setup user
551551
if gs.value("username") is not None:
552552
fullname = gs.value("fullname")
553-
groups = ["networkmanager", "wheel"]
553+
groups = ["networkmanager", "wheel", "scanner", "lp", "disk"]
554554

555555
cfg += cfgusers
556556
catenate(variables, "username", gs.value("username"))

0 commit comments

Comments
 (0)