nixos/flake.nix

254 lines
7.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";
};
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";
};
};
outputs = {
nixpkgs,
home-manager,
wallpapers,
neovim-nightly-overlay,
...
}: let
home-config = {
imports = [home-manager.nixosModules.home-manager];
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
users.root = {
imports = [./home/env/bash.nix ./home/env/starship.nix];
home = {
username = "root";
homeDirectory = "/root";
stateVersion = "22.11";
};
};
};
};
xfce-bspwm-config = {pkgs, ...}: {
environment.systemPackages = with pkgs; [
nitrogen
power-profiles-daemon
xfce.thunar
flameshot
polybar
ranger
];
services.xserver = {
enable = true;
layout = "gb";
xkbVariant = "";
desktopManager = {
xterm.enable = false;
xfce = {
enable = true;
enableXfwm = false;
noDesktop = true;
};
};
windowManager.bspwm.enable = true;
displayManager = {
sddm = {
enable = true;
# theme = "catppuccin-macchiato";
settings = {General = {InputMethod = "";};};
};
defaultSession = "xfce+bspwm";
};
};
programs.i3lock = {
enable = true;
package = pkgs.i3lock-fancy;
};
};
wallpaper-config = {pkgs, ...}: {
xdg.configFile."nitrogen/bg-saved.cfg".text = ''
[xin_0]
file=${wallpapers.outputs.default}
mode=5
bgcolor=#000000
[xin_1]
file=${wallpapers.outputs.default}
mode=5
bgcolor=#000000
[xin_2]
file=${wallpapers.outputs.default}
mode=5
bgcolor=#000000
'';
xsession.windowManager.bspwm.extraConfig = ''${pkgs.nitrogen}/bin/nitrogen --restore '';
};
in {
nixosConfigurations = {
Legion = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
modules = [
home-config
./hosts/Legion
./services/Legion.nix
{
home-manager.users.xenia = {
imports = [./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
};
}
];
};
Vanguard = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [neovim-nightly-overlay.overlay];
};
modules = [
home-config
xfce-bspwm-config
./hosts/Vanguard
./services/sshd
./services/syncthing/Vanguard.nix
({pkgs, ...}: {
services.xserver.displayManager.autoLogin.user = "xenia";
hardware.steam-hardware.enable = true;
programs = {
xwayland.enable = true;
gamescope = {
enable = true;
capSysNice = true;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
gamescopeSession.enable = true;
};
};
home-manager.users.xenia = {
imports = [
./home/personal.nix
./home/desktop/bspwm.nix
./home/gui
wallpaper-config
];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
programs.neovim.package = pkgs.neovim-nightly;
};
})
];
};
Ronin = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [neovim-nightly-overlay.overlay];
};
modules = [
home-config
xfce-bspwm-config
./hosts/Ronin
./services/syncthing/Ronin.nix
({pkgs, ...}: {
services.xserver.displayManager.autoLogin.user = "elitherl";
home-manager.users.elitherl = {
imports = [
./home/work.nix
./home/desktop/bspwm.nix
./home/gui
wallpaper-config
];
home = {
username = "elitherl";
homeDirectory = "/home/elitherl";
stateVersion = "22.11";
};
programs.neovim.package = pkgs.neovim-nightly;
xdg.configFile."screenlayout.sh".text = ''
#!/usr/bin/env bash
if [[ "$(xrandr --query | grep -E '^DP-1-1 connected')" ]]; then
xrandr --output eDP-1 --off\
--output DP-1-1 --primary --mode 1920x1200 --pos 0x185 --rotate normal\
--output DP-1-2 --mode 1920x1080 --pos 1920x0 --rotate left --output DP-1-3 --off
else
xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
fi
'';
xsession.windowManager.bspwm.extraConfig = ''
${pkgs.bash}/bin/bash $HOME/.config/screenlayout.sh
'';
};
})
];
};
};
homeConfigurations = {
"tux@Monarch" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-darwin";
modules = [
({pkgs, ...}: {
imports = [./home/personal.nix ./home/gui/wezterm.nix];
home = {
username = "tux";
homeDirectory = "/Users/tux";
stateVersion = "23.05";
packages = [pkgs.gcc];
};
programs = {
home-manager.enable = true;
zsh = {
sessionVariables.CC = "${pkgs.gcc}/bin/gcc";
envExtra = ''
eval "$(/opt/homebrew/bin/brew shellenv)"
'';
};
};
services.syncthing.enable = true;
})
];
};
"xenia@Northstar" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-linux";
modules = [
{
imports = [./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
programs = {
home-manager.enable = true;
bash.bashrcExtra = ''
source $HOME/.nix-profile/etc/profile.d/nix.sh
'';
};
services.syncthing.enable = true;
fonts.fontconfig.enable = true;
}
];
};
};
};
}