mob next [ci-skip] [ci skip] [skip ci]
lastFile:machines/rana/configuration.nix
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "emmie";
|
||||
manifest.description = "Home manager for user Emmie";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
username = "emmie";
|
||||
in
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.${username} = ./home.nix;
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
emmie = lib.modules.importApply ./emmie/default.nix { };
|
||||
in
|
||||
{
|
||||
clan.modules = {
|
||||
emmie-home = emmie;
|
||||
};
|
||||
|
||||
}
|
||||
26
modules/home-manager/emmie/default.nix
Normal file
26
modules/home-manager/emmie/default.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
username = "emmie";
|
||||
in
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"video"
|
||||
"networkmanager"
|
||||
];
|
||||
};
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.${username} = ./home.nix;
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
}
|
||||
@@ -18,7 +18,6 @@ in
|
||||
brave
|
||||
firefox
|
||||
keepassxc
|
||||
drawio
|
||||
vlc
|
||||
];
|
||||
};
|
||||
7
modules/home-manager/flake-module.nix
Normal file
7
modules/home-manager/flake-module.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
flake.nixosModules = {
|
||||
home.emmie = {
|
||||
imports = [ ./emmie ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -3,6 +3,9 @@
|
||||
common = {
|
||||
imports = [ ./common.nix ];
|
||||
};
|
||||
personalComputer = {
|
||||
imports = [ ./personal-computer ];
|
||||
};
|
||||
think-gtcm = {
|
||||
imports = [ ./think-gtcm.nix ];
|
||||
};
|
||||
|
||||
1
modules/nixos/personal-computer/default.nix
Normal file
1
modules/nixos/personal-computer/default.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ imports = [ ./printing.nix ]; }
|
||||
63
modules/nixos/personal-computer/printing.nix
Normal file
63
modules/nixos/personal-computer/printing.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
allowManageGroups = [
|
||||
"root"
|
||||
"wheel"
|
||||
"lpadmin"
|
||||
];
|
||||
polkitAllowGroups = builtins.concatStringsSep "||" (
|
||||
builtins.map (group: ''subject.isInGroup("${group}")'') allowManageGroups
|
||||
);
|
||||
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 = lib.pipe config.users.users [
|
||||
(lib.attrsets.filterAttrs (name: value: value.isNormalUser))
|
||||
(lib.attrsets.attrsToList)
|
||||
(lib.map (user: user.name))
|
||||
];
|
||||
|
||||
users.groups.lp.members = lib.pipe config.users.users [
|
||||
(lib.attrsets.filterAttrs (name: value: value.isNormalUser))
|
||||
(lib.attrsets.attrsToList)
|
||||
(lib.map (user: user.name))
|
||||
];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user