structure and add like MatthiasBenaets
This commit is contained in:
83
hosts/default.nix
Normal file
83
hosts/default.nix
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# These are the different profiles that can be used when building NixOS.
|
||||
#
|
||||
# flake.nix
|
||||
# └─ ./hosts
|
||||
# ├─ default.nix *
|
||||
# ├─ configuration.nix
|
||||
# ├─ home.nix
|
||||
# └─ ./desktop OR ./laptop OR ./vm
|
||||
# ├─ ./default.nix
|
||||
# └─ ./home.nix
|
||||
#
|
||||
|
||||
{ lib, inputs, nixpkgs, home-manager, nur, user, location, hyprland, ... }:
|
||||
|
||||
let
|
||||
system = "x86_64-linux"; # System architecture
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # Allow proprietary software
|
||||
};
|
||||
|
||||
lib = nixpkgs.lib;
|
||||
in
|
||||
{
|
||||
desktop = lib.nixosSystem { # Desktop profile
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs user location; }; # Pass flake variable
|
||||
modules = [ # Modules that are used.
|
||||
nur.nixosModules.nur
|
||||
hyprland.nixosModules.default
|
||||
./desktop
|
||||
./configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager { # Home-Manager module that is used.
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit user; }; # Pass flake variable
|
||||
home-manager.users.${user} = {
|
||||
imports = [(import ./home.nix)] ++ [(import ./desktop/home.nix)];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
laptop = lib.nixosSystem { # Laptop profile
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs user location hyprland; };
|
||||
modules = [
|
||||
hyprland.nixosModules.default
|
||||
./laptop
|
||||
./configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit user; };
|
||||
home-manager.users.${user} = {
|
||||
imports = [(import ./home.nix)] ++ [(import ./laptop/home.nix)];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
vm = lib.nixosSystem { # VM profile
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs user location; };
|
||||
modules = [
|
||||
./vm
|
||||
./configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit user; };
|
||||
home-manager.users.${user} = {
|
||||
imports = [(import ./home.nix)] ++ [(import ./vm/home.nix)];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user