mob next [ci-skip] [ci skip] [skip ci]
lastFile:modules/clan/home-profiles/home-user/default.nix
This commit is contained in:
@@ -3,9 +3,6 @@
|
||||
common = {
|
||||
imports = [ ./common.nix ];
|
||||
};
|
||||
personalComputer = {
|
||||
imports = [ ./personal-computer ];
|
||||
};
|
||||
think-gtcm = {
|
||||
imports = [ ./think-gtcm.nix ];
|
||||
};
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{ inputs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
(inputs.import-tree.initFilter (p: !lib.hasSuffix "default.nix" p) ./.)
|
||||
];
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
allowManageGroups = [
|
||||
"root"
|
||||
"wheel"
|
||||
"lpadmin"
|
||||
];
|
||||
polkitAllowGroups = builtins.concatStringsSep "||" (
|
||||
builtins.map (group: ''subject.isInGroup("${group}")'') allowManageGroups
|
||||
);
|
||||
|
||||
printerMember = lib.map (user: user.name) (
|
||||
lib.attrsets.attrsToList (
|
||||
lib.attrsets.filterAttrs (name: value: value.isNormalUser) config.users.users
|
||||
)
|
||||
);
|
||||
|
||||
in
|
||||
{
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = [
|
||||
pkgs.brlaser
|
||||
pkgs.gutenprint
|
||||
];
|
||||
|
||||
extraFilesConf = ''
|
||||
SystemGroup ${builtins.concatStringsSep " " allowManageGroups}
|
||||
'';
|
||||
};
|
||||
|
||||
security.polkit = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
polkit.addRule(function(action, subject) {
|
||||
var actionMatchs = (
|
||||
action.id.indexOf('org.opensuse.cupspkhelper.mechanism.') === 0
|
||||
);
|
||||
if (actionMatchs) {
|
||||
if (${polkitAllowGroups}) {
|
||||
return polkit.Result.YES
|
||||
}
|
||||
}
|
||||
});
|
||||
'';
|
||||
};
|
||||
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
users.groups.lpadmin.members = printerMember;
|
||||
users.groups.lp.members = printerMember;
|
||||
users.groups.scanner.members = printerMember;
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
users.mutableUsers = lib.mkForce true;
|
||||
}
|
||||
Reference in New Issue
Block a user