website/flake.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

2023-11-05 12:19:00 +00:00
{
description = "Very simple sample of a Nix flake with NixOS and home-manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2023-11-08 13:16:55 +00:00
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2023-11-05 12:19:00 +00:00
};
2023-11-08 13:16:55 +00:00
outputs = inputs@{ nixpkgs, home-manager, ... }: let
system = "x86_64-linux";
nixSettings = { config, lib, pkgs, ... }: {
# Setting each of the flake inputs as part of the system registry
# including our own flake which is just renamed from "self" to
# "config".
nix.registry =
lib.mapAttrs'
(name: flake:
let
name' = if (name == "self") then "config" else name;
in
lib.nameValuePair name' { inherit flake; })
inputs;
};
in
{
2023-11-05 12:19:00 +00:00
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
2023-11-08 13:16:55 +00:00
nixSettings
2023-11-05 12:19:00 +00:00
./hosts/desktop
];
};
2023-11-08 13:16:55 +00:00
homeConfigurations.foodogsquared = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
nixSettings
./users/foodogsquared
];
};
2023-11-05 12:19:00 +00:00
};
}