From 9a1a5e0702df85ed85075141d4655b816ad092ce Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 15 Aug 2023 18:56:20 +0900 Subject: [PATCH] test --- flake.nix | 5 +++-- home-manager/default.nix | 9 +++++++++ hosts/nixos-laptop/default.nix | 2 +- users/albert/home.nix | 12 ++++-------- users/root/home.nix | 13 +++++++------ 5 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 home-manager/default.nix diff --git a/flake.nix b/flake.nix index c294c2a8..71eeff1a 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,7 @@ # Variables - Remember to set these hostname = "nixos-laptop"; # Should probably set this in a minimal configuration.nix? system = "x86_64-linux"; + hmStateVersion = "23.05"; pkgs = import unstable-nixpkgs { inherit system; @@ -73,12 +74,12 @@ useUserPackages = true; users.albert.imports = [ ({ config, ... }: import ./users/albert/home.nix { - inherit config pkgs hostname; + inherit config pkgs hostname hmStateVersion; }) ]; users.root.imports = [ ({ config, ... }: import ./users/root/home.nix { - inherit config pkgs hostname; + inherit config pkgs hostname hmStateVersion; }) ]; }; # home-manager diff --git a/home-manager/default.nix b/home-manager/default.nix new file mode 100644 index 00000000..c962d97c --- /dev/null +++ b/home-manager/default.nix @@ -0,0 +1,9 @@ +{ config, pkgs, hostname, ... }: { + imports = [ + ./bash.nix + ./btop.nix + ./firefox.nix + ./git.nix + ./neovim.nix + ]; +} \ No newline at end of file diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index a400bfe6..b5a4122c 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -1,7 +1,7 @@ { imports, ... }: { imports = [ # imports.nixos-hardware.nixosModules.lenovo-thinkpad-p1 - ./home-manager ./nixos + # home-manager is imported from users/user/home.nix ]; } \ No newline at end of file diff --git a/users/albert/home.nix b/users/albert/home.nix index afca234d..6373df4d 100644 --- a/users/albert/home.nix +++ b/users/albert/home.nix @@ -1,14 +1,10 @@ -{ config, pkgs, hostname, ... }: { - home.stateVersion = "23.05"; +{ config, pkgs, hostname, hmStateVersion, ... }: { + home.stateVersion = ${hmStateVersion}; imports = [ # Host specific Configs: - ../../hosts/${hostname}/home-manager/default.nix + ../../hosts/${hostname}/home-manager # Universal Configs: - ../../home-manager/git.nix - ../../home-manager/neovim.nix - ../../home-manager/bash.nix - ../../home-manager/firefox.nix - ../../home-manager/btop.nix + ../../home-manager ]; } \ No newline at end of file diff --git a/users/root/home.nix b/users/root/home.nix index 8f118c58..79528c23 100644 --- a/users/root/home.nix +++ b/users/root/home.nix @@ -1,9 +1,10 @@ -{ config, pkgs, hostname, ... }: { - home.stateVersion = "23.05"; +{ config, pkgs, hostname, hmStateVersion, ... }: { + home.stateVersion = ${hmStateVersion}; imports = [ - ../../home-manager/git.nix - ../../home-manager/neovim.nix - ../../home-manager/bash.nix - ../../home-manager/btop.nix + # Host specific Configs: + # ../../hosts/${hostname}/home-manager + + # Universal Configs: + ../../home-manager ]; } \ No newline at end of file