nixos/flake.nix

68 lines
1.9 KiB
Nix
Raw Normal View History

2023-12-14 17:23:01 -07:00
{
description = "NixOS system flake.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2023-12-14 21:58:29 -07:00
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
2023-12-18 20:12:41 -07:00
nur.url = "github:nix-community/NUR";
2023-12-14 17:23:01 -07:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-15 09:24:13 -07:00
2023-12-18 20:12:41 -07:00
# firefox-addons = {
# url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
# inputs.nixpkgs.follows = "nixpkgs";
# };
2023-12-14 17:23:01 -07:00
};
2023-12-18 20:12:41 -07:00
outputs = { self, nixpkgs, nixpkgs-stable, nur, home-manager, ... } @ inputs:
2023-12-14 17:23:01 -07:00
let
2023-12-15 09:24:13 -07:00
inherit (self) outputs;
2023-12-14 17:23:01 -07:00
system = "x86_64-linux";
userName = "nate";
2023-12-16 16:36:03 -07:00
fullName = "Nate Anderson";
email = "n8r@tuta.io";
2023-12-14 17:23:01 -07:00
hostName = "winmax";
2023-12-15 15:50:45 -07:00
desktop = "sway";
2023-12-16 16:36:03 -07:00
gaming = true;
timeZone = "America/Denver";
2023-12-15 09:24:13 -07:00
pkgs = nixpkgs.legacyPackages.${system};
2023-12-16 16:36:03 -07:00
stablePkgs = nixpkgs-stable.legacyPackages.${system};
2023-12-14 17:23:01 -07:00
in
{
2023-12-15 15:50:45 -07:00
2023-12-16 16:36:03 -07:00
nixosConfigurations = {
2023-12-14 17:23:01 -07:00
nixServer = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
2023-12-18 20:12:41 -07:00
# nixpkgs.overlays = [ nur.overlay ];
2023-12-16 16:36:03 -07:00
./nixos/server_configuration.nix
2023-12-14 17:23:01 -07:00
inputs.home-manager.nixosModules.default
];
};
2023-12-16 16:36:03 -07:00
nixDesktop = nixpkgs.lib.nixosSystem {
# Pass args to desktop configuration
2023-12-14 17:23:01 -07:00
specialArgs = {
2023-12-16 16:36:03 -07:00
inherit inputs outputs userName hostName desktop timeZone gaming;
2023-12-14 17:23:01 -07:00
};
modules = [
2023-12-16 16:36:03 -07:00
./nixos/desktop_configuration.nix
2023-12-14 17:23:01 -07:00
# Setup home manager
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${userName} = import ./modules/home-manager/home.nix;
home-manager.extraSpecialArgs = {
2023-12-16 16:36:03 -07:00
inherit inputs outputs userName fullName email hostName desktop gaming;
2023-12-14 17:23:01 -07:00
};
}
];
};
};
};
}