nixos-config/flake.nix

58 lines
2.5 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";
microvm.url = "github:astro/microvm.nix";
microvm.inputs.nixpkgs.follows = "nixpkgs";
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
};
2023-07-21 22:07:21 +02:00
jovian-nixos = {
url = "github:Jovian-Experiments/Jovian-NixOS/development";
flake = false;
};
2022-09-17 16:50:50 +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.
let # Variables that can be used in the config files
2022-09-17 16:50:50 +02:00
user = "kabbone";
2023-10-16 10:33:47 +02:00
userdmz = "diablo";
userserver = "mephisto";
2022-09-17 16:50:50 +02:00
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;
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 = [ "@wheel" ];
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
}