Add back lacros and some keybind stuff

This commit is contained in:
Jimbo 2024-12-10 17:54:39 -05:00
parent 7c5ff0253e
commit 7540a2156a
26 changed files with 134 additions and 157 deletions

View file

@ -10,6 +10,8 @@
../../modules/system
];
networking.enableB43Firmware = true;
system.wireguard.client.enable = true;
networking.wireguard.interfaces.wgc.ips = [ "10.100.0.21/24" ];

View file

@ -3,37 +3,5 @@
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernel.sysctl."vm.max_map_count" = 2147483642;
initrd = {
systemd = {
enable = true;
services.root-reset = {
description = "Reset root and snapshot last boot";
wantedBy = [ "initrd.target" ];
after = [ "dev-${config.networking.hostName}-root.device" ];
before = [ "sysroot.mount" ];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
mkdir -p /mnt
mount /dev/${config.networking.hostName}/root /mnt
if [[ -e /mnt/prev ]]; then
btrfs subvolume delete /mnt/prev
fi
btrfs subvolume snapshot /mnt/root /mnt/prev
btrfs subvolume list -o /mnt/root | cut -f9 -d' ' | while read subvolume; do
btrfs subvolume delete "/mnt/$subvolume"
done
btrfs subvolume delete /mnt/root
btrfs subvolume create /mnt/root
umount /mnt
'';
};
};
};
};
}

View file

@ -3,26 +3,10 @@
imports = [
./boot
./disko
./filesystems
./hardware
./wireguard
# Apps and programs
../../../modules/system
../../../modules/system/accounts
../../../modules/system/desktop
../../../modules/system/programs
../../../modules/system/services
# Devices and hardware
../../../modules/system/devices
../../../modules/system/devices/boot/lanzaboote
../../../modules/system/devices/networking/wireless
../../../modules/system/devices/networking/firewall/pc
../../../modules/system/devices/networking/wireguard/pc
# Extras
../../../overlays
../../../variables
./users
../../modules/system
];
services.keyd.keyboards.default.settings.main = {
@ -31,5 +15,8 @@
f13 = lib.mkForce "delete";
};
system.lanzaboote.enable = true;
networking.hostName = "lacros";
system.stateVersion = "24.11";
}

View file

