nixos/flake.nix

263 lines
8.3 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";
};
2023-06-27 22:03:15 +01:00
newm = {
url = "sourcehut:~atha/newm-atha";
inputs.nixpkgs.follows = "nixpkgs";
};
wallpapers.url = "git+https://git.xenia.me.uk/xenia/wallpapers.git";
};
2023-06-21 17:41:35 +01:00
outputs = {
2023-06-21 17:41:35 +01:00
nixpkgs,
home-manager,
hyprland,
wallpapers,
...
}: 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";
};
};
};
};
hyprland-config = {pkgs, ...}: {
imports = [hyprland.nixosModules.default];
environment.systemPackages = with pkgs; [
gsettings-desktop-schemas
pavucontrol
pamixer
pulseaudio
pipewire
wireplumber
wl-clipboard
swayimg
hyprpaper
grim
slurp
];
security.pam.services.swaylock = {};
programs = {
hyprland.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
};
services = {
gvfs.enable = true; # Mount, trash, and other functionalities
tumbler.enable = true; # Thumbnail support for images
greetd = {
enable = true;
settings = rec {
initial_session.command = "Hyprland";
default_session = initial_session;
};
};
};
};
hyprland-home-config = {pkgs, ...}: {
imports = [
hyprland.homeManagerModules.default
./home/desktop/hyprland.nix
./home/gui
];
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload = ${wallpapers.outputs.default}
wallpaper = ,${wallpapers.outputs.default}
'';
};
waybar-experimental = self: super: {waybar = super.waybar.overrideAttrs (oldAttrs: {mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];});};
in {
2023-06-21 21:23:51 +01:00
nixosConfigurations = {
2023-06-22 09:03:42 +01:00
Legion = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
2023-06-22 09:03:42 +01:00
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";
};
};
}
2023-06-22 09:03:42 +01:00
];
};
2023-06-22 14:31:35 +01:00
Vanguard = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [waybar-experimental];
};
2023-06-22 14:31:35 +01:00
modules = [
home-config
hyprland-config
./hosts/Vanguard
2023-06-22 14:31:35 +01:00
./services/sshd
2023-06-27 07:39:29 +01:00
./services/syncthing/Vanguard.nix
{
home-manager.users.xenia = {
imports = [hyprland-home-config ./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf
monitor=DP-2,highrr,auto,auto
workspace = name:steam
windowrule = workspace name:steam, [Ss]team.*
bind = ALT, S, moveworkspacetomonitor, name:steam current
bind = ALT, S, workspace, name:steam
bind = ALT SHIFT, S, moveworkspacetomonitor, name:steam current
bind = ALT SHIFT, S, movetoworkspace, name:steam
'';
programs.waybar.settings = {
main."wlr/workspaces"."format-icons"."steam" = "󰓓";
};
};
}
2023-06-22 14:31:35 +01:00
];
};
Ronin = nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [waybar-experimental];
};
2023-06-21 21:23:51 +01:00
modules = [
home-config
hyprland-config
./hosts/Ronin
./services/syncthing/Ronin.nix
({pkgs, ...}: let
laptop-state = pkgs.writeShellScriptBin "check-laptop-lid-state" ''
grep closed /proc/acpi/button/lid/LID0/state &&\
hyprctl keyword monitor "eDP-1,disable" ||\
hyprctl keyword monitor "eDP-1,1920x1080,0x0,1.0"
'';
in {
home-manager.users.elitherl = {
imports = [hyprland-home-config ./home/work.nix];
home = {
username = "elitherl";
homeDirectory = "/home/elitherl";
stateVersion = "22.11";
packages = [laptop-state];
};
wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf
bindl=,switch:Lid Switch,exec,check-laptop-lid-state
exec = ${laptop-state}/bin/check-laptop-lid-state
monitor = DP-3,1920x1200,1920x0,1.0
monitor = DP-4,1920x1080,3840x0,1.0,transform,1
workspace = name:remote
windowrule = workspace name:chat, teams-for-linux
windowrule = workspace name:remote, Nxplayer.*
bind = ALT, R, moveworkspacetomonitor, name:remote current
bind = ALT, R, workspace, name:remote
bind = ALT SHIFT, R, moveworkspacetomonitor, name:remote current
bind = ALT SHIFT, R, movetoworkspace, name:remote
'';
programs.waybar.settings = {
main = {
"output" = "!DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
};
alt = {
"include" = [
"~/.config/waybar/modules.json"
"~/.config/waybar/layout.json"
];
"output" = "DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
"modules-left" = [];
"modules-center" = ["wlr/workspaces"];
"modules-right" = [];
};
};
};
})
2023-06-21 21:23:51 +01:00
];
};
2023-06-21 17:41:35 +01:00
};
2023-06-21 21:23:51 +01:00
homeConfigurations = {
"tux@Monarch" = home-manager.lib.homeManagerConfiguration {
2023-06-28 18:26:37 +01:00
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;
})
];
2023-06-21 21:23:51 +01:00
};
"xenia@Northstar" = home-manager.lib.homeManagerConfiguration {
2023-06-28 18:26:37 +01:00
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;
}
];
2023-06-21 21:23:51 +01:00
};
};
2023-06-21 17:41:35 +01:00
};
}