nixos-config/flake.nix

73 lines
3.1 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
2024-01-17 17:35:46 +01:00
# nixConfig = {
# extra-substituters = [ "https://app.cachix.org/cache/0uptime" ];
# extra-trusted-public-keys = [ "0uptime.cachix.org-1:ctw8yknBLg9cZBdqss+5krAem0sHYdISkw/IFdRbYdE=" ];
# };
inputs = # All flake references used to build my NixOS setup. These are dependencies.
{
2023-12-09 10:23:27 +01:00
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Nix Packages
2023-12-09 15:03:27 +01:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2023-12-09 10:23:27 +01:00
microvm = {
url = "github:astro/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-09-17 16:50:50 +02:00
impermanence.url = "github:nix-community/impermanence";
home-manager = { # User Package Management
2023-12-09 15:03:27 +01:00
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-09-16 22:44:43 +02:00
2023-12-16 11:58:44 +01:00
home-manager-unstable = { # User Package Management
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
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 = {
2023-12-09 10:23:27 +01:00
url = "github:Jovian-Experiments/Jovian-NixOS";
2023-12-16 11:58:44 +01:00
inputs.nixpkgs.follows = "nixpkgs-unstable";
2023-07-21 22:07:21 +02:00
};
2022-09-17 16:50:50 +02:00
};
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager, home-manager-unstable, nur, agenix, jovian-nixos, microvm, impermanence, ... }: # 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;
inherit inputs nixpkgs nixpkgs-unstable nixos-hardware home-manager home-manager-unstable nur user userdmz userserver location agenix jovian-nixos microvm impermanence; # 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
}