moved home-manager options to the "home" namespace

this frees up the "host" namespace for host-wide options.
This commit is contained in:
Gabe Venberg 2024-04-23 16:56:34 -05:00
parent ec2a7506a3
commit 9eb783a3e8
17 changed files with 64 additions and 55 deletions

View file

@ -13,7 +13,7 @@ inputs.nixpkgs.lib.nixosSystem {
modules = [ modules = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/commonopts.nix ../../modules/hostopts.nix
../../modules/nixos/common.nix ../../modules/nixos/common.nix
../../modules/nixos/printing.nix ../../modules/nixos/printing.nix
../../modules/both/sound.nix ../../modules/both/sound.nix
@ -66,8 +66,9 @@ inputs.nixpkgs.lib.nixosSystem {
]; ];
}; };
home-manager.users.${config.host.user} = {inputs, ...}: { home-manager.users.${config.host.user} = {inputs, osConfig, ...}: {
host = { host=osConfig.host;
home = {
enable-speech = true; enable-speech = true;
nvim = { nvim = {
enable-lsp = true; enable-lsp = true;

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
# machine specific options # machine specific options
host = { home= {
enable-speech = true; enable-speech = true;
nvim = { nvim = {
enable-lsp = true; enable-lsp = true;

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
# machine specific options # machine specific options
host = { home = {
enable-speech = true; enable-speech = true;
nvim = { nvim = {
enable-lsp = true; enable-lsp = true;

View file

@ -13,7 +13,7 @@ inputs.nixpkgs.lib.nixosSystem {
modules = [ modules = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/commonopts.nix ../../modules/hostopts.nix
../../modules/nixos/common.nix ../../modules/nixos/common.nix
../../modules/nixos/printing.nix ../../modules/nixos/printing.nix
../../modules/both/sound.nix ../../modules/both/sound.nix
@ -67,8 +67,9 @@ inputs.nixpkgs.lib.nixosSystem {
]; ];
}; };
home-manager.users.${config.host.user} = {inputs, ...}: { home-manager.users.${config.host.user} = {inputs, osConfig, ...}: {
host = { host=osConfig.host;
home = {
enable-speech = true; enable-speech = true;
nvim = { nvim = {
enable-lsp = true; enable-lsp = true;

View file

@ -5,21 +5,21 @@
... ...
}: { }: {
services.accounts-daemon.enable = true; services.accounts-daemon.enable = true;
services.displayManager = {
defaultSession = "none+i3";
autoLogin = {
user = config.host.user;
enable = true;
};
};
services.xserver = { services.xserver = {
enable = true; enable = true;
displayManager = {
defaultSession = "none+i3";
autoLogin = {
user = config.host.user;
enable = true;
};
lightdm = {
enable = true;
greeters.gtk.enable = false;
greeter.enable = false;
};
};
windowManager.i3.enable = true; windowManager.i3.enable = true;
displayManager.lightdm = {
enable = true;
greeters.gtk.enable = false;
greeter.enable = false;
};
}; };
home-manager.users.${config.host.user} = {config, ...}: { home-manager.users.${config.host.user} = {config, ...}: {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -18,4 +18,7 @@
settings.max-jobs = "auto"; settings.max-jobs = "auto";
gc.automatic = true; gc.automatic = true;
}; };
imports = [
../hostopts.nix
];
} }

View file

@ -5,14 +5,14 @@
... ...
}: { }: {
options = { options = {
host.nvim.enable-completions = home.nvim.enable-completions =
(lib.mkEnableOption "basic completion in nvim") (lib.mkEnableOption "basic completion in nvim")
// { // {
default = config.host.nvim.enable-treesitter || config.host.nvim.enable-lsp; default = false;
}; };
}; };
config = config =
lib.mkIf config.host.nvim.enable-completions lib.mkIf config.home.nvim.enable-completions
{ {
programs.nixvim = { programs.nixvim = {
plugins.luasnip.enable = true; plugins.luasnip.enable = true;

View file

@ -28,7 +28,7 @@
BreakBeforeBinaryOperators: NonAssignment BreakBeforeBinaryOperators: NonAssignment
... ...
''; '';
"work/.clang-format" = lib.mkIf config.host.git.workProfile.enable { "work/.clang-format" = lib.mkIf config.home.git.workProfile.enable {
text = '' text = ''
--- ---
#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other. #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.

View file

@ -5,13 +5,13 @@
... ...
}: { }: {
options = { options = {
host.nvim.enable-lsp = lib.mkEnableOption "nvim lsp"; home.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
}; };
config = config =
lib.mkIf config.host.nvim.enable-lsp lib.mkIf config.home.nvim.enable-lsp
{ {
host.nvim.enable-completions = true; home.nvim.enable-completions = true;
programs.nixvim = { programs.nixvim = {
plugins.lsp = { plugins.lsp = {
enable = true; enable = true;

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.host.nvim.enable-lsp lib.mkIf config.home.nvim.enable-lsp
{ {
programs.nixvim = { programs.nixvim = {
plugins.rust-tools = { plugins.rust-tools = {

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.host.nvim.enable-treesitter lib.mkIf config.home.nvim.enable-treesitter
{ {
programs.nixvim = { programs.nixvim = {
keymaps = [ keymaps = [

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
options = { options = {
host.nvim.enable-treesitter = lib.mkOption { home.nvim.enable-treesitter = lib.mkOption {
default = false; default = false;
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
@ -14,9 +14,9 @@
}; };
}; };
config = config =
lib.mkIf config.host.nvim.enable-treesitter lib.mkIf config.home.nvim.enable-treesitter
{ {
host.nvim.enable-completions = true; home.nvim.enable-completions = true;
programs.nixvim = { programs.nixvim = {
plugins.treesitter = { plugins.treesitter = {
enable = true; enable = true;

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.host.nvim.enable-treesitter lib.mkIf config.home.nvim.enable-treesitter
{ {
programs.nixvim = { programs.nixvim = {
plugins.rainbow-delimiters = { plugins.rainbow-delimiters = {

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.host.nvim.enable-treesitter lib.mkIf config.home.nvim.enable-treesitter
{ {
programs.nixvim = let programs.nixvim = let
nu-grammar = pkgs.tree-sitter.buildGrammar { nu-grammar = pkgs.tree-sitter.buildGrammar {

View file

@ -5,21 +5,25 @@
... ...
}: { }: {
options = { options = {
host.git.workProfile = { home = {
enable = lib.mkEnableOption "git work profile"; git = {
email = lib.mkOption { workProfile = {
type = lib.types.str; enable = lib.mkEnableOption "git work profile";
description = "email for work profile."; email = lib.mkOption {
}; type = lib.types.str;
}; description = "email for work profile.";
host.git.profile = { };
email = lib.mkOption { };
type = lib.types.str; profile = {
description = "email for main profile"; email = lib.mkOption {
}; type = lib.types.str;
name = lib.mkOption { description = "email for main profile";
type = lib.types.str; };
description = "name for main profile"; name = lib.mkOption {
type = lib.types.str;
description = "name for main profile";
};
};
}; };
}; };
}; };
@ -43,8 +47,8 @@
}; };
# difftastic.enable=true; # difftastic.enable=true;
# difftastic.background="dark"; # difftastic.background="dark";
userEmail = config.host.git.profile.email; userEmail = config.home.git.profile.email;
userName = config.host.git.profile.name; userName = config.home.git.profile.name;
extraConfig = { extraConfig = {
init = { init = {
defaultBranch = "main"; defaultBranch = "main";
@ -73,11 +77,11 @@
}; };
}; };
includes = includes =
if config.host.git.workProfile.enable if config.home.git.workProfile.enable
then [ then [
{ {
condition = "gitdir:~/work/**"; condition = "gitdir:~/work/**";
contents.user.email = config.host.git.workProfile.email; contents.user.email = config.home.git.workProfile.email;
} }
] ]
else []; else [];

View file

@ -5,11 +5,11 @@
... ...
}: { }: {
options = { options = {
host.enable-speech = lib.mkEnableOption "espeak"; home.enable-speech = lib.mkEnableOption "espeak";
}; };
config = config =
lib.mkIf config.host.enable-speech lib.mkIf config.home.enable-speech
{ {
home.shellAliases = { home.shellAliases = {
say = "espeak -p 10 -s 150 -a 200"; say = "espeak -p 10 -s 150 -a 200";