From 4360fbed688121653e76ffed51393d1664f0969f Mon Sep 17 00:00:00 2001 From: aaron Date: Sun, 28 Dec 2025 18:40:36 +0100 Subject: [PATCH] feature(flake): simplyfi the flake and add a module system --- flake.nix | 79 ++++++++++++++++++++++--------------------------------- 1 file changed, 32 insertions(+), 47 deletions(-) diff --git a/flake.nix b/flake.nix index 84a902f..abe0e6e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,74 +1,59 @@ { description = "0x29a ecosystem NixOS flake"; - + inputs = { - # the main nix package collection - nixpkgs = { - url = "github:nixos/nixpkgs/nixos-unstable"; - }; - # home manager for dotfiles + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - # noctalia shell noctalia = { url = "github:noctalia-dev/noctalia-shell"; inputs.nixpkgs.follows = "nixpkgs"; }; - # nixvim nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - - outputs = inputs@{self, nixpkgs, home-manager, nixvim, ... }: let - lib = nixpkgs.lib; - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { + + outputs = { self, nixpkgs, home-manager, nixvim, ... }@inputs: { nixosConfigurations = { - # default config - default = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; - modules = [ - # import host specific configs - ./hosts/default/configuration.nix - # import host specific hardware configs - ./hosts/default/hardware-configuration.nix - ]; - }; - # laptop neon - neon = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; + default = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; modules = [ - # import host specific configs - ./hosts/neon/configuration.nix - # import host specific hardware configs - ./hosts/neon/hardware-configuration.nix - # import noctalia shell configs - ./hosts/neon/noctalia.nix - # import home-manager as a module + ./hosts/default/hardware-configuration.nix + ./hosts/default/configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit inputs; }; - # User specific inputs - home-manager.users.aaron = { - imports = [ - nixvim.homeModules.nixvim - ./hosts/neon/home.nix - ]; - }; + home-manager.users.aaron.imports = [ + nixvim.homeModules.nixvim + ./users/aaron/home.nix + ]; + } + ]; + }; + + neon = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/neon/hardware-configuration.nix + ./hosts/neon/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.aaron.imports = [ + nixvim.homeModules.nixvim + ./users/aaron/home.nix + ]; } ]; };