Rename system to lib

This commit is contained in:
Oliver Davies 2024-02-29 08:24:01 +00:00
parent cf4c9710a2
commit addad268e5
18 changed files with 2 additions and 2 deletions

View file

@ -0,0 +1,50 @@
{
config,
desktop,
inputs,
pkgs,
self,
username,
...
}: let
desktop-config = import ./desktop.nix {inherit config inputs pkgs username;};
shared-config = import ../../shared/home-manager.nix {inherit inputs pkgs self username;};
shared-packages = import ../../shared/home-manager-packages.nix {inherit inputs pkgs;};
in {
imports =
if desktop
then [desktop-config shared-config]
else [shared-config];
home.packages =
shared-packages
++ pkgs.lib.optionals desktop [
pkgs.discord
pkgs.gimp
pkgs.gscan2pdf
pkgs.kdenlive
pkgs.meslo-lg
pkgs.obs-studio
pkgs.okular
pkgs.pamixer
pkgs.pass
pkgs.pavucontrol
pkgs.pinentry
pkgs.slack
pkgs.via
pkgs.vlc
pkgs.xsel
pkgs.xcape
pkgs.zoom-us
];
home.sessionVariables = {
EDITOR = "nvim";
LANG = "en_GB.UTF-8";
LC_ALL = "en_GB.UTF-8";
LC_CTYPE = "en_GB.UTF-8";
PATH = "$PATH:./vendor/bin:./node_modules/.bin";
PULUMI_SKIP_UPDATE_CHECK = "true";
RIPGREP_CONFIG_PATH = "$HOME/.config/ripgrep/config";
};
}

View file

@ -0,0 +1,43 @@
{
config,
inputs,
pkgs,
username,
}: {
imports = [
./modules/alacritty.nix
./modules/autorandr.nix
./modules/espanso.nix
./modules/i3.nix
];
services.dunst = {
enable = true;
settings = {
global = {
follow = "keyboard";
};
};
};
services.copyq.enable = true;
services.flameshot = {
enable = true;
settings = {
General = {
disabledTrayIcon = false;
saveAfterCopy = true;
savePath = "/home/${username}/Pictures/Screenshots";
showHelp = false;
uiColor = "#60a5fa";
};
};
};
programs.feh.enable = true;
programs.rofi.enable = true;
}

View file

@ -0,0 +1,27 @@
{
programs.alacritty = {
enable = true;
settings = {
window.opacity = 0.9;
window.padding = {
x = 15;
y = 15;
};
font = {
size = 12.0;
bold.style = "Regular";
normal.family = "GeistMono Nerd Font Mono";
# fc-list : family | sort | grep "Nerd Font"
offset.y = 12;
glyph_offset.y = 6;
};
shell = {program = "zsh";};
};
};
}

View file

