mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-10 02:49:41 +00:00
Restructure home-manager config
This commit is contained in:
parent
019372838b
commit
b4acb6e15f
|
@ -4,11 +4,6 @@ let
|
|||
username = config.myOptions.system.username;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./packages
|
||||
./programs
|
||||
];
|
||||
|
||||
home-manager = lib.mkIf myHmConf.enabled {
|
||||
# Use verbose mode for home-manager
|
||||
verbose = true;
|
||||
|
@ -31,9 +26,18 @@ in
|
|||
extraSpecialArgs = { inherit inputs self; };
|
||||
|
||||
users.${username} = {
|
||||
# These imports will be scoped under this key so all settings
|
||||
# in them will be added to `home-manager.users.${username}`..
|
||||
imports = [
|
||||
./packages
|
||||
./programs
|
||||
];
|
||||
|
||||
config = {
|
||||
# Let home-manager manage itself in standalone mode
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Basic user config
|
||||
home = {
|
||||
inherit username;
|
||||
homeDirectory = "/home/${username}";
|
||||
|
@ -41,4 +45,5 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
username = config.myOptions.system.username;
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
fzf # fuzzy finder
|
||||
jq # JSON processor
|
||||
|
@ -41,5 +36,4 @@ in
|
|||
meson # C/C++ build system
|
||||
gh # GitHub CLI tool
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
username = config.myOptions.system.username;
|
||||
|
||||
inherit (lib.meta) getExe getExe';
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
programs.zsh.shellAliases = {
|
||||
# I'm not the greatest typist
|
||||
sl = "ls";
|
||||
|
@ -60,5 +57,4 @@ in
|
|||
# Expand aliases from sudo
|
||||
sudo = "sudo ";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,18 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
username = config.myOptions.system.username;
|
||||
hmCfg = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
{ config, pkgs, ... }: {
|
||||
imports = [
|
||||
./plugins.nix
|
||||
./aliases.nix
|
||||
];
|
||||
|
||||
programs.zsh.enable = true;
|
||||
users.users.${username}.shell = pkgs.zsh;
|
||||
|
||||
home-manager.users.${username} = {
|
||||
config = {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
|
@ -25,7 +17,7 @@ in
|
|||
share = true;
|
||||
|
||||
# don't clutter $HOME
|
||||
path = "${hmCfg.xdg.dataHome}/zsh/zsh_history";
|
||||
path = "${config.xdg.dataHome}/zsh/zsh_history";
|
||||
|
||||
# save timestamps to histfile
|
||||
extended = true;
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
username = config.myOptions.system.username;
|
||||
inherit (pkgs) fetchFromGitHub;
|
||||
in
|
||||
{
|
||||
|
||||
home-manager.users.${username} = {
|
||||
programs.zsh.plugins = [
|
||||
{
|
||||
name = "zsh-nix-shell";
|
||||
|
@ -37,5 +34,4 @@ in
|
|||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
{ config, lib, ... }: with lib; let
|
||||
{ config, lib, pkgs, ... }: with lib; let
|
||||
cfg = config.myOptions.system;
|
||||
in
|
||||
{
|
||||
networking.hostName = cfg.hostname;
|
||||
|
||||
# Default shell for the user
|
||||
programs.zsh.enable = true;
|
||||
|
||||
users = {
|
||||
# Prevent mutating users outside of our configurations.
|
||||
# TODO: Solve this, currentry it fails with no password
|
||||
|
@ -15,6 +18,7 @@ in
|
|||
users.${cfg.username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue