this configuration currently will build 2 hosts, apollo and absolution, however these are not completed yet, they will build using alyx configs for niri, etc and alyx git settings. this will be fixed in due course. todo: add all hosts to flake.nix, add in waybar configuration for maya, change keyboard layout based on username for gb on alyx and us on maya, configuration comb through, add in files like firewall.nix and monado.nix, and generally complete home manager configuration

This commit is contained in:
cydiralis 2025-06-25 04:05:38 +01:00
parent b43b8f0464
commit 2a4af3bd83
No known key found for this signature in database
36 changed files with 3418 additions and 17 deletions

116
home/default.nix Normal file
View file

@ -0,0 +1,116 @@
{config, pkgs, lib, inputs, vars, ...}:{
imports = [
#home-manager modules
inputs.nix-index-database.hmModules.nix-index
inputs.nixvim.homeManagerModules.default
inputs.catppuccin.homeModules.catppuccin
inputs.niri.homeModules.niri
#aux files to make finding specific things easier
./theming.nix
./nixvim
#./sway.nix
#./hyprland.nix
./niri.nix
./packages.nix #general user packages not managed by home-manager but i want to install via hm anyways
];
home = rec {
username = vars.user; #this is set in flake.nix
homeDirectory = "/home/${username}"; #change this if you use a non-standard home dir
stateVersion = "23.11";
file = {
".config/waybar/config".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/config";
".config/waybar/style.css".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/style.css";
# ".config/hypr/hyprlock.conf".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/locking/hyprlock.conf";
};
};
programs.home-manager.enable = (!vars.isNixOS); #value is set in flake.nix
programs.foot = {
enable = true;
settings.main.font = "monospace:size=14";
settings.colors.alpha = "0.9";
};
programs.ncmpcpp = {
enable = (vars.class != "handheld");
settings = {
tags_separator = ";";
};
};
services.mpd = {
enable = (vars.class != "handheld");
musicDirectory = "/home/${vars.user}/Music";
extraConfig = ''
audio_output {
type "pipewire"
name "default pipewire"
}
'';
};
services.mpd-mpris = {
enable = (vars.class != "handheld");
};
services.mpd-discord-rpc.enable = true;
programs.waybar = {
enable = (vars.class != "handheld");
};
programs.git = {
enable = true;
userName = "cydiralis";
userEmail = "cydiralis@proton.me";
extraConfig = {
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_ed25519.pub";
init.defaultBranch = "main";
};
};
xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.monado}/share/openxr/1/openxr_monado.json";
xdg.configFile."openvr/openvrpaths.vrpath".text = ''
{
"config" :
[
"${config.xdg.dataHome}/Steam/config"
],
"external_drivers" : null,
"jsonid" : "vrpathreg",
"log" :
[
"${config.xdg.dataHome}/Steam/logs"
],
"runtime" :
[
"${pkgs.opencomposite}/lib/opencomposite"
],
"version" : 1
}
'';
programs.irssi = {
enable = true;
networks = {
classicconnect = {
nick = "alyx";
server = {
address = "irc.classicconnect.net";
port = 6677;
autoConnect = true;
};
channels = {
nick.autoJoin = true;
};
};
};
};
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-backgroundremoval
obs-pipewire-audio-capture
];
};
}

313
home/niri.nix Normal file
View file