@ -6,25 +6,26 @@
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/nvme0n1";
device = "/dev/mmcblk0";
content = {
type = "gpt";
partitions = {
ESP = {
size = "2G";
priority = 1;
size = "1500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "fmask=0022" "dmask=0022" ];
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypt-nvme";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
@ -50,34 +51,34 @@
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/persist/.snapshots" = { };
"/jimbo" = {
mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/jimbo/.snapshots" = { };
};
};
};
swap = {
size = "8G";
size = "1500M";
content = {
type = "swap";
discardPolicy = "both";

View file

@ -0,0 +1,11 @@
{ config, ... }:
{
fileSystems = {
# Network mounts
"/home/jimbo/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ];
};
};
}

View file

@ -1,22 +1,9 @@
{ config, lib, modulesPath, ... }:
{ config, lib, ... }:
{
boot = {
kernelModules = [ "kvm-intel" ];
initrd = {
availableKernelModules = [ "xhci_pci" "sdhci_pci" ];
kernelModules = [ "dm-snapshot" ];
};
};
fileSystems = {
# Remote
"/home/jimbo/JimboNFS" = {
device = "${config.ips.wgSpan}.1:/export/JimboNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];
};
};
boot.kernelModules = [ "kvm-intel" ];
boot.initrd.availableKernelModules = [ "xhci_pci" "sdhci_pci" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -1 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBk6ALxn+zKrRys6/c1oYSoWJaUUEo3nAM224ElhjJQR
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl

View file

@ -0,0 +1,4 @@
{ ... }:
{
imports = [ ./jimbo ];
}

View file

@ -0,0 +1,6 @@
{ lib, ... }:
{
home-manager.users.jimbo = {
home.stateVersion = lib.mkForce "24.11";
};
}

View file

@ -1,23 +0,0 @@
{ lib, config, ... }:
{
networking = {
firewall = {
allowedUDPPorts = [ 51820 ];
trustedInterfaces = [ "wgc" ];
};
wireguard.interfaces.wgc = {
ips = [ "${config.ips.wgSpan}.18/24" ];
listenPort = 51820;
privateKey = config.secrets.wgClientPriv;
peers = [
{ # Cyberspark Server
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "sv.${config.domains.jim1}:51820";
persistentKeepalive = 25;
}
];
};
};
}

View file

@ -35,15 +35,13 @@ in {
# Use second GPU on boot
specialisation.gputwo.configuration = {
boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ];
environment.sessionVariables.WLR_RENDERER = lib.mkForce "gles2";
};
# Use Nouveau
specialisation.nouveau.configuration.config = {
environment.sessionVariables = {
NIXOS_OZONE_WL = lib.mkForce "0";
WLR_RENDERER = lib.mkForce "vulkan";
};
system.video.nvidia.enable = lib.mkForce false;
system.video.nouveau.enable = lib.mkForce true;
environment.sessionVariables.NIXOS_OZONE_WL = lib.mkForce "0";
};
}

View file

@ -9,30 +9,6 @@
theme = "agnoster";
plugins = [ "git" ];
};
shellAliases = {
# NixOS
flakedate = "doas nix flake update --flake /etc/nixos";
nhs = "doas nh os switch -R /etc/nixos";
nhu = "flakedate && nhs";
ns = "nix-shell -p";
nixclean = "doas nix-store --gc; nix-collect-garbage -d";
nixpurge = "doas nix-collect-garbage --delete-old";
nixoptimize = "doas nix store optimise";
nixscrub = "nixclean; nixpurge; nixoptimize";
# Shortcuts
ff = "clear && fastfetch";
ip = "ip -c";
ls = "${pkgs.eza}/bin/eza -a --color=always --group-directories-first --icons";
cat = "${pkgs.bat}/bin/bat --paging never";
copycat = "wl-copy <";
myip = "curl ifconfig.co";
seneca = "ssh jhampton1@matrix.senecapolytechnic.ca";
# Deny
rm = ''echo "Use trash."; false'';
};
initExtra = ''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh

View file

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
home.shellAliases = {
# NixOS
flakedate = "doas nix flake update --flake /etc/nixos";
nhs = "doas nh os switch -R /etc/nixos";
nhu = "flakedate && nhs";
ns = "nix-shell -p";
nixclean = "doas nix-store --gc; nix-collect-garbage -d";
nixpurge = "doas nix-collect-garbage --delete-old";
nixoptimize = "doas nix store optimise";
nixscrub = "nixclean; nixpurge; nixoptimize";
# Shortcuts
ff = "clear && fastfetch";
ip = "ip -c";
ls = "${pkgs.eza}/bin/eza -a --color=always --group-directories-first --icons";
cat = "${pkgs.bat}/bin/bat --paging never";
copycat = "wl-copy <";
myip = "curl ifconfig.co";
seneca = "ssh jhampton1@matrix.senecapolytechnic.ca";
# Deny
rm = ''echo "Use trash."; false'';
};
}

View file

@ -2,6 +2,7 @@
{
home.pointerCursor = {
gtk.enable = true;
x11.enable = true;
name = "Simp1e-Dark";
package = pkgs.simp1e-cursors;
size = 24;

View file

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./aliases
./cursor
./dconf
./fonts

View file

@ -9,8 +9,8 @@
LIBVIRT_DEFAULT_URI = "qemu:///system";
HISTCONTROL = "ignoreboth";
QT_QPA_PLATFORMTHEME = "gtk3";
XDG_SCREENSHOTS_DIR = "$XDG_PICTURES_DIR/Screenshots";
NIXPKGS_ALLOW_UNFREE = 1;
NIXOS_OZONE_WL = 1;
};
};
}

View file

