This commit is contained in:
Mars 2024-06-13 23:47:00 -04:00
parent 122f80c49b
commit 624c5100fd
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
10 changed files with 432 additions and 800 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.direnv/ .direnv/
.luarc.json
home.nix home.nix
sys.nix sys.nix

View file

@ -31,7 +31,6 @@
nix-super = mkCustomUrl "git+https://git.privatevoid.net/max/nix-super.git"; nix-super = mkCustomUrl "git+https://git.privatevoid.net/max/nix-super.git";
nixvim = mkInput "pupbrained/nixvim"; nixvim = mkInput "pupbrained/nixvim";
schizofox = mkInput "schizofox/schizofox"; schizofox = mkInput "schizofox/schizofox";
sops-nix = mkInput "Mic92/sops-nix";
treefmt-nix = mkInput "numtide/treefmt-nix"; treefmt-nix = mkInput "numtide/treefmt-nix";
home-manager = mkFollowingNixpkgs "nix-community/home-manager"; home-manager = mkFollowingNixpkgs "nix-community/home-manager";
@ -51,6 +50,7 @@
formatter.${system} = treefmt-nix.lib.mkWrapper pkgs { formatter.${system} = treefmt-nix.lib.mkWrapper pkgs {
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
programs = { programs = {
alejandra.enable = true; alejandra.enable = true;
deadnix.enable = true; deadnix.enable = true;
@ -60,42 +60,8 @@
overlays = [ overlays = [
snowfall-flake.overlays.default snowfall-flake.overlays.default
(_final: prev: { (_final: _prev: {
nixSuper = nix-super.packages.${system}.default; nixSuper = nix-super.packages.${system}.default;
ccacheWrapper = prev.ccacheWrapper.override {
extraConfig = ''
export CCACHE_COMPRESS=1
export CCACHE_DIR="${config.programs.ccache.cacheDir}"
export CCACHE_UMASK=007
if [ ! -d "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' does not exist"
echo "Please create it with:"
echo " sudo mkdir -m0770 '$CCACHE_DIR'"
echo " sudo chown root:nixbld '$CCACHE_DIR'"
echo "====="
exit 1
fi
if [ ! -w "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)"
echo "Please verify its access permissions"
echo "====="
exit 1
fi
'';
};
picom = prev.picom.overrideAttrs {
src = prev.fetchFromGitHub {
owner = "yshui";
repo = "picom";
rev = "94faacbd4ac917cca5abac3ac5c539f5fe1dc61d";
hash = "sha256-KfMy8lV3FMS+AWDozlpPRkXX1eZCWsj39Y5T8q+c9Bs=";
fetchSubmodules = true;
};
};
}) })
]; ];
@ -131,11 +97,7 @@
git git
nvfetcher nvfetcher
statix statix
(writeScriptBin "build" '' (writeScriptBin "build" "nix fmt && nh os switch . -- --impure && nh home switch")
nix fmt
nh os switch . -- --impure
nh home switch
'')
(writeScriptBin "up" "nix flake update") (writeScriptBin "up" "nix flake update")
]; ];
}; };

File diff suppressed because it is too large Load diff

View file

@ -37,7 +37,6 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
url = "github:snowfallorg/lib/dev"; url = "github:snowfallorg/lib/dev";
}; };
sops-nix.url = "github:Mic92/sops-nix";
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
}; };
outputs = inputs: inputs.flakegen ./flake.in.nix inputs; outputs = inputs: inputs.flakegen ./flake.in.nix inputs;

View file

