From 44eb487df9ff908f27bf73ee994953493a2324fc Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 23 Dec 2023 17:43:57 +0800 Subject: [PATCH] refactor: home-manager --- .../server-riscv64.nix => base/core.nix} | 3 -- home/darwin/default.nix | 22 +------------ home/linux/desktop-hyprland.nix | 31 ------------------- home/linux/desktop-i3.nix | 31 ------------------- home/linux/desktop.nix | 10 ++++++ home/linux/server.nix | 23 ++------------ systems/vars.nix | 19 +++++++++--- 7 files changed, 27 insertions(+), 112 deletions(-) rename home/{linux/server-riscv64.nix => base/core.nix} (97%) delete mode 100644 home/linux/desktop-hyprland.nix delete mode 100644 home/linux/desktop-i3.nix create mode 100644 home/linux/desktop.nix diff --git a/home/linux/server-riscv64.nix b/home/base/core.nix similarity index 97% rename from home/linux/server-riscv64.nix rename to home/base/core.nix index d1f12584..0c5e9b3a 100644 --- a/home/linux/server-riscv64.nix +++ b/home/base/core.nix @@ -1,7 +1,4 @@ {username, ...}: { - imports = [ - ]; - # Home Manager needs a bit of information about you and the # paths it should manage. home = { diff --git a/home/darwin/default.nix b/home/darwin/default.nix index ec98895b..e59839f3 100644 --- a/home/darwin/default.nix +++ b/home/darwin/default.nix @@ -1,31 +1,11 @@ {username, ...}: { imports = [ ../base/desktop + ../base/core.nix ./proxychains ./core.nix ./rime-squirrel.nix ./shell.nix ]; - - # Home Manager needs a bit of information about you and the - # paths it should manage. - home = { - inherit username; - # set homeDirectory make build fail - homeDirectory = "/Users/${username}"; - - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - stateVersion = "23.11"; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; } diff --git a/home/linux/desktop-hyprland.nix b/home/linux/desktop-hyprland.nix deleted file mode 100644 index 7430a5a0..00000000 --- a/home/linux/desktop-hyprland.nix +++ /dev/null @@ -1,31 +0,0 @@ -{username, ...}: { - imports = [ - ../base/desktop - - ./base - ./fcitx5 - ./desktop - - ./hyprland - ]; - - # Home Manager needs a bit of information about you and the - # paths it should manage. - home = { - inherit username; - homeDirectory = "/home/${username}"; - - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - stateVersion = "23.11"; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/home/linux/desktop-i3.nix b/home/linux/desktop-i3.nix deleted file mode 100644 index 9109bd9c..00000000 --- a/home/linux/desktop-i3.nix +++ /dev/null @@ -1,31 +0,0 @@ -{username, ...}: { - imports = [ - ../base/desktop - - ./base - ./fcitx5 - ./desktop - - ./i3 - ]; - - # Home Manager needs a bit of information about you and the - # paths it should manage. - home = { - inherit username; - homeDirectory = "/home/${username}"; - - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - stateVersion = "23.11"; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/home/linux/desktop.nix b/home/linux/desktop.nix new file mode 100644 index 00000000..c427cbf9 --- /dev/null +++ b/home/linux/desktop.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ../base/desktop + ../base/core.nix + + ./base + ./fcitx5 + ./desktop + ]; +} diff --git a/home/linux/server.nix b/home/linux/server.nix index 04a9d6fc..ba39ef93 100644 --- a/home/linux/server.nix +++ b/home/linux/server.nix @@ -1,27 +1,8 @@ -{username, ...}: { +{ imports = [ ../base/server + ../base/core.nix ./base ]; - - # Home Manager needs a bit of information about you and the - # paths it should manage. - home = { - inherit username; - homeDirectory = "/home/${username}"; - - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - stateVersion = "23.11"; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; } diff --git a/systems/vars.nix b/systems/vars.nix index 67a79b0a..f6f46d65 100644 --- a/systems/vars.nix +++ b/systems/vars.nix @@ -6,7 +6,12 @@ ../secrets/nixos.nix ../modules/nixos/xorg.nix ]; - home-module = import ../home/linux/desktop-i3.nix; + home-module = { + imports = [ + ../home/linux/desktop.nix + ../home/linux/i3 + ]; + }; }; idol_ai_modules_hyprland = { nixos-modules = [ @@ -14,7 +19,12 @@ ../secrets/nixos.nix ../modules/nixos/wayland.nix ]; - home-module = import ../home/linux/desktop-hyprland.nix; + home-module = { + imports = [ + ../home/linux/desktop.nix + ../home/linux/hyprland + ]; + }; }; # 星野 愛久愛海, Hoshino Akuamarin @@ -59,7 +69,7 @@ # cross-compilation this flake. {nixpkgs.crossSystem.system = "riscv64-linux";} ]; - # home-module = import ../home/linux/server-riscv64.nix; + # home-module = import ../home/linux/server.nix; }; rolling_nozomi_tags = ["riscv" "nozomi"]; @@ -72,7 +82,7 @@ # cross-compilation this flake. {nixpkgs.crossSystem.system = "riscv64-linux";} ]; - # home-module = import ../home/linux/server-riscv64.nix; + # home-module = import ../home/linux/server.nix; }; rolling_yukina_tags = ["riscv" "yukina"]; @@ -108,5 +118,4 @@ ]; home-module = import ../home/darwin; }; - }