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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -28,7 +28,7 @@
BreakBeforeBinaryOperators: NonAssignment
...
'';
"work/.clang-format" = lib.mkIf config.host.git.workProfile.enable {
"work/.clang-format" = lib.mkIf config.home.git.workProfile.enable {
text = ''
---
#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 = {
host.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
home.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
};
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 = {
plugins.lsp = {
enable = true;

View file

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

View file

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

View file

@ -5,7 +5,7 @@
...
}: {
options = {
host.nvim.enable-treesitter = lib.mkOption {
home.nvim.enable-treesitter = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
@ -14,9 +14,9 @@
};
};
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 = {
plugins.treesitter = {
enable = true;

View file

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

View file

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

View file

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

View file

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