Further configs for tower

This commit is contained in:
Jack O'Sullivan 2022-09-09 01:04:25 +01:00
parent 64847d5e8e
commit 5157ca2541
10 changed files with 438 additions and 28 deletions

View File

@ -1,7 +1,7 @@
{
home-manager.modules = {
common = ./common.nix;
gui = ./gui.nix;
gui = ./gui;
deploy-rs = ./deploy-rs.nix;
};
}

View File

@ -1,24 +0,0 @@
{ lib, pkgs, config, ... }:
let
inherit (lib) mkIf mkDefault mkMerge;
inherit (lib.my) mkBoolOpt';
cfg = config.my.gui;
in
{
options.my.gui = {
enable = mkBoolOpt' true "Enable settings and packages meant for graphical systems";
};
config = mkMerge [
(mkIf cfg.enable {
home = {
packages = with pkgs; [
(nerdfonts.override {
fonts = [ "DroidSansMono" "SourceCodePro" ];
})
];
};
})
];
}

View File

@ -0,0 +1,140 @@
{ lib, pkgs, config, ... }:
let
inherit (lib) mkIf mkDefault mkMerge mkForce;
inherit (lib.my) mkBoolOpt';
cfg = config.my.gui;
in
{
options.my.gui = {
enable = mkBoolOpt' true "Enable settings and packages meant for graphical systems";
standalone = mkBoolOpt' false "Enable settings for fully Nix managed systems";
};
config = mkIf cfg.enable (mkMerge [
{
home = {
packages = with pkgs; [
(nerdfonts.override {
fonts = [ "DroidSansMono" "SourceCodePro" ];
})
pavucontrol
];
};
programs = {
alacritty = {
enable = true;
settings = {
font.normal.family = "SauceCodePro Nerd Font Mono";
};
};
};
}
(mkIf cfg.standalone {
xdg = {
userDirs = {
enable = true;
createDirectories = true;
desktop = "$HOME/desktop";
documents = "$HOME/documents";
download = "$HOME/downloads";
music = "$HOME/music";
pictures = "$HOME/pictures";
publicShare = "$HOME/public";
templates = "$HOME/templates";
videos = "$HOME/videos";
};
};
home = {
pointerCursor = {
package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ";
gtk.enable = true;
};
};
fonts.fontconfig.enable = true;
wayland = {
windowManager = {
sway = {
enable = true;
xwayland = true;
config = {
input = {
"type:touchpad" = {
tap = "enabled";
natural_scroll = "enable";
};
};
output = {
"*".bg = "${./stop-nixos.png} stretch";
};
modifier = "Mod4";
terminal = "alacritty";
keybindings =
let
cfg = config.wayland.windowManager.sway.config;
mod = cfg.modifier;
in
lib.mkOptionDefault {
"${mod}+d" = null;
"${mod}+x" = "exec ${cfg.menu}";
"${mod}+q" = "kill";
"${mod}+Shift+q" = "exec swaynag -t warning -m 'bruh you really wanna kill sway?' -b 'ye' 'swaymsg exit'";
};
menu = "rofi -show run";
bars = mkForce [ ];
};
swaynag = {
enable = true;
};
};
};
};
programs = {
git = {
enable = true;
diff-so-fancy.enable = true;
userEmail = "jackos1998@gmail.com";
userName = "Jack O'Sullivan";
};
waybar = import ./waybar.nix { inherit lib pkgs config; };
rofi = {
enable = true;
font = "SauceCodePro Nerd Font Mono";
plugins = with pkgs; [
rofi-calc
rofi-emoji
];
extraConfig = {
modes = "window,run,ssh,filebrowser,calc,emoji";
};
};
chromium = {
enable = true;
package = (pkgs.chromium.override { enableWideVine = true; }).overrideAttrs (old: {
buildCommand = ''
${old.buildCommand}
# Re-activate Google sync
wrapProgram "$out"/bin/chromium \
--set NIXOS_OZONE_WL 1 \
--set GOOGLE_DEFAULT_CLIENT_ID "77185425430.apps.googleusercontent.com" \
--set GOOGLE_DEFAULT_CLIENT_SECRET "OTJgUOQcT7lO7GsGZq2G4IlT"
'';
});
};
};
})
]
);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

View File

@ -0,0 +1,215 @@
{ lib, pkgs, config, ... }:
let
inherit (lib) mkIf mkDefault mkMerge mkForce;
cfg = config.my.gui;
pkg = pkgs.waybar.override { withMediaPlayer = true; };
in
{
enable = true;
package = pkg;
systemd.enable = true;
settings = {
mainBar = {
height = 30;
spacing = 4;
modules-left = [ "sway/workspaces" "sway/mode" "custom/media" ];
modules-center = [ "sway/window" ];
modules-right = [
"idle_inhibitor" "pulseaudio" "network" "cpu" "memory" "temperature" "backlight"
"keyboard-state" "sway/language" "battery" "clock" "tray"
];
# Modules configuration
# "sway/workspaces": {
# "disable-scroll": true,
# "all-outputs": true,
# "format": "{name}: {icon}",
# "format-icons": {
# "1": "",
# "2": "",
# "3": "",
# "4": "",
# "5": "",
# "urgent": "",
# "focused": "",
# "default": ""
# }
# },
keyboard-state = {
numlock = true;
capslock = true;
format = "{name} {icon}";
format-icons = {
locked = "";
unlocked = "";
};
};
"sway/mode".format = "<span style=\"italic\">{}</span>";
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
};
tray = {
# "icon-size": 21,
spacing = 10;
};
clock = {
# "timezone": "America/New_York",
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = "{:%Y-%m-%d}";
};
cpu = {
format = "{usage}% ";
tooltip = false;
};
memory.format = "{}% ";
temperature = {
# "thermal-zone": 2,
# "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
critical-threshold = 80;
# "format-critical": "{temperatureC}°C {icon}",
format = "{temperatureC}°C {icon}";
format-icons = [ "" "" "" ];
};
backlight = {
# "device": "acpi_video1",
format = "{percent}% {icon}";
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
battery = {
states = {
# "good": 95,
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-alt = "{time} {icon}";
# "format-good": "", // An empty format will hide the module
# "format-full": "",
format-icons = [ "" "" "" "" "" ];
};
network = {
# "interface": "wlp2*", // (Optional) To force the use of this interface
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
tooltip-format = "{ifname} via {gwaddr} ";
format-linked = "{ifname} (No IP) ";
format-disconnected = "Disconnected ";
format-alt = "{ifname}: {ipaddr}/{cidr}";
};
pulseaudio = {
# "scroll-step": 1, // %, can be a float
format = "{volume}% {icon} {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
format-bluetooth-muted = " {icon} {format_source}";
format-muted = " {format_source}";
format-source = "{volume}% ";
format-source-muted = "";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "" "" ];
};
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
};
"custom/media" = {
format = "{icon} {}";
return-type = "json";
max-length = 40;
format-icons = {
spotify = "";
default = "🎜";
};
escape = true;
exec = ''${pkg}/bin/waybar-mediaplayer.py 2> /dev/null'';
# "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
};
};
};
style = ''
* {
font-size: 14px;
font-family: SauceCodePro Nerd Font Mono;
/*font-family: monospace;*/
}
window#waybar {
background: #292b2e;
color: #fdf6e3;
}
#custom-right-arrow-dark,
#custom-left-arrow-dark {
color: #1a1a1a;
}
#custom-right-arrow-light,
#custom-left-arrow-light {
color: #292b2e;
background: #1a1a1a;
}
#workspaces,
#clock.1,
#clock.2,
#clock.3,
#pulseaudio,
#memory,
#cpu,
#battery,
#disk,
#tray {
background: #1a1a1a;
}
#workspaces button {
padding: 0 2px;
color: #fdf6e3;
}
#workspaces button.focused {
color: #268bd2;
}
#workspaces button:hover {
box-shadow: inherit;
text-shadow: inherit;
}
#workspaces button:hover {
background: #1a1a1a;
border: #1a1a1a;
padding: 0 3px;
}
#pulseaudio {
color: #268bd2;
}
#memory {
color: #2aa198;
}
#cpu {
color: #6c71c4;
}
#battery {
color: #859900;
}
#disk {
color: #b58900;
}
#clock,
#pulseaudio,
#memory,
#cpu,
#battery,
#disk {
padding: 0 10px;
}
'';
}

