diff --git a/modules/base/default.nix b/modules/base/default.nix index 3047db1..0e415e3 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -2,9 +2,8 @@ imports = [ ../options - # ./nix.nix - ../home + ./home.nix ]; } diff --git a/modules/base/home.nix b/modules/base/home.nix new file mode 100644 index 0000000..6de99ee --- /dev/null +++ b/modules/base/home.nix @@ -0,0 +1,22 @@ +let + my = { + name = "marley"; + fullName = "Marley Rae"; + username = "punkfairie"; + email = "marley@punkfairie.net"; + }; +in { + marleyos.my = my; + + home-manager = { + useUserPackages = true; + useGlobalPackages = true; + backupFileExtension = "bak"; + + users."${my.name}" = { + home.username = my.name; + }; + + sharedModules = [../home]; + }; +} diff --git a/modules/darwin/base/default.nix b/modules/darwin/base/default.nix index 3925d83..0c7cc4a 100644 --- a/modules/darwin/base/default.nix +++ b/modules/darwin/base/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./home.nix ./nix.nix ]; } diff --git a/modules/darwin/base/home.nix b/modules/darwin/base/home.nix new file mode 100644 index 0000000..1cd63b0 --- /dev/null +++ b/modules/darwin/base/home.nix @@ -0,0 +1,7 @@ +{config, ...}: let + inherit (config.marleyos.my) name; +in { + home-manager.users."${name}" = { + home.homeDirectory = "/Users/${name}"; + }; +} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..2a18424 --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ../options + ./option-inheritance.nix + + ./home-manager.nix + ]; +} diff --git a/modules/home/home-manager.nix b/modules/home/home-manager.nix new file mode 100644 index 0000000..11c724e --- /dev/null +++ b/modules/home/home-manager.nix @@ -0,0 +1,8 @@ +{ + programs.home-manager.enable = true; + + home.language.base = "en_US.UTF-8"; + + # Autostart wanted systemd services on Linux. + systemd.user.startServices = true; +} diff --git a/modules/home/option-inheritance.nix b/modules/home/option-inheritance.nix new file mode 100644 index 0000000..1ac3753 --- /dev/null +++ b/modules/home/option-inheritance.nix @@ -0,0 +1,17 @@ +{osConfig, ...}: let + cfg = osConfig.marleyos; +in { + marleyos = { + profiles = { + inherit (cfg.profiles) desktop server; + + hardware = { + inherit (cfg.profiles.hardware) nvidia; + }; + }; + + my = { + inherit (cfg.my) name fullName username email; + }; + }; +} diff --git a/modules/nixos/base/default.nix b/modules/nixos/base/default.nix index bb9e292..30ba7d0 100644 --- a/modules/nixos/base/default.nix +++ b/modules/nixos/base/default.nix @@ -2,6 +2,7 @@ imports = [ ./boot.nix ./drivers.nix + ./home.nix ./i18n.nix ./networking.nix ./nix.nix diff --git a/modules/nixos/base/home.nix b/modules/nixos/base/home.nix new file mode 100644 index 0000000..bc54361 --- /dev/null +++ b/modules/nixos/base/home.nix @@ -0,0 +1,7 @@ +{config, ...}: let + inherit (config.marleyos.my) name; +in { + home-manager.users."${name}" = { + home.homeDirectory = "/home/${name}"; + }; +} diff --git a/snowflake/modules/home/base/base/default.nix b/snowflake/modules/home/base/base/default.nix deleted file mode 100644 index 1ea4833..0000000 --- a/snowflake/modules/home/base/base/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - system, - ... -}: let - inherit (lib.snowfall.system) is-linux; -in { - # Anything in this folder should not include an enable/disable option. This is - # the only folder that is always applied. - config = { - marleyos.my = { - name = "marley"; - username = "punkfairie"; - fullName = "Marley Rae"; - email = "marley@punkfairie.net"; - }; - - home.language.base = "en_US.UTF-8"; - - programs.home-manager.enable = true; - - # Autostart wanted systemd services. - systemd.user.startServices = lib.mkIf (is-linux system) true; - }; -}