mirror of
https://github.com/oqyude/nixos.git
synced 2026-10-07 20:47:14 +03:00
br v4
This commit is contained in:
+41
-44
@@ -9,59 +9,56 @@ let
|
||||
...
|
||||
}:
|
||||
let
|
||||
mkHomeModule = username: {
|
||||
imports = [
|
||||
(./. + "/${xlib.device.type}.nix")
|
||||
];
|
||||
home = {
|
||||
username = username;
|
||||
stateVersion = lib.mkDefault "26.05";
|
||||
homeDirectory =
|
||||
if username == "root" then lib.mkDefault "/${username}" else lib.mkDefault "/home/${username}";
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
};
|
||||
# Headless hosts: no GUI user dirs
|
||||
xdg =
|
||||
lib.mkIf
|
||||
(builtins.elem xlib.device.type [
|
||||
"server"
|
||||
"vds"
|
||||
"wsl"
|
||||
])
|
||||
{
|
||||
mkUser =
|
||||
username:
|
||||
{
|
||||
imports ? [ ],
|
||||
headless ? false,
|
||||
}:
|
||||
{
|
||||
inherit imports;
|
||||
home = {
|
||||
username = username;
|
||||
stateVersion = lib.mkDefault "26.05";
|
||||
homeDirectory =
|
||||
if username == "root" then lib.mkDefault "/${username}" else lib.mkDefault "/home/${username}";
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
};
|
||||
# Headless hosts: no GUI user dirs
|
||||
xdg = lib.mkIf headless {
|
||||
enable = true;
|
||||
autostart.enable = true;
|
||||
userDirs = {
|
||||
enable = true;
|
||||
autostart.enable = true;
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = false;
|
||||
desktop = null;
|
||||
documents = null;
|
||||
download = null;
|
||||
music = null;
|
||||
pictures = null;
|
||||
publicShare = null;
|
||||
templates = null;
|
||||
videos = null;
|
||||
};
|
||||
createDirectories = false;
|
||||
desktop = null;
|
||||
documents = null;
|
||||
download = null;
|
||||
music = null;
|
||||
pictures = null;
|
||||
publicShare = null;
|
||||
templates = null;
|
||||
videos = null;
|
||||
};
|
||||
};
|
||||
mkRootModule = username: {
|
||||
home = {
|
||||
username = username;
|
||||
stateVersion = lib.mkDefault "26.05";
|
||||
homeDirectory =
|
||||
if username == "root" then lib.mkDefault "/${username}" else lib.mkDefault "/home/${username}";
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users = {
|
||||
root = mkRootModule "root";
|
||||
"${xlib.device.username}" = mkHomeModule xlib.device.username;
|
||||
root = mkUser "root" { };
|
||||
"${xlib.device.username}" = mkUser xlib.device.username {
|
||||
imports = [
|
||||
(./. + "/${xlib.device.type}.nix")
|
||||
];
|
||||
headless = builtins.elem xlib.device.type [
|
||||
"server"
|
||||
"vds"
|
||||
"wsl"
|
||||
];
|
||||
};
|
||||
};
|
||||
sharedModules = [
|
||||
inputs.plasma-manager.homeModules.plasma-manager
|
||||
|
||||
+3
-10
@@ -5,20 +5,13 @@
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
symlinksPaths = {
|
||||
"${config.home.homeDirectory}/External/Music" = "Music";
|
||||
};
|
||||
mkLinks = lib.mapAttrs' (sourcePath: targetPath: {
|
||||
name = targetPath;
|
||||
value.source = config.lib.file.mkOutOfStoreSymlink "${sourcePath}";
|
||||
}) symlinksPaths;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./minimal.nix
|
||||
];
|
||||
home.file = mkLinks;
|
||||
home.file = xlib.helpers.mkSymlinks config {
|
||||
"${config.home.homeDirectory}/External/Music" = "Music";
|
||||
};
|
||||
home.activation = {
|
||||
yaziSync = ''
|
||||
${pkgs.rsync}/bin/rsync -Lrv --no-A --no-X "${config.home.homeDirectory}/.config/yazi/" "${xlib.dirs.storage}/yazi/"
|
||||
|
||||
+5
-12
@@ -5,23 +5,16 @@
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
symlinksPaths = {
|
||||
"${config.home.homeDirectory}/External/Music" = "Music";
|
||||
"${xlib.dirs.wsl-home}" = "External";
|
||||
"${xlib.dirs.wsl-storage}" = "Storage";
|
||||
};
|
||||
mkLinks = lib.mapAttrs' (sourcePath: targetPath: {
|
||||
name = targetPath;
|
||||
value.source = config.lib.file.mkOutOfStoreSymlink "${sourcePath}";
|
||||
}) symlinksPaths;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./apps
|
||||
./minimal.nix
|
||||
];
|
||||
home.file = mkLinks;
|
||||
home.file = xlib.helpers.mkSymlinks config {
|
||||
"${config.home.homeDirectory}/External/Music" = "Music";
|
||||
"${xlib.dirs.wsl-home}" = "External";
|
||||
"${xlib.dirs.wsl-storage}" = "Storage";
|
||||
};
|
||||
home.activation = {
|
||||
yaziSync = ''
|
||||
${pkgs.rsync}/bin/rsync -Lrv "${config.home.homeDirectory}/.config/yazi/" "${xlib.dirs.wsl-storage}/yazi/"
|
||||
|
||||
Reference in New Issue
Block a user