From 6a544fb7d49375c67b87c42db3c43e93e0d0f796 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 9 Jun 2023 10:15:24 +0100 Subject: [PATCH] Move home/common things into respective section/default expressions --- H0615.nix | 1 - Vanguard.nix | 1 - common.nix | 16 +++++++++++++++- home/common.nix | 10 ---------- home/default.nix | 13 +------------ home/env/default.nix | 11 ++++++++++- home/gui/default.nix | 5 ++++- home/personal.nix | 16 ++-------------- home/work.nix | 16 ++-------------- 9 files changed, 34 insertions(+), 55 deletions(-) delete mode 100644 home/common.nix diff --git a/H0615.nix b/H0615.nix index 3686dc40..e624015c 100644 --- a/H0615.nix +++ b/H0615.nix @@ -1,6 +1,5 @@ {pkgs, ...}: { imports = [ - ./home ./common.nix ./hardware/audio.nix ./locales/en_GB.nix diff --git a/Vanguard.nix b/Vanguard.nix index 57c184ac..06e4c131 100644 --- a/Vanguard.nix +++ b/Vanguard.nix @@ -1,6 +1,5 @@ {pkgs, ...}: { imports = [ - ./home ./common.nix ./hardware/audio.nix ./hardware/bluetooth.nix diff --git a/common.nix b/common.nix index b6204a54..f9a2b538 100644 --- a/common.nix +++ b/common.nix @@ -1,4 +1,11 @@ -{lib, ...}: { +{ + pkgs, + lib, + ... +}: let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; +in { + imports = [(import "${home-manager}/nixos")]; nix = { settings.experimental-features = ["nix-command" "flakes"]; gc = { @@ -13,9 +20,16 @@ }; system.autoUpgrade.enable = lib.mkDefault false; nixpkgs.config.allowUnfree = true; + users.users.root.shell = pkgs.zsh; home-manager = { useUserPackages = false; useGlobalPkgs = true; + users.root = { + imports = [./home/env/readline.nix ./home/env/starship.nix ./home/env/zsh.nix]; + home.username = "root"; + home.homeDirectory = "/root"; + home.stateVersion = "22.11"; + }; }; networking.networkmanager.enable = true; services.power-profiles-daemon.enable = true; diff --git a/home/common.nix b/home/common.nix deleted file mode 100644 index 58e0b2d4..00000000 --- a/home/common.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - zip - unzip - neofetch - distrobox - libreoffice-fresh - otpclient - ]; -} diff --git a/home/default.nix b/home/default.nix index 828a7510..e1be0058 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,12 +1 @@ -{pkgs, ...}: let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in { - imports = [(import "${home-manager}/nixos")]; - users.users.root.shell = pkgs.zsh; - home-manager.users.root = { - imports = [./env/readline.nix ./env/starship.nix ./env/zsh.nix]; - home.username = "root"; - home.homeDirectory = "/root"; - home.stateVersion = "22.11"; - }; -} +{...}: {imports = [./env ./gui ./tui];} diff --git a/home/env/default.nix b/home/env/default.nix index 5491a7a2..c0473ea4 100644 --- a/home/env/default.nix +++ b/home/env/default.nix @@ -9,5 +9,14 @@ ./starship.nix ./zsh.nix ]; - home.packages = with pkgs; [dig file gnumake silver-searcher]; + home.packages = with pkgs; [ + dig + file + gnumake + zip + unzip + neofetch + silver-searcher + distrobox + ]; } diff --git a/home/gui/default.nix b/home/gui/default.nix index 0b41e581..f0f445aa 100644 --- a/home/gui/default.nix +++ b/home/gui/default.nix @@ -1 +1,4 @@ -{...}: {imports = [./chromium.nix ./wezterm.nix];} +{pkgs, ...}: { + imports = [./chromium.nix ./wezterm.nix]; + home.packages = with pkgs; [libreoffice-fresh otpclient]; +} diff --git a/home/personal.nix b/home/personal.nix index 18ac2dc4..4dbca40e 100644 --- a/home/personal.nix +++ b/home/personal.nix @@ -1,16 +1,4 @@ {pkgs, ...}: { - imports = [ - ./common.nix - ./env - ./gui - ./tui - ./git/personal.nix - ./ssh/personal.nix - ]; - home.packages = with pkgs; [ - signal-desktop - discord - element-desktop - qbittorrent - ]; + imports = [./default.nix ./git/personal.nix ./ssh/personal.nix]; + home.packages = with pkgs; [signal-desktop discord element-desktop qbittorrent]; } diff --git a/home/work.nix b/home/work.nix index 72bf23f3..bbfa6b11 100644 --- a/home/work.nix +++ b/home/work.nix @@ -1,16 +1,4 @@ {pkgs, ...}: { - imports = [ - ./common.nix - ./env - ./gui - ./gui/vscode.nix - ./tui - ./git/work.nix - ./ssh/work.nix - ]; - home.packages = with pkgs; [ - nomachine-client - teams - zoom-us - ]; + imports = [./default.nix ./git/work.nix ./ssh/work.nix]; + home.packages = with pkgs; [nomachine-client teams zoom-us]; }