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
2023-07-07 10:56:04 +02: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 3 . 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 " ;
2023-10-06 21:54:08 +02:00
microvm . url = " g i t h u b : a s t r o / m i c r o v m . n i x " ;
microvm . inputs . nixpkgs . follows = " n i x p k g s " ;
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-12-17 20:07:06 +01:00
agenix = {
url = " g i t h u b : r y a n t m / a g e n i x " ;
2023-02-04 08:50:56 +01:00
inputs . nixpkgs . follows = " n i x p k g s " ;
2022-12-17 20:07:06 +01:00
} ;
2023-07-21 22:07:21 +02:00
jovian-nixos = {
url = " g i t h u b : J o v i a n - E x p e r i m e n t s / J o v i a n - N i x O S / d e v e l o p m e n t " ;
flake = false ;
} ;
2022-09-17 16:50:50 +02:00
} ;
2023-10-06 21:54:08 +02:00
outputs = inputs @ { self , nixpkgs , nixpkgs-stable , nixos-hardware , home-manager , nur , agenix , jovian-nixos , microvm , . . . }: # 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 " ;
2023-10-16 10:33:47 +02:00
userdmz = " d i a b l o " ;
userserver = " m e p h i s t o " ;
2022-09-17 16:50:50 +02:00
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 ;
2023-10-16 10:33:47 +02:00
inherit inputs nixpkgs nixpkgs-stable nixos-hardware home-manager nur user userdmz userserver location agenix jovian-nixos microvm ; # Also inherit home-manager so it does not need to be defined here.
2023-07-25 17:26:04 +02:00
nix . allowedUsers = [ " @ w h e e l " ] ;
2023-07-27 21:37:38 +02:00
security . sudo . execWheelOnly = true ;
2022-09-17 16:50:50 +02:00
}
) ;
} ;
2022-09-16 22:44:43 +02:00
}