mob next [ci-skip] [ci skip] [skip ci]

lastFile:machines/rana/configuration.nix
This commit is contained in:
2026-01-13 11:25:39 +07:00
parent 77499682da
commit 395c17822d
10 changed files with 107 additions and 51 deletions

View File

@@ -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;
};
};
};
}

View File

@@ -1,10 +0,0 @@
{ lib, ... }:
let
emmie = lib.modules.importApply ./emmie/default.nix { };
in
{
clan.modules = {
emmie-home = emmie;
};
}

View 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;
};
}

View File

@@ -18,7 +18,6 @@ in
brave
firefox
keepassxc
drawio
vlc
];
};

View File

@@ -0,0 +1,7 @@
{
flake.nixosModules = {
home.emmie = {
imports = [ ./emmie ];
};
};
}

View File

@@ -3,6 +3,9 @@
common = {
imports = [ ./common.nix ];
};
personalComputer = {
imports = [ ./personal-computer ];
};
think-gtcm = {
imports = [ ./think-gtcm.nix ];
};

View File

@@ -0,0 +1 @@
{ imports = [ ./printing.nix ]; }

View 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))
];
}