nixos-home-flake/flake.nix

48 lines
1.3 KiB
Nix
Raw Normal View History

2024-02-21 19:34:28 +01:00
{
2024-02-21 21:35:27 +01:00
description = "Nixos: Home-Manager and System configuration";
2024-02-21 19:34:28 +01:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-21 21:18:36 +01:00
hypr-contrib.url = "github:hyprwm/contrib";
2024-02-21 19:34:28 +01:00
};
2024-02-21 21:18:36 +01:00
outputs = { nixpkgs, home-manager, ... }@inputs:
2024-02-21 22:54:04 +01:00
let
2024-02-21 21:18:36 +01:00
system = "x86_64-linux";
2024-02-21 22:54:04 +01:00
pkgs = nixpkgs.legacyPackages.${system};
2024-02-21 21:18:36 +01:00
lib = nixpkgs.lib;
2024-02-21 19:34:28 +01:00
2024-02-21 21:18:36 +01:00
user = "spagnologasper";
2024-02-21 22:54:04 +01:00
hostName = "yoga";
2024-02-21 21:18:36 +01:00
mkSystem = pkgs: system: hostname:
pkgs.lib.nixosSystem {
system = system;
modules = [
2024-02-21 22:54:04 +01:00
./modules/system/configuration.nix
2024-02-21 21:18:36 +01:00
(./. + "/hosts/${hostname}/hardware-configuration.nix")
2024-02-21 22:54:04 +01:00
(./. + "/hosts/${hostname}/default.nix")
2024-02-21 21:18:36 +01:00
home-manager.nixosModules.home-manager
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs user; };
users.${user} = (./. + "/hosts/${hostname}/user.nix");
};
}
];
2024-02-21 22:54:04 +01:00
specialArgs = { inherit inputs user hostName; };
2024-02-21 21:18:36 +01:00
};
in {
nixosConfigurations = {
yoga = mkSystem inputs.nixpkgs "x86_64-linux" "yoga";
2024-02-21 22:54:04 +01:00
};
2024-02-21 19:34:28 +01:00
};
}