@ -0,0 +1,313 @@
{lib, osConfig, pkgs, inputs, vars, config, ...}:{
xdg.portal = {
enable = true;
config.niri = {
default = [ "gnome" "gtk" ];
"org.freedesktop.impl.portal.Access" = [ "gtk" ];
"org.freedesktop.impl.portal.Notification" = [ "gtk" ];
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
"org.freedesktop.impl.portal.FileChooser" = [ "gtk" ];
};
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
xdg-desktop-portal-gtk
];
};
programs.niri = {
enable = true;
settings = {
input.touchpad = {
accel-profile = "flat";
click-method = "clickfinger";
scroll-factor = 0.3;
tap = false;
};
input.trackpoint = {
accel-profile = "flat";
};
prefer-no-csd = true;
input.keyboard.xkb.layout = "gb";
input.focus-follows-mouse.enable = true;
binds = with config.lib.niri.actions; lib.mkDefault {
"Mod+Return".action = spawn "foot";
"Mod+N".action = spawn "swaync-client" "-t";
"XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+";
"XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-";
"XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle";
"Mod+D".action = spawn "foot" "--title" "launch" "--app-id" "fzf-launcher-foot" "bash" "-c" "niri msg action spawn -- bash -c \"$(compgen -c | sort -u | fzf --bind=enter:replace-query+print-query) >/dev/null\"";
"Mod+T".action = spawn "foot" "--title" "music" "--app-id" "mpd-control-foot" "ncmpcpp";
"Mod+Shift+Q" = {
repeat = false;
action = close-window;
};
"XF86AudioMicMute" = {
allow-when-locked = true;
action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle" ];
};
"Mod+Q".action.close-window = {};
"Mod+Left".action.focus-column-left = {};
"Mod+Down".action.focus-window-down = {};
"Mod+Up".action.focus-window-up = {};
"Mod+Right".action.focus-column-right = {};
"Mod+H".action.focus-column-left = {};
"Mod+J".action.focus-window-down = {};
"Mod+K".action.focus-window-up = {};
"Mod+L".action.focus-column-right = {};
"Mod+Shift+Left".action.move-column-left = {};
"Mod+Shift+Down".action.move-window-down = {};
"Mod+Shift+Up".action.move-window-up = {};
"Mod+Shift+Right".action.move-column-right = {};
"Mod+Shift+H".action.move-column-left = {};
"Mod+Shift+J".action.move-window-down = {};
"Mod+Shift+K".action.move-window-up = {};
"Mod+Shift+L".action.move-column-right = {};
# Alternative commands that move across workspaces when reaching
# the first or last window in a column.
# Mod+J { focus-window-or-workspace-down; }
# Mod+K { focus-window-or-workspace-up; }
# Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
# Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
"Mod+Home".action.focus-column-first = {};
"Mod+End".action.focus-column-last = {};
"Mod+Ctrl+Home".action.move-column-to-first = {};
"Mod+Ctrl+End".action.move-column-to-last = {};
/* "Mod+Shift+Left".action.focus-monitor-left = {};
"Mod+Shift+Down".action.focus-monitor-down = {};
"Mod+Shift+Up".action.focus-monitor-up = {};
"Mod+Shift+Right".action.focus-monitor-right = {};
"Mod+Shift+H".action.focus-monitor-left = {};
"Mod+Shift+J".action.focus-monitor-down = {};
"Mod+Shift+K".action.focus-monitor-up = {};
"Mod+Shift+L".action.focus-monitor-right = {};
*/
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {};
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {};
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {};
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {};
"Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {};
"Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {};
"Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {};
"Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = {};
# Alternatively, there are commands to move just a single window:
# Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
# ...
# And you can also move a whole workspace to another monitor:
# Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
# ...
"Mod+Page_Down".action.focus-workspace-down = {};
"Mod+Page_Up".action.focus-workspace-up = {};
"Mod+U".action.focus-workspace-down = {};
"Mod+I".action.focus-workspace-up = {};
"Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {};
"Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {};
"Mod+Ctrl+U".action.move-column-to-workspace-down = {};
"Mod+Ctrl+I".action.move-column-to-workspace-up = {};
# Alternatively, there are commands to move just a single window:
# Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
# ...
"Mod+Shift+Page_Down".action.move-workspace-down = {};
"Mod+Shift+Page_Up".action.move-workspace-up = {};
"Mod+Shift+U".action.move-workspace-down = {};
"Mod+Shift+I".action.move-workspace-up = {};
# You can bind mouse wheel scroll ticks using the following syntax.
# These binds will change direction based on the natural-scroll setting.
#
# To avoid scrolling through workspaces really fast, you can use
# the cooldown-ms property. The bind will be rate-limited to this value.
# You can set a cooldown on any bind, but it's most useful for the wheel.
"Mod+WheelScrollDown" = {
cooldown-ms = 150;
action.focus-workspace-down = {};
};
"Mod+WheelScrollUp" = {
cooldown-ms = 150;
action.focus-workspace-up = {};
};
"Mod+Ctrl+WheelScrollDown" = {
cooldown-ms = 150;
action.move-column-to-workspace-down = {};
};
"Mod+Ctrl+WheelScrollUp" = {
cooldown-ms = 150;
action.move-column-to-workspace-up = {};
};
"Mod+WheelScrollRight".action.focus-column-right = {};
"Mod+WheelScrollLeft".action.focus-column-left = {};
"Mod+Ctrl+WheelScrollRight".action.move-column-right = {};
"Mod+Ctrl+WheelScrollLeft".action.move-column-left = {};
# Usually scrolling up and down with Shift in applications results in
# horizontal scrolling; these binds replicate that.
"Mod+Shift+WheelScrollDown".action.focus-column-right = {};
"Mod+Shift+WheelScrollUp".action.focus-column-left = {};
"Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {};
"Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {};
# Similarly, you can bind touchpad scroll "ticks".
# Touchpad scrolling is continuous, so for these binds it is split into
# discrete intervals.
# These binds are also affected by touchpad's natural-scroll, so these
# example binds are "inverted", since we have natural-scroll enabled for
# touchpads by default.
# Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
# Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
# You can refer to workspaces by index. However, keep in mind that
# niri is a dynamic workspace system, so these commands are kind of
# "best effort". Trying to refer to a workspace index bigger than
# the current workspace count will instead refer to the bottommost
# (empty) workspace.
#
# For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
# will all refer to the 3rd workspace.
"Mod+1".action.focus-workspace = 1;
"Mod+2".action.focus-workspace = 2;
"Mod+3".action.focus-workspace = 3;
"Mod+4".action.focus-workspace = 4;
"Mod+5".action.focus-workspace = 5;
"Mod+6".action.focus-workspace = 6;
"Mod+7".action.focus-workspace = 7;
"Mod+8".action.focus-workspace = 8;
"Mod+9".action.focus-workspace = 9;
"Mod+Shift+1".action.move-column-to-workspace = 1;
"Mod+Shift+2".action.move-column-to-workspace = 2;
"Mod+Shift+3".action.move-column-to-workspace = 3;
"Mod+Shift+4".action.move-column-to-workspace = 4;
"Mod+Shift+5".action.move-column-to-workspace = 5;
"Mod+Shift+6".action.move-column-to-workspace = 6;
"Mod+Shift+7".action.move-column-to-workspace = 7;
"Mod+Shift+8".action.move-column-to-workspace = 8;
"Mod+Shift+9".action.move-column-to-workspace = 9;
# Alternatively, there are commands to move just a single window:
# Mod+Ctrl+1 { move-window-to-workspace 1; }
# Switches focus between the current and the previous workspace.
# Mod+Tab { focus-workspace-previous; }
"Mod+Comma".action.consume-window-into-column = {};
"Mod+Period".action.expel-window-from-column = {};
# There are also commands that consume or expel a single window to the side.
# Mod+BracketLeft { consume-or-expel-window-left; }
# Mod+BracketRight { consume-or-expel-window-right; }
"Mod+R".action.switch-preset-column-width = {};
"Mod+Shift+R".action.reset-window-height = {};
"Mod+F".action.maximize-column = {};
"Mod+Shift+F".action.fullscreen-window = {};
"Mod+C".action.center-column = {};
# Finer width adjustments.
# This command can also:
# * set width in pixels: "1000"
# * adjust width in pixels: "-5" or "+5"
# * set width as a percentage of screen width: "25%"
# * adjust width as a percentage of screen width: "-10%" or "+10%"
# Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
# set-column-width "100" will make the column occupy 200 physical screen pixels.
"Mod+Minus".action.set-column-width = "-10%";
"Mod+Equal".action.set-column-width = "+10%";
# Finer height adjustments when in column with other windows.
"Mod+Shift+Minus".action.set-window-height = "-10%";
"Mod+Shift+Equal".action.set-window-height = "+10%";
# Actions to switch layouts.
# Note: if you uncomment these, make sure you do NOT have
# a matching layout switch hotkey configured in xkb options above.
# Having both at once on the same hotkey will break the switching,
# since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
# Mod+Space { switch-layout "next"; }
# Mod+Shift+Space { switch-layout "prev"; }
"Print".action.screenshot = {};
"Ctrl+Print".action.screenshot-screen = {};
"Alt+Print".action.screenshot-window = {};
# The quit action will show a confirmation dialog to avoid accidental exits.
"Mod+Shift+E".action.quit = {};
# Powers off the monitors. To turn them back on, do any input like
# moving the mouse or pressing any other key.
"Mod+Shift+P".action.power-off-monitors = {};
};
outputs.DP-1 = {
mode = {
height = 1080;
refresh = 239.76;
width = 1920;
};
position = {
x = 2560;
y = 0;
};
};
outputs.DP-4 = {
mode = {
height = 1080;
refresh = 75.0;
width = 2560;
};
position = {
x = 0;
y = 0;
};
};
spawn-at-startup = [
{command = ["waybar"];}
{command = ["xwayland-satellite"];}
{command = if !vars.isTough then ["swaybg" "-m" "fill" "-i" "/home/alyx/.config/nixos/assets/scenes.jpg"] else ["swaybg" "-m" "fill" "-i" "/home/alyx/.config/nixos/assets/scenes.jpg"];}
{command = ["udiskie" "--appindicator"];}
];
environment = {
DISPLAY = ":0";
};
window-rules = [
{matches = [{title = "^launch$";}];
open-floating = true;
}
{matches = [{title = "^music$";}];
open-floating = true;
}
{matches = [{title = "^(Picture-in-Picture)$";}];
open-floating = true;
}
{matches = [{title = "^music$";}];
open-floating = true;
}
{
geometry-corner-radius = {
bottom-left = 12.0;
bottom-right = 12.0;
top-left = 12.0;
top-right = 12.0;
};
draw-border-with-background = false;
clip-to-geometry = true;
}
];
layout = {
focus-ring = {
enable = true;
width = 2;
active = {color = "rgb(203 166 247)";};
inactive = {color = "rgb(68 12 136)";};
};
};
};
};
}