View File

@ -14,6 +14,9 @@
cpu = {
intel.updateMicrocode = true;
};
opengl.extraPackages = with pkgs; [
intel-media-driver
];
};
boot = {
@ -75,6 +78,9 @@
enable = true;
extraConfig = mkForce "";
};
fprintd.enable = true;
blueman.enable = true;
};
networking = {
@ -101,6 +107,10 @@
];
systemd = {
services = {
systemd-networkd-wait-online.enable = false;
};
network = {
links = {
"10-wifi" = {
@ -114,6 +124,32 @@
my = {
user = {
tmphome = false;
homeConfig = {
services = {
network-manager-applet.enable = true;
};
home = {
packages = with pkgs; [
spotify
];
};
services = {
blueman-applet.enable = true;
};
wayland.windowManager.sway = {
config = {
input."1:1:AT_Translated_Set_2_keyboard".xkb_layout = "ie";
output.eDP-1.scale = "1";
};
};
my = {
gui.standalone = true;
};
};
};
#deploy.generate.system.mode = "boot";
@ -124,6 +160,8 @@
firewall = {
enable = true;
};
gui.enable = true;
};
};
};

View File

@ -14,5 +14,6 @@
network = ./network.nix;
pdns = ./pdns.nix;
nginx-sso = ./nginx-sso.nix;
gui = ./gui.nix;
};
}

