From 8df45499b82ad38741d584d5de1a2426491020e6 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 29 Mar 2023 14:57:58 +0100 Subject: [PATCH] Further restructuring, set up default.nix files to allow importing all common expressions by importing top level packages directory --- nixos/home-manager/H0615-elitherl.nix | 14 +++++--------- nixos/home-manager/common.nix | 3 +-- nixos/home-manager/packages/default.nix | 9 +++++++++ nixos/home-manager/packages/dev.nix | 15 --------------- nixos/home-manager/packages/env/default.nix | 8 ++++++++ .../home-manager/packages/{ => env}/python310.nix | 4 ---- nixos/home-manager/packages/env/qemu.nix | 7 +++++++ .../packages/{gui.nix => gui/default.nix} | 3 +++ nixos/home-manager/packages/{ => gui}/gaming.nix | 1 + .../home-manager/packages/{ => gui}/messaging.nix | 1 - .../home-manager/packages/{ => gui}/nomachine.nix | 0 nixos/home-manager/packages/gui/ukaea.nix | 8 ++++++++ nixos/home-manager/packages/gui/zotero.nix | 7 +++++++ .../packages/{ => tui}/config/lazygit.nix | 0 nixos/home-manager/packages/tui/default.nix | 9 +++++++++ nixos/home-manager/packages/tui/lazygit.nix | 8 ++++++++ nixos/home-manager/packages/{ => tui}/neovim.nix | 8 +------- nixos/home-manager/vanguard-xenia.nix | 8 +++----- 18 files changed, 70 insertions(+), 43 deletions(-) create mode 100644 nixos/home-manager/packages/default.nix delete mode 100644 nixos/home-manager/packages/dev.nix create mode 100644 nixos/home-manager/packages/env/default.nix rename nixos/home-manager/packages/{ => env}/python310.nix (77%) create mode 100644 nixos/home-manager/packages/env/qemu.nix rename nixos/home-manager/packages/{gui.nix => gui/default.nix} (70%) rename nixos/home-manager/packages/{ => gui}/gaming.nix (88%) rename nixos/home-manager/packages/{ => gui}/messaging.nix (88%) rename nixos/home-manager/packages/{ => gui}/nomachine.nix (100%) create mode 100644 nixos/home-manager/packages/gui/ukaea.nix create mode 100644 nixos/home-manager/packages/gui/zotero.nix rename nixos/home-manager/packages/{ => tui}/config/lazygit.nix (100%) create mode 100644 nixos/home-manager/packages/tui/default.nix create mode 100644 nixos/home-manager/packages/tui/lazygit.nix rename nixos/home-manager/packages/{ => tui}/neovim.nix (58%) diff --git a/nixos/home-manager/H0615-elitherl.nix b/nixos/home-manager/H0615-elitherl.nix index 1dea8e35..4e4f4563 100644 --- a/nixos/home-manager/H0615-elitherl.nix +++ b/nixos/home-manager/H0615-elitherl.nix @@ -1,20 +1,16 @@ -{ pkgs, ... }: { +{ ... }: { imports = [ ./common.nix - ./packages/gui.nix - ./packages/neovim.nix - ./packages/python310.nix - ./packages/nomachine.nix + ./packages + ./packages/gui/nomachine.nix + ./packages/gui/zotero.nix + ./packages/gui/ukaea.nix ]; # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "elitherl"; home.homeDirectory = "/home/elitherl"; - home.packages = with pkgs; [ - teams - ]; - programs.git = { userEmail = "evie.litherland-smith@ukaea.uk"; }; diff --git a/nixos/home-manager/common.nix b/nixos/home-manager/common.nix index ebea0362..af38cfae 100644 --- a/nixos/home-manager/common.nix +++ b/nixos/home-manager/common.nix @@ -1,8 +1,7 @@ -{ config, pkgs, ... }: +{ ... }: { nixpkgs.config.allowUnfree = true; - programs.home-manager.enable = true; programs.ssh = { enable = true; diff --git a/nixos/home-manager/packages/default.nix b/nixos/home-manager/packages/default.nix new file mode 100644 index 00000000..47f0d7c8 --- /dev/null +++ b/nixos/home-manager/packages/default.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + imports = [ + ./tui + ./gui + ./env + ]; +} diff --git a/nixos/home-manager/packages/dev.nix b/nixos/home-manager/packages/dev.nix deleted file mode 100644 index f2a4605e..00000000 --- a/nixos/home-manager/packages/dev.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - gnumake - gcc - direnv - ]; - - programs.git.enable = true; - programs.lazygit = { - enable = true; - settings = import ./config/lazygit.nix; - }; -} diff --git a/nixos/home-manager/packages/env/default.nix b/nixos/home-manager/packages/env/default.nix new file mode 100644 index 00000000..7a8255a6 --- /dev/null +++ b/nixos/home-manager/packages/env/default.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + imports = [ + ./qemu.nix + ./python310.nix + ]; +} diff --git a/nixos/home-manager/packages/python310.nix b/nixos/home-manager/packages/env/python310.nix similarity index 77% rename from nixos/home-manager/packages/python310.nix rename to nixos/home-manager/packages/env/python310.nix index fe44ca79..11212a58 100644 --- a/nixos/home-manager/packages/python310.nix +++ b/nixos/home-manager/packages/env/python310.nix @@ -1,10 +1,6 @@ { config, pkgs, ... }: { - imports = [ - ./dev.nix - ]; - home.packages = with pkgs; [ python310Full python310Packages.pipx diff --git a/nixos/home-manager/packages/env/qemu.nix b/nixos/home-manager/packages/env/qemu.nix new file mode 100644 index 00000000..568212a5 --- /dev/null +++ b/nixos/home-manager/packages/env/qemu.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + qemu + ]; +} diff --git a/nixos/home-manager/packages/gui.nix b/nixos/home-manager/packages/gui/default.nix similarity index 70% rename from nixos/home-manager/packages/gui.nix rename to nixos/home-manager/packages/gui/default.nix index 9a7477ce..eeb92e48 100644 --- a/nixos/home-manager/packages/gui.nix +++ b/nixos/home-manager/packages/gui/default.nix @@ -1,6 +1,9 @@ { pkgs, ... }: { + imports = [ + ./messaging.nix + ]; home.packages = with pkgs; [ wezterm firefox diff --git a/nixos/home-manager/packages/gaming.nix b/nixos/home-manager/packages/gui/gaming.nix similarity index 88% rename from nixos/home-manager/packages/gaming.nix rename to nixos/home-manager/packages/gui/gaming.nix index ac2288e6..bd9e35b6 100644 --- a/nixos/home-manager/packages/gaming.nix +++ b/nixos/home-manager/packages/gui/gaming.nix @@ -5,5 +5,6 @@ mesa steam steam-run + discord ]; } diff --git a/nixos/home-manager/packages/messaging.nix b/nixos/home-manager/packages/gui/messaging.nix similarity index 88% rename from nixos/home-manager/packages/messaging.nix rename to nixos/home-manager/packages/gui/messaging.nix index 0e45e7f8..816dd210 100644 --- a/nixos/home-manager/packages/messaging.nix +++ b/nixos/home-manager/packages/gui/messaging.nix @@ -4,6 +4,5 @@ home.packages = with pkgs; [ signal-desktop element-desktop - discord ]; } diff --git a/nixos/home-manager/packages/nomachine.nix b/nixos/home-manager/packages/gui/nomachine.nix similarity index 100% rename from nixos/home-manager/packages/nomachine.nix rename to nixos/home-manager/packages/gui/nomachine.nix diff --git a/nixos/home-manager/packages/gui/ukaea.nix b/nixos/home-manager/packages/gui/ukaea.nix new file mode 100644 index 00000000..2733164d --- /dev/null +++ b/nixos/home-manager/packages/gui/ukaea.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + teams + zoom-us + ]; +} diff --git a/nixos/home-manager/packages/gui/zotero.nix b/nixos/home-manager/packages/gui/zotero.nix new file mode 100644 index 00000000..f49b26fb --- /dev/null +++ b/nixos/home-manager/packages/gui/zotero.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + zotero + ]; +} diff --git a/nixos/home-manager/packages/config/lazygit.nix b/nixos/home-manager/packages/tui/config/lazygit.nix similarity index 100% rename from nixos/home-manager/packages/config/lazygit.nix rename to nixos/home-manager/packages/tui/config/lazygit.nix diff --git a/nixos/home-manager/packages/tui/default.nix b/nixos/home-manager/packages/tui/default.nix new file mode 100644 index 00000000..224dc6ee --- /dev/null +++ b/nixos/home-manager/packages/tui/default.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + imports = [ + ./neovim.nix + ./lazygit.nix + ]; + programs.neovim.defaultEditor = true; +} diff --git a/nixos/home-manager/packages/tui/lazygit.nix b/nixos/home-manager/packages/tui/lazygit.nix new file mode 100644 index 00000000..3747bb17 --- /dev/null +++ b/nixos/home-manager/packages/tui/lazygit.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + programs.lazygit = { + enable = true; + settings = import ./config/lazygit.nix; + }; +} diff --git a/nixos/home-manager/packages/neovim.nix b/nixos/home-manager/packages/tui/neovim.nix similarity index 58% rename from nixos/home-manager/packages/neovim.nix rename to nixos/home-manager/packages/tui/neovim.nix index 3d4c16a9..73df08be 100644 --- a/nixos/home-manager/packages/neovim.nix +++ b/nixos/home-manager/packages/tui/neovim.nix @@ -1,13 +1,7 @@ { pkgs, ... }: { - imports = [ - ./dev.nix - ]; - programs.neovim = { - enable = true; - defaultEditor = true; - }; + programs.neovim.enable = true; home.packages = with pkgs; [ gnumake gcc diff --git a/nixos/home-manager/vanguard-xenia.nix b/nixos/home-manager/vanguard-xenia.nix index db806fea..d53d1c88 100644 --- a/nixos/home-manager/vanguard-xenia.nix +++ b/nixos/home-manager/vanguard-xenia.nix @@ -1,10 +1,8 @@ -{ pkgs, ... }: { +{ ... }: { imports = [ ./common.nix - ./packages/gui.nix - ./packages/gaming.nix - ./packages/messaging.nix - ./packages/neovim.nix + ./packages + ./packages/gui/gaming.nix ./packages/nomachine.nix ]; # Home Manager needs a bit of information about you and the