From aa46aa0762217ca9c61bd14c27fbdfbcf7451398 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Mon, 21 Oct 2024 15:34:23 +0200 Subject: [PATCH] repo: refactor to remove home/profiles Removed the profiles directory in home, as I thought it was redundant: they had the same name as my hostnames, as all my machines are single-user only. Therefore, everything is now under its own hosts/{hostname}, and flake.nix just has to import hosts/default.nix like it did before. --- home/profiles/default.nix | 10 ---- home/profiles/solaire/default.nix | 11 ----- home/profiles/vamos/default.nix | 19 -------- hosts/default.nix | 81 ++++++++++--------------------- hosts/solaire/default.nix | 30 +++++++++++- hosts/vamos/default.nix | 46 +++++++++++++++++- system/default.nix | 22 ++------- 7 files changed, 102 insertions(+), 117 deletions(-) delete mode 100644 home/profiles/default.nix delete mode 100644 home/profiles/solaire/default.nix delete mode 100644 home/profiles/vamos/default.nix diff --git a/home/profiles/default.nix b/home/profiles/default.nix deleted file mode 100644 index f2c6250..0000000 --- a/home/profiles/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - vamos = [ - ../. - ./vamos - ]; - solaire = [ - ../. - ./solaire - ]; -} diff --git a/home/profiles/solaire/default.nix b/home/profiles/solaire/default.nix deleted file mode 100644 index e67d5f5..0000000 --- a/home/profiles/solaire/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{self, ...}: { - imports = [ - "${self}/home/services/udiskie.nix" - - "${self}/home/programs" - - "${self}/home/terminal/emulators/foot.nix" - "${self}/home/programs/editors/neovim.nix" - "${self}/home/programs/editors/helix.nix" - ]; -} diff --git a/home/profiles/vamos/default.nix b/home/profiles/vamos/default.nix deleted file mode 100644 index ec3db00..0000000 --- a/home/profiles/vamos/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{self, ...}: { - imports = [ - "${self}/home/services/udiskie.nix" - - "${self}/home/programs" - - "${self}/home/programs/niri" - "${self}/home/programs/ags" - "${self}/home/programs/fuzzel.nix" - "${self}/home/programs/swaybg.nix" - "${self}/home/programs/swaylock.nix" - "${self}/home/programs/swayidle.nix" - - "${self}/home/terminal/emulators/foot.nix" - - "${self}/home/programs/editors/neovim.nix" - "${self}/home/programs/editors/helix.nix" - ]; -} diff --git a/hosts/default.nix b/hosts/default.nix index 58812b4..c473472 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -5,76 +5,45 @@ }: { flake.nixosConfigurations = let inherit (inputs.nixpkgs.lib) nixosSystem; - homeImports = import "${self}/home/profiles"; - mod = "${self}/system"; - inherit (import mod) laptop desktop; specialArgs = { inherit inputs self; }; in { vamos = nixosSystem { inherit specialArgs; - modules = - laptop - ++ [ - ./vamos - "${mod}/core/lanzaboote.nix" + modules = [ + ./vamos - "${mod}/services/greetd.nix" - "${mod}/programs/niri" - "${mod}/services/gnome.nix" - "${mod}/services/mail.nix" + self.nixosModules.style - self.nixosModules.style - - ({pkgs, ...}: { - style = let - wallpaper = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true"; - hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4="; - }; - in { - gtk.enable = true; - inherit wallpaper; + ({pkgs, ...}: { + style = let + wallpaper = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true"; + hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4="; }; - }) - { - home-manager = { - users.nezia.imports = homeImports.vamos; - extraSpecialArgs = specialArgs; - }; - } + in { + gtk.enable = true; + inherit wallpaper; + }; + }) - inputs.nixos-hardware.nixosModules.framework-13-7040-amd - ]; + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + ]; }; solaire = nixosSystem { inherit specialArgs; - modules = - desktop - ++ [ - ./solaire - - "${mod}/programs/gnome.nix" - - "${mod}/hardware/nvidia.nix" - "${mod}/programs/games.nix" - - self.nixosModules.style - { - style = { - gtk.enable = false; - wallpaper = ../wallpapers/lucy-edgerunners-wallpaper.jpg; - }; - } - { - home-manager = { - users.nezia.imports = homeImports.solaire; - extraSpecialArgs = specialArgs; - }; - } - ]; + modules = [ + ./solaire + self.nixosModules.style + { + style = { + gtk.enable = false; + wallpaper = ../wallpapers/lucy-edgerunners-wallpaper.jpg; + }; + } + ]; }; }; } diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index f2649b0..bc5852f 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -1,7 +1,35 @@ -{pkgs, ...}: { +{ + self, + specialArgs, + ... +}: let + mod = "${self}/system"; +in { imports = [ ./hardware-configuration.nix + + "${mod}" + "${mod}/hardware/uni-sync.nix" + + "${mod}/programs/gnome.nix" + "${mod}/programs/games.nix" + "${mod}/hardware/nvidia.nix" ]; + + home-manager = { + users.nezia.imports = [ + "${self}/home" + "${self}/home/services/udiskie.nix" + + "${self}/home/programs" + + "${self}/home/terminal/emulators/foot.nix" + "${self}/home/programs/editors/neovim.nix" + "${self}/home/programs/editors/helix.nix" + ]; + extraSpecialArgs = specialArgs; + }; + networking.hostName = "solaire"; environment.variables.FLAKE = "/home/nezia/.dotfiles"; } diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index c81507f..03b77ae 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,7 +1,51 @@ -{lib, ...}: { +{ + self, + specialArgs, + ... +}: let + mod = "${self}/system"; +in { imports = [ ./hardware-configuration.nix + + "${mod}" + "${mod}/core/lanzaboote.nix" + + "${mod}/hardware/fprintd.nix" + "${mod}/services/power.nix" + "${mod}/services/brightness.nix" + "${mod}/services/keyd.nix" + + "${mod}/services/logind.nix" + "${mod}/services/greetd.nix" + + "${mod}/programs/niri" + "${mod}/services/gnome.nix" + "${mod}/services/mail.nix" ]; + + home-manager = { + users.nezia.imports = [ + "${self}/home" + "${self}/home/services/udiskie.nix" + + "${self}/home/programs" + + "${self}/home/programs/niri" + "${self}/home/programs/ags" + "${self}/home/programs/fuzzel.nix" + "${self}/home/programs/swaybg.nix" + "${self}/home/programs/swaylock.nix" + "${self}/home/programs/swayidle.nix" + + "${self}/home/terminal/emulators/foot.nix" + + "${self}/home/programs/editors/neovim.nix" + "${self}/home/programs/editors/helix.nix" + ]; + extraSpecialArgs = specialArgs; + }; + networking.hostName = "vamos"; environment.variables.FLAKE = "/home/nezia/.dotfiles"; } diff --git a/system/default.nix b/system/default.nix index 0d5096b..c66a623 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,6 +1,7 @@ -let - common = [ +{ + imports = [ ./core + ./hardware/printing.nix ./hardware/fwupd.nix @@ -10,21 +11,4 @@ let ./services ]; - desktop = - common - ++ [ - ./hardware/uni-sync.nix - ]; - - laptop = - common - ++ [ - ./hardware/fprintd.nix - ./services/power.nix - ./services/brightness.nix - ./services/keyd.nix - ./services/logind.nix - ]; -in { - inherit desktop laptop; }