129
home/waybar/config Normal file
View file

@ -0,0 +1,129 @@
[{
"position": "top",
"modules-left": ["group/traydrawer", "custom/weather"],
"modules-center": ["cpu", "group/mpdcontrols", "cpu#frequency"],
"modules-right": ["clock", "wireplumber", "battery", "memory", "disk", "group/poweroptions"],
"margin-top": 8,
"margin-left": 8,
"margin-right": 8,
"height": 40,
"wireplumber": {
"on-click": "pavucontrol",
"format": "󰓃 {volume}%",
"format-muted": "󰓄 {volume}%",
},
"battery": {
"interval": 5,
"format-icons": [" ", " ", " ", " ", " "],
"states": {
"warning": 26,
"critical": 15,
"dead": 5
},
"format": "{icon} {capacity}%",
"tooltip-format": "BAT0, {power}W",
},
"group/mpdcontrols": {
"orientation": "inherit",
"drawer": {
"transition-duration": 250,
"transition-left-to-right": true
},
"modules": ["mpd", "custom/playpause", "custom/prev", "custom/next"]
},
"custom/playpause": {
"format": " 󰐎 ",
"on-click": "mpc toggle"
},
"custom/prev": {
"format": " 󰒮 ",
"on-click": "mpc prev"
},
"custom/next": {
"format": "󰒭 ",
"on-click": "mpc next"
},
"group/traydrawer": {
"orientation": "inherit",
"modules": ["custom/trayadvisory", "tray"],
"drawer": {
"transition-duration": 250
}
},
"mpd": {
"on-click": "mpc toggle",
"format-disconnected": " MPD disconnected ",
"format-stopped": " Nothing Playing! ",
"format": "  {title} - {album} - {artist} ",
"format-paused": "  {title} - {album} - {artist} ",
"on-scroll-up": "mpc volume +5",
"on-scroll-down": "mpc volume -5",
},
"custom/trayadvisory": {
"format": " "
},
"custom/systemadvisory": {
"format": "󱖫 "
},
"group/poweroptions": {
"orientation": "inherit",
"modules": ["custom/poweroff", "custom/logout"],
"drawer": {
"transition-duration": 250
}
},
"custom/poweroff": {
"format": "⏻ ",
"on-click": "shutdown now",
},
"custom/logout": {
"format": " | 󰩈 ",
"on-click": "swaymsg exit",
},
"custom/weather": {
"format": "{}°",
"tooltip": true,
"interval": 3600,
"exec": "wttrbar --nerd --location edinburgh",
"return-type": "json"
},
"group/systemstatus": {
"orientation": "inherit",
"modules": ["custom/systemadvisory", "memory", "disk"],
"drawer": {
"click-to-reveal": true,
"transition-duration": 250,
}
},
"cpu": {
"format": "  {usage}% ",
"states": { "highcpu": 85 },
},
"cpu#frequency": {
"format": "{max_frequency}GHz"
},
"memory": {
"format": " {avail:0.0f} GiB  {swapAvail:0.0f} GiB"
},
"disk": {
"format": " {specific_free:0.1f} GiB",
"unit": "GiB",
},
}]