@ -11,10 +11,12 @@
[ [
duf duf
eternal-terminal eternal-terminal
glow
grc grc
iamb iamb
jamesdsp jamesdsp
jetbrains-toolbox jetbrains-toolbox
jdk21
killall killall
libnotify libnotify
lm_sensors lm_sensors
@ -22,10 +24,12 @@
mpv mpv
playerctl playerctl
prismlauncher prismlauncher
slack
telegram-desktop telegram-desktop
vesktop vesktop
youki youki
jetbrains.clion jetbrains.clion
jetbrains.idea-ultimate
] ]
++ (with inputs; [ ++ (with inputs; [
nixvim.packages.${pkgs.system}.default nixvim.packages.${pkgs.system}.default

View file

@ -59,12 +59,21 @@ in
]; ];
modules-right = [ modules-right = [
"mpris"
"network" "network"
"custom/notification" "custom/notification"
"tray" "tray"
"clock" "clock"
]; ];
"mpris" = {
format = "{player_icon} {title} - {artist}";
format-paused = "{status_icon} {title} - {artist}";
player-icons.default = "󰝚";
status-icons.paused = "󰏤";
max-length = 40;
};
"hyprland/workspaces" = { "hyprland/workspaces" = {
format = "{name}"; format = "{name}";
format-icons = { format-icons = {
@ -72,8 +81,8 @@ in
active = " "; active = " ";
urgent = " "; urgent = " ";
}; };
on-scroll-up = "hyprctl dispatch workspace e+1"; on-scroll-up = "hyprctl dispatch workspace e-1";
on-scroll-down = "hyprctl dispatch workspace e-1"; on-scroll-down = "hyprctl dispatch workspace e+1";
}; };
"clock" = { "clock" = {
@ -84,9 +93,11 @@ in
"hyprland/window" = { "hyprland/window" = {
max-length = 22; max-length = 22;
separate-outputs = false;
rewrite = { rewrite = {
"" = "Desktop"; "" = "Desktop";
"(.*) Firefox Nightly" = "󰈹 $1";
".*?Discord \\| @?(.*)" = " $1";
"WezTerm - (?:\\[.*] ?)?(.*)" = " $1";
}; };
}; };
@ -275,7 +286,7 @@ in
padding: 0px 30px 0px 15px; padding: 0px 30px 0px 15px;
} }
#network, #custom-notification, #tray { #mpris, #network, #custom-notification, #tray {
background: #${palette.base01}; background: #${palette.base01};
border-radius: 10px 24px 10px 24px; border-radius: 10px 24px 10px 24px;
color: #${palette.base05}; color: #${palette.base05};
@ -342,7 +353,10 @@ in
decoration.rounding = 10; decoration.rounding = 10;
dwindle.preserve_split = true; dwindle.preserve_split = true;
gestures.workspace_swipe = true; gestures.workspace_swipe = true;
input.touchpad.natural_scroll = true; input = {
sensitivity = -0.4;
touchpad.natural_scroll = true;
};
layerrule = [ layerrule = [
"dimaround, rofi" "dimaround, rofi"

View file

@ -2,8 +2,8 @@
imports = [ imports = [
./fish.nix ./fish.nix
./git.nix ./git.nix
./wezterm.nix
./macchina.nix ./macchina.nix
./wezterm.nix
./nushell ./nushell
]; ];

View file

@ -0,0 +1,136 @@
wezterm.on('user-var-changed', function(window, pane, name, value)
local overrides = window:get_config_overrides() or {}
if name == "ZEN_MODE" then
local incremental = value:find("+")
local number_value = tonumber(value)
if incremental ~= nil then
while (number_value > 0) do
window:perform_action(wezterm.action.IncreaseFontSize, pane)
number_value = number_value - 1
end
overrides.enable_tab_bar = false
elseif number_value < 0 then
window:perform_action(wezterm.action.ResetFontSize, pane)
overrides.font_size = nil
overrides.enable_tab_bar = true
else
overrides.font_size = number_value
overrides.enable_tab_bar = false
end
end
window:set_config_overrides(overrides)
end)
wezterm.on('format-window-title', function(tab, tabs)
local zoomed = ""
if tab.active_pane.is_zoomed then
zoomed = '[Z] '
end
local index = ""
if #tabs > 1 then
index = string.format('[%d/%d] ', tab.tab_index + 1, #tabs)
end
return 'WezTerm - ' .. zoomed .. index .. tab.active_pane.title
end)
local c = wezterm.config_builder()
wezterm.plugin.require('https://github.com/nekowinston/wezterm-bar').apply_to_config(c, {
position = 'bottom',
max_width = 32,
dividers = 'slant_right',
indicator = {
leader = {
enabled = true,
off = '',
on = '',
},
mode = {
enabled = true,
names = {
resize_mode = 'RESIZE',
copy_mode = 'VISUAL',
search_mode = 'SEARCH',
},
},
},
tabs = {
numerals = 'arabic',
pane_count = 'subscript',
brackets = {
active = { "", ':' },
inactive = { "", ':' },
},
},
clock = {
enabled = true,
format = '%l:%M %p',
},
})
local act = wezterm.action
local keybinds = {
{
key = 'Enter',
mods = 'CTRL|SHIFT',
action = act.SplitHorizontal({ domain = 'CurrentPaneDomain' }),
},
{
key = 'h',
mods = 'CTRL|SHIFT',
action = act.ActivatePaneDirection('Left'),
},
{
key = 'l',
mods = 'CTRL|SHIFT',
action = act.ActivatePaneDirection 'Right',
},
{
key = 'k',
mods = 'CTRL|SHIFT',
action = act.ActivatePaneDirection 'Up',
},
{
key = 'j',
mods = 'CTRL|SHIFT',
action = act.ActivatePaneDirection 'Down',
},
{
key = 't',
mods = 'CTRL|SHIFT',
action = act.SpawnCommandInNewTab { cwd = wezterm.home_dir },
}
}
local config = {
adjust_window_size_when_changing_font_size = false,
color_scheme = 'Catppuccin Mocha',
cursor_blink_ease_in = 'Constant',
cursor_blink_ease_out = 'Constant',
cursor_blink_rate = 500,
default_cursor_style = 'BlinkingBar',
enable_kitty_graphics = true,
enable_scroll_bar = false,
enable_wayland = false,
font_size = 12,
font = wezterm.font('Maple Mono NF'),
front_end = 'OpenGL',
initial_cols = 160,
keys = keybinds,
underline_position = -4,
use_fancy_tab_bar = false,
warn_about_missing_glyphs = false,
window_background_opacity = 0.8,
window_padding = { left = 0, right = 0, top = 0, bottom = 0 },
}
for k, v in pairs(config) do
c[k] = v
end
return c

View file

@ -1,115 +1,6 @@
{...}: { {...}: {
programs.wezterm = { programs.wezterm = {
enable = true; enable = true;
extraConfig = '' extraConfig = builtins.readFile ./wezterm.lua;
local wezterm = require('wezterm')
local c = wezterm.config_builder()
local resize_amount = 3;
local wezmodeConfig = {
theme = {
textColor = "white",
hintColor = "#a6e3a1",
normalModeColor = "#cba6f7",
modeTextColor = "#11111b",
}
}
wezterm.plugin.require('https://github.com/nekowinston/wezterm-bar').apply_to_config(c, {
position = 'bottom',
max_width = 32,
dividers = 'slant_right',
indicator = {
leader = {
enabled = true,
off = ' ',
on = ' ',
},
mode = {
enabled = true,
names = {
resize_mode = 'RESIZE',
copy_mode = 'VISUAL',
search_mode = 'SEARCH',
},
},
},
tabs = {
numerals = 'arabic',
pane_count = 'subscript',
brackets = {
active = { "", ':' },
inactive = { "", ':' },
},
},
clock = {
enabled = true,
format = '%l:%M %p',
},
})
local act = wezterm.action
local keybinds = {
{
key = 'Enter',
mods = 'CTRL|SHIFT',
action = act.SplitHorizontal({ domain = 'CurrentPaneDomain' }),
},
{
key = 'h',
mods = 'ALT|SHIFT',
action = act.ActivatePaneDirection('Left'),
},
{
key = 'l',
mods = 'ALT|SHIFT',
action = act.ActivatePaneDirection 'Right',
},
{
key = 'k',
mods = 'ALT|SHIFT',
action = act.ActivatePaneDirection 'Up',
},
{
key = 'j',
mods = 'ALT|SHIFT',
action = act.ActivatePaneDirection 'Down',
},
{
key = 't',
mods = 'CTRL|SHIFT',
action = act.SpawnCommandInNewTab { cwd = wezterm.home_dir },
}
}
local config = {
initial_cols = 160,
adjust_window_size_when_changing_font_size = false,
color_scheme = 'Catppuccin Mocha',
cursor_blink_ease_in = 'Constant',
cursor_blink_ease_out = 'Constant',
cursor_blink_rate = 500,
default_cursor_style = 'BlinkingBar',
enable_kitty_graphics = true,
enable_scroll_bar = false,
enable_wayland = false,
font_size = 12,
font = wezterm.font('Maple Mono NF'),
keys = keybinds,
front_end = 'OpenGL',
underline_position = -4,
use_fancy_tab_bar = false,
window_background_opacity = 0.8,
window_padding = { left = 0, right = 0, top = 0, bottom = 0 },
}
for k, v in pairs(config) do
c[k] = v
end
return c
'';
}; };
} }

View file

@ -6,35 +6,39 @@
... ...
}: }:
with lib // pkgs // inputs; { with lib // pkgs // inputs; {
imports = [ imports = [./hardware.nix];
./hardware.nix
];
security = { security = {
rtkit.enable = true; rtkit.enable = true;
pam.loginLimits = [ pam = {
{ services.greetd.enableGnomeKeyring = true;
domain = "*";
item = "nofile";
type = "-";
value = "32768";
}
{
domain = "*";
item = "memlock";
type = "-";
value = "32768";
}
];
sudo.extraConfig = '' loginLimits = [
Defaults lecture = never, pwfeedback {
''; domain = "*";
item = "nofile";
type = "-";
value = "32768";
}
{
domain = "*";
item = "memlock";
type = "-";
value = "32768";
}
];
};
sudo.wheelNeedsPassword = false;
}; };
console.catppuccin.enable = true; console.catppuccin.enable = true;
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 marshall qemu-libvirtd -"
];
systemd.user.extraConfig = let systemd.user.extraConfig = let
path = lib.concatStringsSep ":" [ path = lib.concatStringsSep ":" [
"/run/wrappers/bin" "/run/wrappers/bin"
@ -68,9 +72,14 @@ with lib // pkgs // inputs; {
libvirtd = { libvirtd = {
enable = true; enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemu = { qemu = {
package = qemu_kvm; package = qemu_kvm;
swtpm.enable = true; swtpm.enable = true;
runAsRoot = false;
ovmf.enable = true; ovmf.enable = true;
ovmf.packages = [OVMFFull.fd]; ovmf.packages = [OVMFFull.fd];
}; };
@ -86,17 +95,20 @@ with lib // pkgs // inputs; {
environment = { environment = {
sessionVariables = { sessionVariables = {
BROWSER = "firefox-nightly"; BROWSER = "firefox-nightly";
EDITOR = "nvim";
TERMINAL = "wezterm";
DIRENV_WARN_TIMEOUT = "100s"; DIRENV_WARN_TIMEOUT = "100s";
EDITOR = "nvim";
NIXOS_OZONE_WL = "1";
TERMINAL = "wezterm";
}; };
systemPackages = [ systemPackages = [
agenix.packages.${system}.default agenix.packages.${system}.default
gnome.nautilus gnome.nautilus
internal.lightly-boehs-qt6 internal.lightly-boehs-qt6
looking-glass-client
snowfallorg.flake snowfallorg.flake
sound-theme-freedesktop sound-theme-freedesktop
virtio-win
winetricks winetricks
wineWowPackages.staging wineWowPackages.staging
xclip xclip
@ -106,12 +118,13 @@ with lib // pkgs // inputs; {
persistence."/persist" = { persistence."/persist" = {
hideMounts = true; hideMounts = true;
directories = [ directories = [
"/etc/mullvad-vpn"
"/etc/NetworkManager" "/etc/NetworkManager"
"/etc/secrets" "/etc/secrets"
"/etc/ssh" "/etc/ssh"
"/etc/mullvad-vpn"
"/root/.ssh" "/root/.ssh"
"/var/lib/bluetooth" "/var/lib/bluetooth"
"/var/lib/libvirt"
"/var/lib/nixos" "/var/lib/nixos"
"/var/lib/systemd/coredump" "/var/lib/systemd/coredump"
]; ];
@ -205,8 +218,6 @@ with lib // pkgs // inputs; {
min-free = "${toString (5 * 1024 * 1024 * 1024)}"; min-free = "${toString (5 * 1024 * 1024 * 1024)}";
max-free = "${toString (10 * 1024 * 1024 * 1024)}"; max-free = "${toString (10 * 1024 * 1024 * 1024)}";
extra-sandbox-paths = [config.programs.ccache.cacheDir];
extra-experimental-features = [ extra-experimental-features = [
"flakes" # flakes "flakes" # flakes
"nix-command" # experimental nix commands "nix-command" # experimental nix commands
@ -238,7 +249,6 @@ with lib // pkgs // inputs; {
}; };
programs = { programs = {
ccache.enable = true;
dconf.enable = true; dconf.enable = true;
fish.enable = true; fish.enable = true;
gamemode.enable = true; gamemode.enable = true;
@ -253,8 +263,6 @@ with lib // pkgs // inputs; {
nh = { nh = {
enable = true; enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/marshall/nix-config"; flake = "/home/marshall/nix-config";
}; };
}; };
@ -316,7 +324,7 @@ with lib // pkgs // inputs; {
users.marshall = { users.marshall = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel" "gamemode" "libvirtd" "networkmanager"]; extraGroups = ["wheel" "gamemode" "libvirtd" "qemu-libvirtd" "disk" "networkmanager"];
shell = fish; shell = fish;
hashedPasswordFile = config.age.secrets.passwd.path; hashedPasswordFile = config.age.secrets.passwd.path;
}; };
@ -352,5 +360,7 @@ with lib // pkgs // inputs; {
}; };
}; };
xdg.portal.enable = true;
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }