nix-config/flake.nix

80 lines
2.2 KiB
Nix
Raw Normal View History

2024-05-11 15:53:20 +02:00
{
description = "A simple NixOS flake";
inputs = {
2024-05-19 17:02:35 +02:00
2024-05-11 15:53:20 +02:00
# NixOS official package source, using the nixos-23.11 branch here
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
2024-05-12 22:34:32 +02:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2024-05-11 15:53:20 +02:00
hardware.url = "github:nixos/nixos-hardware";
2024-05-19 17:02:35 +02:00
# Declarative dotfile management
2024-05-11 15:53:20 +02:00
home-manager = {
2024-05-13 13:48:17 +02:00
url = "github:nix-community/home-manager/";
2024-05-12 22:34:32 +02:00
inputs.nixpkgs.follows = "nixpkgs";
2024-05-11 15:53:20 +02:00
};
2024-05-19 17:02:35 +02:00
# Declarative partitioning and formatting
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-11 15:53:20 +02:00
2024-05-11 21:26:33 +02:00
# # Secrets management. See ./docs/secretsmgmt.md
# sops-nix = {
# url = "github:mic92/sops-nix";
# inputs.nixpkgs.follows = "nixpkgs";
# };
2024-05-11 15:53:20 +02:00
};
2024-05-19 20:11:53 +02:00
outputs = { self, nixpkgs, home-manager, disko, ... }@inputs:
2024-05-12 22:34:32 +02:00
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
];
inherit (nixpkgs) lib;
2024-05-20 15:26:11 +02:00
configVars = import /home/willifan/.nix-config/vars { inherit inputs lib; };
2024-05-12 22:34:32 +02:00
specialArgs = { inherit inputs outputs configVars nixpkgs; };
in
{
2024-05-11 15:53:20 +02:00
# Please replace my-nixos with your hostname
2024-05-12 22:34:32 +02:00
nixosConfigurations = {
2024-05-19 20:11:53 +02:00
2024-05-12 22:34:32 +02:00
Lenni = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
#home-manager.users.willifan = import ./users/willifan/home;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
}
2024-05-19 20:11:53 +02:00
disko.nixosModules.disko
./hosts
./users/willifan
];
};
Puenktchen = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
#home-manager.users.willifan = import ./users/willifan/home;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
}
disko.nixosModules.disko
2024-05-12 22:34:32 +02:00
./hosts
./users/willifan
];
};
2024-05-19 20:11:53 +02:00
2024-05-11 15:53:20 +02:00
};
};
2024-05-13 13:48:17 +02:00
}