From 22fceb0fbcacd322426404d0e53c69fcb40831f0 Mon Sep 17 00:00:00 2001 From: YouSiki Date: Thu, 15 Feb 2024 11:33:48 +0800 Subject: [PATCH] Update home directory and time zone settings*** ***Add user account 'yousiki' with sudo privileges*** ***Integrate home-manager module for custom user configurations --- src/homeProfiles/base.nix | 5 +++-- src/nixosConfigurations/yui/_configuration.nix | 10 +++++----- src/nixosConfigurations/yui/default.nix | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/homeProfiles/base.nix b/src/homeProfiles/base.nix index baf3987..42756be 100644 --- a/src/homeProfiles/base.nix +++ b/src/homeProfiles/base.nix @@ -6,10 +6,11 @@ ... }: with builtins // lib; { - home.homeDirectory = + home.homeDirectory = mkDefault ( if hasSuffix "-darwin" pkgs.system then "/Users/${config.home.username}" - else "/home/${config.home.username}"; + else "/home/${config.home.username}" + ); home.stateVersion = "23.05"; } diff --git a/src/nixosConfigurations/yui/_configuration.nix b/src/nixosConfigurations/yui/_configuration.nix index 4e0fe32..d79ae13 100644 --- a/src/nixosConfigurations/yui/_configuration.nix +++ b/src/nixosConfigurations/yui/_configuration.nix @@ -21,7 +21,7 @@ with lib; { # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # Set your time zone. - # time.timeZone = "Europe/Amsterdam"; + time.timeZone = "Asia/Shanghai"; # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config @@ -58,10 +58,10 @@ with lib; { # services.xserver.libinput.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. - # users.users.alice = { - # isNormalUser = true; - # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - # }; + users.users.yousiki = { + isNormalUser = true; + extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. + }; # List packages installed in system profile. To search, run: # $ nix search wget diff --git a/src/nixosConfigurations/yui/default.nix b/src/nixosConfigurations/yui/default.nix index 355b6d6..a67ef21 100644 --- a/src/nixosConfigurations/yui/default.nix +++ b/src/nixosConfigurations/yui/default.nix @@ -11,6 +11,22 @@ commonProfiles.nix commonProfiles.packages nixosProfiles.vscode-server + + # Home-manager module + globals.inputs.home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = {inherit globals;}; + users.yousiki = { + imports = with homeProfiles; [ + base + lang.complete + ]; + }; + }; + } ]; in globals.inputs.nixpkgs.lib.nixosSystem {