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/
.luarc.json
home.nix
sys.nix

View file

@ -31,7 +31,6 @@
nix-super = mkCustomUrl "git+https://git.privatevoid.net/max/nix-super.git";
nixvim = mkInput "pupbrained/nixvim";
schizofox = mkInput "schizofox/schizofox";
sops-nix = mkInput "Mic92/sops-nix";
treefmt-nix = mkInput "numtide/treefmt-nix";
home-manager = mkFollowingNixpkgs "nix-community/home-manager";
@ -51,6 +50,7 @@
formatter.${system} = treefmt-nix.lib.mkWrapper pkgs {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
deadnix.enable = true;
@ -60,42 +60,8 @@
overlays = [
snowfall-flake.overlays.default
(_final: prev: {
(_final: _prev: {
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
nvfetcher
statix
(writeScriptBin "build" ''
nix fmt
nh os switch . -- --impure
nh home switch
'')
(writeScriptBin "build" "nix fmt && nh os switch . -- --impure && nh home switch")
(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";
url = "github:snowfallorg/lib/dev";
};
sops-nix.url = "github:Mic92/sops-nix";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs = inputs: inputs.flakegen ./flake.in.nix inputs;

View file

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

View file

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

View file

@ -2,8 +2,8 @@
imports = [
./fish.nix
./git.nix
./wezterm.nix
./macchina.nix
./wezterm.nix
./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 = {
enable = true;
extraConfig = ''
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
'';
extraConfig = builtins.readFile ./wezterm.lua;
};
}

View file

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