nixos/flake.nix

114 lines
3.3 KiB
Nix

{
description = "Evie's machine configurations";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
wallpapers.url = "git+https://git.xenia.me.uk/xenia/wallpapers.git";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: {
nixosConfigurations = let
userConfig = {
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
openssh.authorizedKeys.keys = import ./auth/authorized_keys.nix;
};
specialArgs = {inherit inputs userConfig;};
waybar-experimental-overlay = final: prev: {
waybar = prev.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
});
};
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
waybar-experimental-overlay
inputs.neovim-nightly-overlay.overlay
];
};
in {
Legion = let
hostname = "Legion";
in
nixpkgs.lib.nixosSystem {
inherit pkgs specialArgs;
modules = [./hosts/${hostname}/configuration.nix];
};
Vanguard = let
hostname = "Vanguard";
in
nixpkgs.lib.nixosSystem {
inherit pkgs specialArgs;
modules = [./hosts/${hostname}/configuration.nix];
};
Ronin = let
hostname = "Ronin";
in
nixpkgs.lib.nixosSystem {
inherit pkgs specialArgs;
modules = [./hosts/${hostname}/configuration.nix];
};
};
homeConfigurations = let
extraSpecialArgs = {inherit inputs;};
in {
# NixOS home configurations
"xenia@Vanguard" = let
hostname = "Vanguard";
pkgs = self.nixosConfigurations.${hostname}.pkgs;
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs extraSpecialArgs;
modules = [./hosts/${hostname}/home.nix];
};
"xenia@Legion" = let
hostname = "Legion";
pkgs = self.nixosConfigurations.${hostname}.pkgs;
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs extraSpecialArgs;
modules = [./hosts/${hostname}/home.nix];
};
"elitherl@Ronin" = let
hostname = "Ronin";
pkgs = self.nixosConfigurations.${hostname}.pkgs;
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs extraSpecialArgs;
modules = [./hosts/${hostname}/home.nix];
};
# Legacy home configurations
"tux@Monarch" = let
hostname = "Monarch";
system = "aarch64-darwin";
pkgs = nixpkgs.legacyPackages.${system};
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs extraSpecialArgs;
modules = [./hosts/${hostname}/home.nix];
};
};
};
}