services: home-manager init with kdeconnect and pkgsets integration
This commit is contained in:
parent
1861afd4a7
commit
15cb1af8ac
4 changed files with 75 additions and 0 deletions
|
@ -6,6 +6,10 @@
|
|||
nixpkgs-unstable.url = "github:/NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:/NixOS/nixpkgs/nixos-unstable";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
mailserver.url = "gitlab:/simple-nixos-mailserver/nixos-mailserver";
|
||||
|
|
45
services/home.nix
Normal file
45
services/home.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
lib,
|
||||
fn,
|
||||
pkgs,
|
||||
config,
|
||||
home-manager,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
{
|
||||
imports = [
|
||||
home-manager.nixosModules.home-manager
|
||||
];
|
||||
}
|
||||
// mkIf (elem "home" config.machine.services) {
|
||||
home-manager = {
|
||||
users =
|
||||
let
|
||||
homeFiles = fn.lsfRec (toString ./home) true;
|
||||
in
|
||||
listToAttrs (
|
||||
map (user: {
|
||||
name = user.name;
|
||||
value =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.stateVersion = "25.05";
|
||||
imports = homeFiles;
|
||||
};
|
||||
}) config.machine.users
|
||||
);
|
||||
extraSpecialArgs = {
|
||||
inherit (config.machine) pkgsets;
|
||||
# config.machine.users as set (user name as key)
|
||||
users = (
|
||||
listToAttrs (
|
||||
map (user: {
|
||||
name = user.name;
|
||||
value = user;
|
||||
}) config.machine.users
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
10
services/home/kdeconnect.nix
Normal file
10
services/home/kdeconnect.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
users,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (lib.elem "kdeconnect" users."${config.home.username}".services) {
|
||||
services.kdeconnect.enable = true;
|
||||
}
|
16
services/home/userPackages.nix
Normal file
16
services/home/userPackages.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
users,
|
||||
pkgsets,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
user = users."${config.home.username}";
|
||||
in
|
||||
lib.mkIf (user ? pkgs) {
|
||||
home.packages = lib.flatten (
|
||||
map (setName: lib.optionals (pkgsets ? "${setName}") pkgsets."${setName}".pkgwrap) user.pkgs
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue