Evie Litherland-Smith
8c5ba7f4c3
Move home-manager setup back into being NixOS module where possible Parameterise common elements of system config to minimise rewriting and pass as function to all places needed
113 lines
3.4 KiB
Nix
113 lines
3.4 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";
|
|
};
|
|
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;
|
|
};
|
|
};
|
|
|
|
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 user 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 user shell hyprland anyrun wallpapers tokyonight;
|
|
shellConfig = ./home/shell/${shell}.nix;
|
|
};
|
|
modules = [ ./hosts/${hostName}/home.nix ];
|
|
};
|
|
in {
|
|
nixosConfigurations = {
|
|
Legion = systemConfig {
|
|
hostName = "Legion";
|
|
user = "elitherl";
|
|
system = "x86_64-linux";
|
|
shell = "zsh";
|
|
};
|
|
Ronin = systemConfig {
|
|
hostName = "Ronin";
|
|
user = "elitherl";
|
|
system = "x86_64-linux";
|
|
shell = "zsh";
|
|
};
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
}
|