nixos/flake.nix

114 lines
3.5 KiB
Nix
Raw Normal View History

2023-06-21 17:41:35 +01:00
{
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";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
anyrun = {
url = "github:Kirottu/anyrun";
inputs.nixpkgs.follows = "nixpkgs";
};
wallpapers.url = "git+https://git.xenia.me.uk/xenia/wallpapers.git";
tokyonight = {
url = "github:folke/tokyonight.nvim";
flake = false;
};
};
2023-06-21 17:41:35 +01:00
outputs =
{ self, nixpkgs, home-manager, hyprland, anyrun, wallpapers, tokyonight, }:
let
systemConfig =
{ hostName, user ? "xenia", system ? "x86_64-linux", shell ? "zsh" }:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(final: prev: {
waybar = prev.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
})
];
};
in nixpkgs.lib.nixosSystem {
inherit pkgs;
specialArgs = { inherit hostName user shell hyprland; };
modules = [
./hosts/${hostName}/configuration.nix
./services/${hostName}.nix
{
networking = { inherit hostName; };
users.users.${user} = {
isNormalUser = true;
description = "Evie Litherland-Smith";
group = "users";
extraGroups = [ "networkmanager" "wheel" "video" ];
shell = pkgs.${shell};
openssh.authorizedKeys.keys = import ./auth/authorized_keys.nix;
};
}
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
extraSpecialArgs = {
inherit hostName user shell hyprland anyrun wallpapers
tokyonight;
shellConfig = ./home/shell/${shell}.nix;
};
users.${user} = import ./hosts/${hostName}/home.nix;
};
}
];
};
homeConfig = { hostName, user, system ? "x86_64-linux", shell ? "zsh" }:
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit hostName user shell hyprland anyrun wallpapers tokyonight;
shellConfig = ./home/shell/${shell}.nix;
};
modules = [ ./hosts/${hostName}/home.nix ];
};
in {
nixosConfigurations = {
Legion = systemConfig {
hostName = "Legion";
2023-08-31 12:33:10 +01:00
user = "xenia";
system = "x86_64-linux";
shell = "zsh";
};
Ronin = systemConfig {
hostName = "Ronin";
user = "elitherl";
system = "x86_64-linux";
shell = "zsh";
2023-07-16 18:51:45 +01:00
};
Vanguard = systemConfig {
hostName = "Vanguard";
user = "xenia";
system = "x86_64-linux";
shell = "zsh";
};
};
homeConfigurations = {
"tux@Monarch" = homeConfig {
hostName = "Monarch";
user = "tux";
system = "aarch64-darwin";
shell = "zsh";
};
};
};
2023-06-21 17:41:35 +01:00
}