@ -1,8 +1,10 @@
{ pkgs, ... }:
{
imports = [
./grimedit
./hyprpaper
./mako
./swappy
./swaylock
./waybar
./wlpicker
@ -10,11 +12,8 @@
home.packages = with pkgs; [
clipman
hyprpicker
libnotify
grimblast
wl-clipboard
wdisplays
jq
];
}

View file

@ -0,0 +1,34 @@
{ pkgs, config, ... }:
{
home.packages = with pkgs; [
(pkgs.writeScriptBin "grimedit" ''
# Freeze the screen using hyprpicker
${pkgs.hyprpicker}/bin/hyprpicker -r -z &
HYPRPICKER_PID=$!
sleep 0.1
# Select area
GEOM=$(${pkgs.slurp}/bin/slurp -w 3 -c ${config.look.colors.prime} -B 00000066 -b 00000099)
# Check selection is canceled
if [ -z "$GEOM" ]; then
kill $HYPRPICKER_PID 2>/dev/null
notify-send -t 3000 -a grimblast "Error" "No area selected."
exit 1
fi
# Define screenshot destination
FILE="''${XDG_PICTURES_DIR:-$HOME/Pictures}/Screenshots/$(date -Ins).png"
# Save and edit screenshot
grim -g "$GEOM" "$FILE"
swappy -f $FILE &
# Notify user that the screenshot is saved
notify-send -a grim "Screenshot" "Area saved to $FILE" -i "$FILE"
# Kill picker after selection
kill %1 2>/dev/null
'')
];
}

View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
home = {
packages = with pkgs; [ swappy ];
file.".config/swappy/config".text = ''
[Default]
early_exit=true
save_dir=$HOME/Pictures/Screenshots
'';
};
}

View file

@ -136,11 +136,10 @@
gamemodeModule = {
format = "{glyph}";
glyph = "󰖺";
hide-not-running = true;
use-icon = true;
icon-size = 19;
icon-spacing = 3;
icon-spacing = 0;
tooltip = true;
};

View file

@ -60,7 +60,7 @@
"${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a'';
# Screenshots
"${secMod}+f" = ''exec shot-sway --swappy'';
"${secMod}+f" = ''exec grimedit'';
"${secMod}+Shift+f" = ''exec shot-sway --screen'';
# Display and keyboard brightness

View file

@ -47,7 +47,7 @@
pos = "3840 405";
mode = "1920x1080@143.980Hz";
max_render_time = "3";
adaptive_sync = "on";
allow_tearing = "yes";
};
${config.displays.d2} = {
pos = "1920 405";

View file

@ -30,10 +30,6 @@
criteria = { con_mark = "giveborder"; };
command = ''border pixel ${config.look.border.string}'';
}
{
criteria = { app_id = "com.github.wwmm.easyeffects"; };
command = ''mark giveborder'';
}
{
criteria = { class = "steam"; };
command = ''mark giveborder'';
@ -50,12 +46,6 @@
criteria = { window_role = "pop-up"; };
command = ''mark giveborder'';
}
# Misc
{
criteria = { title = "^GlobalShot"; };
command = ''floating enable, fullscreen enable global'';
}
];
};
assigns = {

View file

@ -6,10 +6,7 @@
};
config = lib.mkIf config.system.wireless.enable {
networking = {
wireless.iwd.enable = true;
enableB43Firmware = true;
};
networking.wireless.iwd.enable = true;
environment = {
systemPackages = with pkgs; [ impala ];

View file

@ -7,6 +7,11 @@
xwayland.enable = lib.mkForce true;
};
environment.sessionVariables = {
WLR_RENDERER = "vulkan";
NIXOS_OZONE_WL = "1";
};
services.dbus.enable = config.system.desktop.enable;
security.pam.services.swaylock = {};
}

View file

@ -10,10 +10,6 @@
leftcontrol = "overload(ctrlmod,noop)";
esc = "`";
rightcontrol = "esc";
left = "noop";
down = "noop";
up = "noop";
right = "noop";
};
ctrlmod = {