From 381c969931ccd2bf08c3c37bd702921161f716e2 Mon Sep 17 00:00:00 2001 From: Nicholas Young Date: Thu, 16 Feb 2023 11:47:00 -0800 Subject: [PATCH] trying to bring home-manager into single-file users --- flake.nix | 15 ++++++++++++--- hosts/laptop/home.nix | 8 +++----- users/nicholix.nix | 10 ++++++++++ users/nixolas.nix | 11 +++++++++++ 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 1a40a97..4c7a28f 100644 --- a/flake.nix +++ b/flake.nix @@ -19,12 +19,13 @@ inherit system; config.allowUnfree = true; }; + lib = nixpkgs.lib; in { nixosConfigurations = { inherit (nixpkgs) lib; inherit inputs nixpkgs home-manager user kmonad ; - NicksNixLaptop = { + NicksNixLaptop = lib.nixosSystem { inherit system; specialArgs = inputs; @@ -36,9 +37,17 @@ ./hosts/laptop ./hosts/configuration.nix ./modules/kmonad.nix - ./hosts/laptop/home.nix + home-manager.nixosModules.home-manager { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit user; }; + users.${user} = import ./users/${user}.nix; + users.nicholix = import ./users/nicholix.nix; + }; + } ]; - } + }; }; }; } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 7cafdd6..ee213a2 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,8 +1,7 @@ -{ config, lib, pkgs, user, home-manager, ... }: +{ lib, inputs, nixpkgs, home-manager, user, kmonad, ... }: { - home-manager.nixosModules.home-manager { - home-manager = { + home-manager.nixosModules.home-manager = { useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit user; }; @@ -30,6 +29,5 @@ ../../modules/zsh.nix ]; }; - }; - } + }; } \ No newline at end of file diff --git a/users/nicholix.nix b/users/nicholix.nix index 6d3a617..e1b532d 100644 --- a/users/nicholix.nix +++ b/users/nicholix.nix @@ -12,6 +12,16 @@ let user = "nicholix"; in { + imports = [ + ../../modules/emacs.nix + ../../modules/git.nix + ../../modules/fusuma.nix + ../../modules/vim.nix + ../../modules/wezterm.nix + ../../modules/xdg.nix + ../../modules/zsh.nix + ]; + # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/users/nixolas.nix b/users/nixolas.nix index c5b33a2..b6c6d57 100644 --- a/users/nixolas.nix +++ b/users/nixolas.nix @@ -10,6 +10,17 @@ let ); in { + + imports = [ + ../../modules/emacs.nix + ../../../modules/git.nix + ../../modules/fusuma.nix + ../../modules/vim.nix + ../../modules/wezterm.nix + ../../modules/xdg.nix + ../../modules/zsh.nix + ]; + # Let Home Manager install and manage itself. programs.home-manager.enable = true;