nixos/flake.nix

92 lines
2.1 KiB
Nix

{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix/master";
inputs.nixpkgs.follows = "nixpkgs";
};
install-system = {
url = "path:scripts/install-system";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
home-manager,
install-system,
...
}@inputs:
let
system = "x86_64-linux";
host = "vm";
profile = "vm";
username = "josh";
in
{
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
./hosts/${host}
];
};
live = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
./hosts/${host}
];
};
nixosvm = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
./hosts/${host}
];
};
};
devShell.${system} = nixpkgs.legacyPackages.${system}.pkgs.mkShell {
packages = with nixpkgs.legacyPackages.${system}.pkgs; [
nil
nixd
];
};
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-tree;
};
}