Hope this fixes home manager

This commit is contained in:
Johannes Jöns 2023-02-24 16:24:05 +01:00
parent f5514728a9
commit 441028f65b
4 changed files with 277 additions and 271 deletions

View file

@ -10,6 +10,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
imports = [ ./home.nix ];
users.users.jopejoe1 = { users.users.jopejoe1 = {
isNormalUser = true; isNormalUser = true;
description = "jopejoe1 🚫"; description = "jopejoe1 🚫";
@ -25,7 +26,5 @@ in
ark ark
]; ];
}; };
home-manager.users.jopejoe1 = import ./home.nix;
}; };
} }

View file

@ -1,14 +1,17 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let cfg = config.home-manager.users.jopejoe1;
in
{ {
home-manager.users.jopejoe1 = {
home = { home = {
# Basic information for home-manager # Basic information for home-manager
username = "jopejoe1"; username = "jopejoe1";
homeDirectory = "/home/${config.home.username}"; homeDirectory = "/home/${cfg.home.username}";
# Enviroment variables # Enviroment variables
sessionVariables = { sessionVariables = {
XCOMPOSECACHE = "${config.xdg.cacheHome}/X11/xcompos"; XCOMPOSECACHE = "${cfg.xdg.cacheHome}/X11/xcompos";
XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority";
}; };
@ -29,28 +32,28 @@
xdg = { xdg = {
enable = true; enable = true;
mime.enable = true; mime.enable = true;
cacheHome = "${config.home.homeDirectory}/.cache"; cacheHome = "${cfg.home.homeDirectory}/.cache";
configHome = "${config.home.homeDirectory}/.config"; configHome = "${cfg.home.homeDirectory}/.config";
dataHome = "${config.home.homeDirectory}/.local/share"; dataHome = "${cfg.home.homeDirectory}/.local/share";
stateHome = "${config.home.homeDirectory}/.local/state"; stateHome = "${cfg.home.homeDirectory}/.local/state";
userDirs = { userDirs = {
enable = true; enable = true;
createDirectories = false; createDirectories = false;
desktop = "${config.home.homeDirectory}/Desktop"; desktop = "${cfg.home.homeDirectory}/Desktop";
documents = "${config.home.homeDirectory}/Documents"; documents = "${cfg.home.homeDirectory}/Documents";
download = "${config.home.homeDirectory}/Downloads"; download = "${cfg.home.homeDirectory}/Downloads";
music = "${config.home.homeDirectory}/Music"; music = "${cfg.home.homeDirectory}/Music";
pictures = "${config.home.homeDirectory}/Pictures"; pictures = "${cfg.home.homeDirectory}/Pictures";
publicShare = "${config.home.homeDirectory}/Public"; publicShare = "${cfg.home.homeDirectory}/Public";
templates = "${config.home.homeDirectory}/Templates"; templates = "${cfg.home.homeDirectory}/Templates";
videos = "${config.home.homeDirectory}/Videos"; videos = "${cfg.home.homeDirectory}/Videos";
}; };
}; };
gtk = { gtk = {
enable = true; enable = true;
gtk2 = { gtk2 = {
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; configLocation = "${cfg.xdg.configHome}/gtk-2.0/gtkrc";
}; };
gtk3 = { gtk3 = {
extraConfig = { extraConfig = {
@ -103,7 +106,7 @@
}; };
bash = { bash = {
enable = true; enable = true;
historyFile = "${config.xdg.stateHome}/bash/history"; historyFile = "${cfg.xdg.stateHome}/bash/history";
shellAliases = { shellAliases = {
gc = "sudo nix store gc"; gc = "sudo nix store gc";
rb = "sudo git -C /etc/nixos pull && sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch && sudo git -C /etc/nixos add . && sudo git -C /etc/nixos commit -m 'Updated flake.lock' && sudo git -C /etc/nixos push"; rb = "sudo git -C /etc/nixos pull && sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch && sudo git -C /etc/nixos add . && sudo git -C /etc/nixos commit -m 'Updated flake.lock' && sudo git -C /etc/nixos push";
@ -111,14 +114,14 @@
}; };
zsh = { zsh = {
enable = true; enable = true;
shellAliases = config.programs.bash.shellAliases; shellAliases = cfg.programs.bash.shellAliases;
enableAutosuggestions = true; enableAutosuggestions = true;
enableCompletion = true; enableCompletion = true;
enableSyntaxHighlighting = true; enableSyntaxHighlighting = true;
enableVteIntegration = true; enableVteIntegration = true;
dotDir = ".config/zsh"; dotDir = ".config/zsh";
}; };
fish.shellAbbrs = config.programs.bash.shellAliases; fish.shellAbbrs = cfg.programs.bash.shellAliases;
thunderbird = { thunderbird = {
enable = false; enable = false;
profiles = { profiles = {
@ -140,7 +143,7 @@
DisableTelemetry = true; DisableTelemetry = true;
DisableFirefoxAccounts = true; DisableFirefoxAccounts = true;
DisableFormHistory = true; DisableFormHistory = true;
DefaultDownloadDirectory = "${config.xdg.userDirs.download}"; DefaultDownloadDirectory = "${cfg.xdg.userDirs.download}";
DontCheckDefaultBrowser = true; DontCheckDefaultBrowser = true;
ExtensionUpdate = false; ExtensionUpdate = false;
NoDefaultBookmarks = true; NoDefaultBookmarks = true;
@ -217,7 +220,7 @@
}; };
"NixOS Wiki" = { "NixOS Wiki" = {
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
icon = "${config.programs.firefox.profiles.default.search.engines."Nix Packages".icon}"; icon = "${cfg.programs.firefox.profiles.default.search.engines."Nix Packages".icon}";
definedAliases = [ "@nw" ]; definedAliases = [ "@nw" ];
}; };
"Bing".metaData.hidden = true; "Bing".metaData.hidden = true;
@ -244,4 +247,5 @@
}; };
}; };
}; };
};
} }

View file

@ -10,7 +10,6 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
imports = [ ./home.nix ];
home-manager.users.root = import ./home.nix;
}; };
} }

