2022-09-17 16:50:50 +02:00
# My first run with nix. The config is based on Matthias Benaets config and youtube tutorial
# https://github.com/MatthiasBenaets/nixos-config
# https://www.youtube.com/watch?v=AGVXJ-TIv3Y
#
# flake.nix *
# ├─ ./hosts
# │ └─ default.nix
2022-09-16 22:44:43 +02:00
{
2022-09-17 16:50:50 +02:00
description = " K a b b o n e ' s p e r o n a l N i x O S F l a k e c o n f i g " ;
2022-09-16 22:44:43 +02:00
2022-09-18 11:07:22 +02:00
inputs = # All flake references used to build my NixOS setup. These are dependencies.
{
nixpkgs . url = " g i t h u b : n i x o s / n i x p k g s / n i x o s - u n s t a b l e " ; # Nix Packages
2022-11-26 20:30:05 +01:00
nixpkgs-stable . url = " g i t h u b : N i x O S / n I x p k g s / n i x o s - 2 2 . 0 5 " ;
2022-10-01 14:01:15 +02:00
nixos-hardware . url = " g i t h u b : N i x O S / n i x o s - h a r d w a r e / m a s t e r " ;
2022-09-17 16:50:50 +02:00
2022-09-18 11:07:22 +02:00
home-manager = { # User Package Management
url = " g i t h u b : n i x - c o m m u n i t y / h o m e - m a n a g e r " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2022-09-16 22:44:43 +02:00
2022-09-18 11:07:22 +02:00
nur = {
url = " g i t h u b : n i x - c o m m u n i t y / N U R " ; # NUR Packages
} ;
2022-09-16 22:44:43 +02:00
2022-09-18 11:07:22 +02:00
hyprland = { # Official Hyprland flake
url = " g i t h u b : v a x e r s k i / H y p r l a n d " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2022-09-17 16:50:50 +02:00
} ;
2022-11-26 20:30:05 +01:00
outputs = inputs @ { self , nixpkgs , nixpkgs-stable , nixos-hardware , home-manager , nur , hyprland , . . . }: # Function that tells my flake which to use and what do what to do with the dependencies.
2022-09-18 11:07:22 +02:00
let # Variables that can be used in the config files
2022-09-17 16:50:50 +02:00
user = " k a b b o n e " ;
location = " $ H O M E / . s e t u p " ;
in # Use above variables in ...
{
2022-09-18 11:07:22 +02:00
nixosConfigurations = ( # NixOS configurations
2022-09-17 16:50:50 +02:00
import ./hosts { # Imports ./hosts/default.nix
inherit ( nixpkgs ) lib ;
2022-11-26 20:30:05 +01:00
inherit inputs nixpkgs nixpkgs-stable nixos-hardware home-manager nur user location hyprland ; # Also inherit home-manager so it does not need to be defined here.
2022-09-17 16:50:50 +02:00
}
) ;
} ;
2022-09-16 22:44:43 +02:00
}