108
home/waybar/style.css Normal file
View file

@ -0,0 +1,108 @@
#waybar {
background: repeating-linear-gradient(
0.25turn,
#082100 5px,
#22391b 10px,
#082100 15px
);
font-family: "Iosevka NF";
color: #2db300;
border: 2px solid #2aff36;
border-radius: 11px;
}
#wireplumber,
#cpu,
#cpu-frequency,
#battery,
#clock,
#memory,
#disk,
#mpdcontrols,
#poweroptions
{
border: 2px solid #2aff36;
/*margin: 3px;*/
min-height: 0;
margin-left: 4px;
margin-right: 4px;
margin-top: 7px;
margin-bottom: 7px;
padding: 2px;
padding-left: 5px;
padding-right: 5px;
border-radius: 4px;
}
#custom-trayadvisory {
margin: 3px 10px 3px;
}
/*#poweroptions {
border: 2px solid #2aff36;
border-radius: 11 11 11 11px;
min-height: 0;
padding: 6px;
}*/
#poweroptions {
margin-right: 10px;
padding-left: 8px;
}
#workspaces {
border: 0.2em solid #2aff36;
}
#battery.warning {
background: repeating-linear-gradient(
0.25turn,
#7b7537 20px,
#a18f48 30px,
#7b7537 40px
);
color: #cfceb4
}
#battery.critical,
#battery.dead {
background: repeating-linear-gradient(
0.25turn,
#7b3737 20px,
#a14848 30px,
#7b3737 40px
);
color: #cfb4b4
}
#battery.charging {
background: repeating-linear-gradient(
0.25turn,
#37757b 20px,
#4899a1 30px,
#37757b 40px
);
color: #b4cccf
}
#mpd.playing {
background: repeating-linear-gradient(
0.25turn,
#824554 5px,
#9d5566 10px,
#824554 15px
);
color: #CFB4BA;
}
#cpu.highcpu {
background: repeating-linear-gradient(
0.25turn,
#824554 5px,
#9d5566 10px,
#824554 15px
);
color: #CFB4BA;
}