@ -0,0 +1,43 @@
{username, ...}: {
services.autorandr.enable = true;
xdg.configFile."autorandr/postswitch" = {
executable = true;
text = ''
#!/usr/bin/env bash
feh --randomize --bg-scale /home/${username}/Pictures/Wallpaper/*;
'';
};
programs.autorandr = {
enable = true;
profiles = let
laptop = "00ffffffffffff000daef21400000000161c0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101363680a0703820402e1e240035ad10000018000000fe004e3134304843472d4751320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843472d4751320a2000bb";
monitor = "00ffffffffffff004c2d1710424e58432b1f0103803f24782ac8b5ad50449e250f5054bfef80714f810081c081809500a9c0b300010108e80030f2705a80b0588a0078682100001e000000fd00324b1e873c000a202020202020000000fc004c5532385235350a2020202020000000ff0048345a524130303132380a20200183020335f04961120313041f10605f2309070783010000e305c0006b030c002000b83c2000200167d85dc401788003e20f81e3060501023a801871382d40582c450078682100001e023a80d072382d40102c458078682100001e04740030f2705a80b0588a0078682100001e565e00a0a0a029503020350078682100001a000049";
in {
laptop = {
config.eDP-1 = {
enable = true;
mode = "1920x1080";
primary = true;
rate = "59.95";
};
fingerprint.eDP-1 = laptop;
};
desktop = {
config.HDMI-1 = {
enable = true;
mode = "2560x1440";
primary = true;
rate = "59.95";
};
fingerprint.HDMI-1 = monitor;
};
};
};
}

View file

@ -0,0 +1,80 @@
let
baseUrl = "https://www.oliverdavies.uk";
in {
services.espanso = {
enable = true;
configs = {
default = {
show_notifications = false;
};
};
matches = {
base = {
matches = [
{
trigger = ":archive";
replace = "${baseUrl}/archive";
}
{
trigger = ":atdc";
replace = "${baseUrl}/atdc";
}
{
trigger = ":call";
replace = "${baseUrl}/call";
}
{
trigger = ":coaching";
replace = "${baseUrl}/team-coaching";
}
{
trigger = ":daily";
replace = "${baseUrl}/daily";
}
{
trigger = ":dotfiles";
replace = "https://github.com/opdavies/dotfiles.nix";
}
{
trigger = ":dc";
replace = "Drupal Commerce";
}
{
trigger = ":dr";
replace = "Drupal";
}
{
trigger = ":gt";
replace = "Great, thanks!";
}
{
trigger = ":lh";
replace = "http://localhost";
}
{
trigger = ":podcast";
replace = "${baseUrl}/podcast";
}
{
trigger = ":pricing";
replace = "${baseUrl}/pricing";
}
{
trigger = ":talks";
replace = "${baseUrl}/talks";
}
{
trigger = ":website";
replace = "${baseUrl}";
}
{
trigger = ":zoom";
replace = "https://savvycal.com/opdavies/zoom";
}
];
};
};
};
}

View file

@ -0,0 +1,158 @@
{
config,
inputs,
self,
username,
pkgs,
...
}: let
modifier = "Mod4";
in {
xsession.windowManager.i3 = {
enable = true;
config = {
assigns = {
"7" = [{class = "vlc";}];
"8" = [{class = "0ad";}];
"9" = [
{class = "Slack";}
{class = "discord";}
];
};
defaultWorkspace = "workspace number 1";
focus.followMouse = false;
modifier = modifier;
keybindings = inputs.nixpkgs.lib.mkOptionDefault {
"${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi -show drun";
"${modifier}+Shift+b" = "exec ${pkgs.firefox}/bin/firefox";
"${modifier}+Shift+f" = "exec ${pkgs.xfce.thunar}/bin/thunar";
"${modifier}+Tab" = "workspace back_and_forth";
# Change focus.
"${modifier}+h" = "focus left";
"${modifier}+j" = "focus down";
"${modifier}+k" = "focus up";
"${modifier}+l" = "focus right";
# Move focused window.
"${modifier}+Shift+h" = "move left";
"${modifier}+Shift+j" = "move down";
"${modifier}+Shift+k" = "move up";
"${modifier}+Shift+l" = "move right";
"${modifier}+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui";
"${modifier}+Shift+p" = "exec ${pkgs.autorandr}/bin/autorandr --cycle";
"${modifier}+Shift+y" = "exec ${pkgs.copyq}/bin/copyq toggle";
"XF86AudioRaiseVolume" = "exec pamixer -ui 2 && pamixer --get-volume";
"XF86AudioLowerVolume" = "exec pamixer -ud 2 && pamixer --get-volume";
"XF86AudioMute" = "exec pamixer --toggle-mute && ( [ \"$(pamixer --get-mute)\" = \"true\" ] && echo 0";
"XF86MonBrightnessDown" = "exec brightnessctl set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p'";
"XF86MonBrightnessUp" = "exec brightnessctl set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p'";
};
terminal = "alacritty";
window = {
border = 0;
hideEdgeBorders = "none";
};
};
extraConfig = ''
set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
exec --no-startup-id ${pkgs.feh}/bin/feh --randomize --bg-scale /home/${username}/Pictures/Wallpaper/*;
default_border none
default_floating_border none
smart_borders on
smart_gaps on
#border backgr text indicator
client.focused #444444 #555555 #ffffff #dddddd
client.focused_inactive #222222 #333333 #888888 #292d2e
client.unfocused #222222 #111111 #888888 #292d2e
client.urgent #2f343a #900000 #ffffff #900000
'';
config = {
bars = [
{
position = "bottom";
statusCommand = "${pkgs.i3status}/bin/i3status";
colors = {
background = "#161616";
statusline = "#ffffff";
separator = "#333333";
focusedWorkspace = {
background = "#444444";
border = "#555555";
text = "#ffffff";
};
activeWorkspace = {
background = "#555555";
border = "#666666";
text = "#ffffff";
};
inactiveWorkspace = {
background = "#111111";
border = "#000000";
text = "#888888";
};
bindingMode = {
background = "#ff0000";
border = "#880000";
text = "#ffffff";
};
urgentWorkspace = {
background = "#ff0000";
border = "#880000";
text = "#ffffff";
};
};
}
];
fonts.names = ["GeistMono"];
gaps = {
smartBorders = "on";
smartGaps = true;
};
};
};
programs.i3status = {
enable = true;
general = {
colors = true;
color_bad = "#f7768e";
color_degraded = "#ff9e64";
color_good = "#c0caf5";
};
modules = {
cpu_temperature.enable = false;
ipv6.enable = false;
load.enable = false;
};
};
}