27
nixos/modules/gui.nix Normal file
View File

@ -0,0 +1,27 @@
{ lib, pkgs, config, ... }:
let
inherit (lib) optional mkIf mkDefault mkMerge;
inherit (lib.my) mkBoolOpt';
cfg = config.my.gui;
in
{
options.my.gui = with lib.types; {
enable = mkBoolOpt' true "Whether to enable GUI system options.";
};
config = mkIf cfg.enable {
hardware = {
opengl.enable = mkDefault true;
};
services = {
pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
};
};
};
}

View File

@ -338,7 +338,18 @@ in
];
})
(mkIf config.networking.networkmanager.enable {
my.tmproot.persistence.config.directories = [ "/var/lib/NetworkManager" ];
my.tmproot.persistence.config.directories = [
"/var/lib/NetworkManager"
"/etc/NetworkManager/system-connections"
];
})
(mkIf config.services.fprintd.enable {
my.tmproot.persistence.config.directories = [
{
directory = "/var/lib/fprint";
mode = "700";
}
];
})
(mkIf config.my.build.isDevVM {
fileSystems = mkVMOverride {

View File

@ -1,6 +1,6 @@
{ lib, options, config, ... }:
let
inherit (lib) mkIf mkDefault mkOption mkMerge mkAliasDefinitions;
inherit (lib) mkIf mkDefault mkOption mkMerge mkAliasDefinitions optional;
inherit (lib.my) mkBoolOpt' mkOpt' mkDefault';
cfg = config.my.user;
@ -34,7 +34,9 @@ in
name = mkDefault' "dev";
isNormalUser = true;
uid = mkDefault 1000;
extraGroups = [ "wheel" "kvm" ];
extraGroups =
[ "wheel" "kvm" ] ++
(optional config.networking.networkmanager.enable "networkmanager");
password = mkIf (cfg.passwordSecret == null) (mkDefault "hunter2");
shell =
let shell = cfg.homeConfig.my.shell;