nixos-config/flake.nix

47 lines
2.0 KiB
Nix
Raw Normal View History

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 = "Kabbone's peronal NixOS Flake config";
2022-09-16 22:44:43 +02:00
inputs = # All flake references used to build my NixOS setup. These are dependencies.
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Nix Packages
2023-07-07 10:56:04 +02:00
nixpkgs-stable.url = "github:NixOS/nIxpkgs/nixos-23.05";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2022-09-17 16:50:50 +02:00
home-manager = { # User Package Management
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-09-16 22:44:43 +02:00
nur = {
url = "github:nix-community/NUR"; # NUR Packages
};
2022-09-16 22:44:43 +02:00
2022-12-17 20:07:06 +01:00
agenix = {
url = "github:ryantm/agenix";
2023-02-04 08:50:56 +01:00
inputs.nixpkgs.follows = "nixpkgs";
2022-12-17 20:07:06 +01:00
};
2022-09-17 16:50:50 +02:00
};
outputs = inputs @ { self, nixpkgs, nixpkgs-stable, nixos-hardware, home-manager, nur, agenix, ... }: # Function that tells my flake which to use and what do what to do with the dependencies.
let # Variables that can be used in the config files
2022-09-17 16:50:50 +02:00
user = "kabbone";
location = "$HOME/.setup";
in # Use above variables in ...
{
nixosConfigurations = ( # NixOS configurations
2022-09-17 16:50:50 +02:00
import ./hosts { # Imports ./hosts/default.nix
inherit (nixpkgs) lib;
inherit inputs nixpkgs nixpkgs-stable nixos-hardware home-manager nur user location agenix; # 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
}