View file

@ -1,14 +1,17 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let cfg = config.home-manager.users.root;
in
{ {
home-manager.users.root = {
home = { home = {
# Basic information for home-manager # Basic information for home-manager
username = "root"; username = "root";
homeDirectory = "/${config.home.username}"; homeDirectory = "/${cfg.home.username}";
# Enviroment variables # Enviroment variables
sessionVariables = { sessionVariables = {
XCOMPOSECACHE = "${config.xdg.cacheHome}/X11/xcompos"; XCOMPOSECACHE = "${cfg.xdg.cacheHome}/X11/xcompos";
XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority";
}; };
@ -18,21 +21,21 @@
xdg = { xdg = {
enable = true; enable = true;
mime.enable = true; mime.enable = true;
cacheHome = "${config.home.homeDirectory}/.cache"; cacheHome = "${cfg.home.homeDirectory}/.cache";
configHome = "${config.home.homeDirectory}/.config"; configHome = "${cfg.home.homeDirectory}/.config";
dataHome = "${config.home.homeDirectory}/.local/share"; dataHome = "${cfg.home.homeDirectory}/.local/share";
stateHome = "${config.home.homeDirectory}/.local/state"; stateHome = "${cfg.home.homeDirectory}/.local/state";
userDirs = { userDirs = {
enable = true; enable = true;
createDirectories = false; createDirectories = false;
desktop = "${config.home.homeDirectory}/Desktop"; desktop = "${cfg.home.homeDirectory}/Desktop";
documents = "${config.home.homeDirectory}/Documents"; documents = "${cfg.home.homeDirectory}/Documents";
download = "${config.home.homeDirectory}/Downloads"; download = "${cfg.home.homeDirectory}/Downloads";
music = "${config.home.homeDirectory}/Music"; music = "${cfg.home.homeDirectory}/Music";
pictures = "${config.home.homeDirectory}/Pictures"; pictures = "${cfg.home.homeDirectory}/Pictures";
publicShare = "${config.home.homeDirectory}/Public"; publicShare = "${cfg.home.homeDirectory}/Public";
templates = "${config.home.homeDirectory}/Templates"; templates = "${cfg.home.homeDirectory}/Templates";
videos = "${config.home.homeDirectory}/Videos"; videos = "${cfg.home.homeDirectory}/Videos";
}; };
}; };
@ -46,13 +49,14 @@
}; };
bash = { bash = {
enable = true; enable = true;
historyFile = "${config.xdg.stateHome}/bash/history"; historyFile = "${cfg.xdg.stateHome}/bash/history";
shellAliases = { shellAliases = {
gc = "sudo nix store gc"; gc = "sudo nix store gc";
rb = "sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch"; rb = "sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch";
}; };
}; };
zsh.shellAliases = config.programs.bash.shellAliases; zsh.shellAliases = cfg.programs.bash.shellAliases;
fish.shellAbbrs = config.programs.bash.shellAliases; fish.shellAbbrs = cfg.programs.bash.shellAliases;
};
}; };
} }