From 7a0bf61d06b5288a29926acf3eb13f457868e653 Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 13 Jan 2025 20:40:38 +0300 Subject: [PATCH] use modules --- hosts/tartarus/configuration.nix | 10 +--------- hosts/ymir/configuration.nix | 10 +--------- {common => modules}/common-packages.nix | 0 {common => modules}/concentration.nix | 0 modules/default.nix | 12 ++++++++++++ {common => modules}/firefox.nix | 0 {common => modules}/fonts.nix | 0 {hosts/tartarus => modules}/home.nix | 6 +++--- {common => modules}/i18n.nix | 0 {common => modules}/nix-settings.nix | 2 +- {common => modules}/secrets.nix | 0 11 files changed, 18 insertions(+), 22 deletions(-) rename {common => modules}/common-packages.nix (100%) rename {common => modules}/concentration.nix (100%) create mode 100644 modules/default.nix rename {common => modules}/firefox.nix (100%) rename {common => modules}/fonts.nix (100%) rename {hosts/tartarus => modules}/home.nix (93%) rename {common => modules}/i18n.nix (100%) rename {common => modules}/nix-settings.nix (84%) rename {common => modules}/secrets.nix (100%) diff --git a/hosts/tartarus/configuration.nix b/hosts/tartarus/configuration.nix index 25613fe..1f89768 100644 --- a/hosts/tartarus/configuration.nix +++ b/hosts/tartarus/configuration.nix @@ -9,14 +9,7 @@ }: { imports = [ ./hardware-configuration.nix - ../../common/fonts.nix - ../../common/nix-settings.nix - ../../common/i18n.nix - ../../common/python.nix - ../../common/arduino.nix - ../../common/firefox.nix - ../../common/common-packages.nix - ../../common/concentration.nix + ../../modules ]; blockYoutube = false; @@ -96,7 +89,6 @@ obs-studio audacity qbittorrent - arduino-ide ]; }; diff --git a/hosts/ymir/configuration.nix b/hosts/ymir/configuration.nix index 1f0bc26..642dcb0 100644 --- a/hosts/ymir/configuration.nix +++ b/hosts/ymir/configuration.nix @@ -9,15 +9,7 @@ }: { imports = [ ./hardware-configuration.nix - ../../common/fonts.nix - ../../common/nix-settings.nix - ../../common/i18n.nix - ../../common/python.nix - ../../common/arduino.nix - ../../common/firefox.nix - ../../common/common-packages.nix - ../../common/concentration.nix - ../../common/secrets.nix + ../../modules ]; # Bootloader. diff --git a/common/common-packages.nix b/modules/common-packages.nix similarity index 100% rename from common/common-packages.nix rename to modules/common-packages.nix diff --git a/common/concentration.nix b/modules/concentration.nix similarity index 100% rename from common/concentration.nix rename to modules/concentration.nix diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..28e915f --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ./arduino.nix + ./common-packages.nix + ./concentration.nix + ./firefox.nix + ./fonts.nix + ./i18n.nix + ./nix-settings.nix + ./secrets.nix + ]; +} \ No newline at end of file diff --git a/common/firefox.nix b/modules/firefox.nix similarity index 100% rename from common/firefox.nix rename to modules/firefox.nix diff --git a/common/fonts.nix b/modules/fonts.nix similarity index 100% rename from common/fonts.nix rename to modules/fonts.nix diff --git a/hosts/tartarus/home.nix b/modules/home.nix similarity index 93% rename from hosts/tartarus/home.nix rename to modules/home.nix index 5c8e294..3d9df91 100644 --- a/hosts/tartarus/home.nix +++ b/modules/home.nix @@ -1,6 +1,7 @@ { config, pkgs, + stateVersion ... }: { # Home Manager needs a bit of information about you and the @@ -10,8 +11,6 @@ # Packages that should be installed to the user profile. home.packages = [ - pkgs.htop - pkgs.fortune ]; programs.git = { @@ -20,6 +19,7 @@ userName = "osbm"; }; + # 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 @@ -28,7 +28,7 @@ # 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. - home.stateVersion = "24.11"; + home.stateVersion = stateVersion; # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/common/i18n.nix b/modules/i18n.nix similarity index 100% rename from common/i18n.nix rename to modules/i18n.nix diff --git a/common/nix-settings.nix b/modules/nix-settings.nix similarity index 84% rename from common/nix-settings.nix rename to modules/nix-settings.nix index aa87967..a99dc44 100644 --- a/common/nix-settings.nix +++ b/modules/nix-settings.nix @@ -5,7 +5,7 @@ ... }: { # Allow unfree packages - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; # TODO: replace this with allowUnfreePredicate # enable nix flakes nix.settings.experimental-features = ["nix-command" "flakes"]; diff --git a/common/secrets.nix b/modules/secrets.nix similarity index 100% rename from common/secrets.nix rename to modules/secrets.nix