1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 19:47:47 +00:00

Refactor the whole codebase. Most notable changes:

- No more fail2ban. It didn't work properly
  anyways, I'll need to look into this in the future
- No nix-super. I don't need it and the overlay is
  broken so I'm waiting for that to be fixed first.
- Uses nh instead of nixos-rebuild. This is much
  better.
This commit is contained in:
RGBCube 2024-03-27 12:36:50 +03:00
parent f145bdaa4a
commit 62c575774b
No known key found for this signature in database
106 changed files with 1252 additions and 1367 deletions

View file

@ -1,5 +1,5 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
desktopSystemConfiguration {
services.auto-cpufreq = enabled {};
services.auto-cpufreq = enabled;
}

View file

@ -1,17 +1,19 @@
{ ulib, pkgs, theme, ... }: with ulib;
{ config, lib, pkgs, ... }: with lib; merge
homeConfiguration {
programs.nushell.environmentVariables = {
MANPAGER = ''"bat --plain --language man"'';
PAGER = ''"bat --plain"'';
(systemConfiguration {
environment.variables = {
MANPAGER = "bat --plain --language man";
PAGER = "bat --plain";
};
programs.nushell.shellAliases.cat = "bat";
environment.shellAliases.cat = "bat";
})
(homeConfiguration {
programs.bat = enabled {
config.theme = "base16";
themes.base16.src = pkgs.writeText "base16.tmTheme" theme.tmTheme;
config.theme = "base16";
themes.base16.src = pkgs.writeText "base16.tmTheme" config.theme.tmTheme;
config.pager = "less -FR";
};
}
})

View file

@ -1,7 +1,7 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
desktopSystemConfiguration {
services.blueman = enabled {};
services.blueman = enabled;
hardware.bluetooth = enabled {
powerOnBoot = true;

View file

@ -1,11 +1,11 @@
{ ulib, theme, ... }: with ulib;
{ config, lib, ... }: with lib;
homeConfiguration {
xdg.configFile."btop/themes/base16.theme".text = theme.btopTheme;
xdg.configFile."btop/themes/base16.theme".text = config.theme.btopTheme;
programs.btop = enabled {
settings.color_theme = "base16";
settings.rounded_corners = theme.cornerRadius != 0;
settings.rounded_corners = config.theme.cornerRadius > 0;
};
}

View file

@ -1,15 +1,15 @@
{ ulib, pkgs, theme, ... }: with ulib; merge3
{ config, lib, pkgs, ... }: with lib; merge
(desktopSystemConfiguration {
nixpkgs.config.allowUnfree = true;
})
(desktopHomeConfiguration {
xdg.configFile."Vencord/settings/quickCss.css".text = theme.discordCss;
(desktopUserHomeConfiguration {
xdg.configFile."Vencord/settings/quickCss.css".text = config.theme.discordCss;
})
(desktopHomePackages (with pkgs; [
(discord-canary.override {
(desktopUserHomePackages (with pkgs; [
(discord.override {
withOpenASAR = true;
withVencord = true;
})

View file

@ -1,9 +1,9 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
systemConfiguration {
documentation = {
doc.enable = false;
info.enable = false;
doc = disabled;
info = disabled;
man = enabled {
generateCaches = true;

View file

@ -1,7 +1,7 @@
{ ulib, theme, ... }: with ulib;
{ config, lib, ... }: with lib;
desktopHomeConfiguration {
services.dunst = with theme.withHashtag; enabled {
desktopUserHomeConfiguration {
services.dunst = with config.theme.withHashtag; enabled {
iconTheme = icons;
settings.global = {

View file

@ -1,13 +1,16 @@
{ config, ulib, pkgs, ... }: with ulib;
{ lib, pkgs, ... }: with lib;
serverSystemConfiguration {
let
fakeSSHPort = 22;
prometheusPort = 9050;
in serverSystemConfiguration {
services.prometheus.scrapeConfigs = [{
job_name = "endlessh-go";
static_configs = [{
labels.job = "endlessh-go";
targets = [
"[::]:${toString config.services.endlessh-go.prometheus.port}"
"[::1]:${toString prometheusPort}"
];
}];
}];
@ -17,10 +20,11 @@ serverSystemConfiguration {
# services.endlessh-go.openFirewall exposes both the Prometheus
# exporters port and the SSH port, and we don't want the metrics
# to leak, so we manually expose this like so.
networking.firewall.allowedTCPPorts = [ config.services.endlessh-go.port ];
networking.firewall.allowedTCPPorts = [ fakeSSHPort ];
services.endlessh-go = enabled {
port = 22;
listenAddress = "[::]";
port = fakeSSHPort;
extraOptions = [
"-alsologtostderr"
@ -29,8 +33,8 @@ serverSystemConfiguration {
];
prometheus = enabled {
listenAddress = "[::]";
port = 9050;
listenAddress = "[::1]";
port = prometheusPort;
};
};
}

View file

@ -1,10 +0,0 @@
{ ulib, ... }: with ulib;
serverSystemConfiguration {
services.fail2ban = enabled {
bantime = "24h";
bantime-increment = enabled {
maxtime = "7d";
};
};
}

View file

@ -1,8 +1,8 @@
{ ulib, theme, ... }: with ulib;
{ config, lib, ... }: with lib;
desktopHomeConfiguration {
desktopUserHomeConfiguration {
programs.firefox = enabled {
profiles.default.settings = with theme.font; {
profiles.default.settings = with config.theme.font; {
"general.autoScroll" = true;
"privacy.donottrackheader.enabled" = true;

View file

@ -1,6 +1,6 @@
{ ulib, pkgs, theme, ... }: with ulib; merge
{ config, lib, pkgs, ... }: with lib; merge
(systemConfiguration {
(desktopSystemConfiguration {
console = {
earlySetup = true;
font = "Lat2-Terminus16";
@ -8,12 +8,16 @@
};
})
(desktopSystemFonts (with pkgs; [
theme.font.sans.package
theme.font.mono.package
(desktopSystemFonts [
config.theme.font.sans.package
config.theme.font.mono.package
noto-fonts
noto-fonts-cjk-sans
noto-fonts-lgc-plus
noto-fonts-emoji
]))
pkgs.noto-fonts
pkgs.noto-fonts-cjk-sans
pkgs.noto-fonts-lgc-plus
pkgs.noto-fonts-emoji
])
(serverSystemConfiguration {
fonts.fontconfig = disabled;
})

View file

@ -1,7 +1,7 @@
{ ulib, theme, ... }: with ulib;
{ config, lib, ... }: with lib;
desktopHomeConfiguration {
programs.fuzzel = with theme; enabled {
desktopUserHomeConfiguration {
programs.fuzzel = with config.theme; enabled {
settings.main = {
dpi-aware = false;
font = "${font.sans.name}:size=${toString font.size.big}";
@ -19,13 +19,13 @@ desktopHomeConfiguration {
inner-pad = padding;
};
settings.colors = {
background = base00 + "FF";
text = base05 + "FF";
match = base0A + "FF";
selection = base05 + "FF";
selection-text = base00 + "FF";
border = base0A + "FF";
settings.colors = mapAttrs (_: color: color + "FF") {
background = base00;
text = base05;
match = base0A;
selection = base05;
selection-text = base00;
border = base0A;
};
settings.border = {

View file

@ -1,18 +1,14 @@
{ inputs, lib, ulib, pkgs, upkgs, theme, ... }: with ulib; merge
{ config, lib, pkgs, ... }: with lib;
(desktopSystemConfiguration {
home-manager.sharedModules = [ inputs.ghosttyModule.homeModules.default ];
})
(desktopHomeConfiguration {
desktopUserHomeConfiguration {
programs.nushell.environmentVariables.TERMINAL = "ghostty";
programs.ghostty = enabled {
package = upkgs.ghostty;
package = pkgs.ghostty;
clearDefaultKeybindings = true;
keybindings = (lib.mapAttrs' (name: lib.nameValuePair "ctrl+shift+${name}") {
keybindings = (mapAttrs' (name: nameValuePair "ctrl+shift+${name}") {
c = "copy_to_clipboard";
v = "paste_from_clipboard";
@ -50,14 +46,15 @@
"physical:eight" = "goto_tab:8";
"physical:nine" = "goto_tab:9";
"physical:zero" = "goto_tab:10";
}) // (lib.mapAttrs' (name: lib.nameValuePair "ctrl+${name}") {
"physical:tab" = "next_tab";
}) // (mapAttrs' (name: nameValuePair "ctrl+${name}") {
"physical:tab" = "next_tab";
"shift+physical:tab" = "previous_tab";
});
shellIntegration.enable = false;
# Disabled here as Nushell isn't supported and Nushell enables it in its own config.
shellIntegration = disabled;
settings = with theme; {
settings = with config.theme; {
font-size = font.size.normal;
font-family = font.mono.name;
@ -73,4 +70,4 @@
];
};
};
})
}

View file

@ -1,7 +1,7 @@
{ lib, ulib, pkgs, ... }: with ulib; merge3
{ lib, pkgs, ... }: with lib; merge
(homeConfiguration {
programs.nushell.shellAliases = {
(systemConfiguration {
environment.shellAliases = {
g = "git";
ga = "git add";
@ -62,8 +62,10 @@
gst = "git status";
};
})
programs.nushell.configFile.text = lib.mkAfter ''
(homeConfiguration {
programs.nushell.configFile.text = mkAfter ''
# Sets the remote origin to the specified user and repository on my git instance
def gsr [user_and_repo: string] {
let user_and_repo = if ($user_and_repo | str index-of "/") != -1 {
@ -82,13 +84,13 @@
userName = "RGBCube";
userEmail = "git@rgbcu.be";
lfs = enabled {};
lfs = enabled;
difftastic = enabled {
background = "dark";
};
extraConfig = lib.recursiveUpdate {
extraConfig = merge {
init.defaultBranch = "master";
commit.verbose = true;
@ -122,7 +124,7 @@
core.sshCommand = "ssh -i ~/.ssh/id";
url."ssh://git@github.com/".insteadOf = "https://github.com/";
url."ssh://forgejo@rgbcu.be:2222/".insteadOf = "https://git.rgbcu.be/";
} (lib.optionalAttrs ulib.isDesktop {
} (mkIf isDesktop {
commit.gpgSign = true;
tag.gpgSign = true;
gpg.format = "ssh";
@ -131,13 +133,15 @@
};
})
(desktopHomeConfiguration {
programs.nushell.shellAliases = {
(desktopSystemConfiguration {
environment.shellAliases = {
"??" = "gh copilot suggest --target shell";
"gh?" = "gh copilot suggest --target gh";
"git?" = "gh copilot suggest --target git";
};
})
(desktopHomeConfiguration {
programs.gh = enabled {
settings.git_protocol = "ssh";
};

View file

@ -1,21 +1,21 @@
{ ulib, pkgs, theme, ... }: with ulib; merge
{ config, lib, pkgs, ... }: with lib; merge
(desktopSystemConfiguration {
programs.dconf = enabled {};
programs.dconf = enabled;
})
(desktopHomeConfiguration {
(desktopUserHomeConfiguration {
gtk = enabled {
gtk3.extraCss = theme.adwaitaGtkCss;
gtk4.extraCss = theme.adwaitaGtkCss;
gtk3.extraCss = config.theme.adwaitaGtkCss;
gtk4.extraCss = config.theme.adwaitaGtkCss;
font = with theme.font; {
font = with config.theme.font; {
inherit (sans) name package;
size = size.normal;
};
iconTheme = theme.icons;
iconTheme = config.theme.icons;
theme = {
name = "Adwaita-dark";
@ -24,3 +24,4 @@
};
})

View file

@ -1,24 +1,26 @@
{ ulib, lib, pkgs, upkgs, theme, ... }: with ulib; merge
{ config, lib, pkgs, ... }: with lib; merge
(systemConfiguration {
environment = {
variables.EDITOR = "hx";
shellAliases.x = "hx";
};
})
(homeConfiguration {
programs.nushell = {
environmentVariables.EDITOR = "hx";
shellAliases.x = "hx";
configFile.text = lib.mkAfter ''
def --wrapped hx [...arguments] {
if $env.TERM == "xterm-kitty" {
kitty @ set-spacing padding=0
}
^hx ...$arguments
if $env.TERM == "xterm-kitty" {
kitty @ set-spacing padding=${toString theme.padding}
}
programs.nushell.configFile.text = mkAfter ''
def --wrapped hx [...arguments] {
if $env.TERM == "xterm-kitty" {
kitty @ set-spacing padding=0
}
'';
};
^hx ...$arguments
if $env.TERM == "xterm-kitty" {
kitty @ set-spacing padding=${toString config.theme.padding}
}
}
'';
programs.helix = enabled {
languages.language = let
@ -96,11 +98,6 @@
formatter = denoFormatter "tsx";
language-servers = [ "deno" ];
}
{ # TODO: Remove in the next Helix release.
name = "nu";
language-servers = [ "nu" ];
}
];
languages.language-server = {
@ -145,7 +142,7 @@
cursorline = true;
bufferline = "multiple";
file-picker.hidden = false;
idle-timeout = 50;
idle-timeout = 0;
line-number = "relative";
shell = [ "bash" "-c" ];
text-width = 100;
@ -167,7 +164,7 @@
render.tab = "all";
};
settings.keys = lib.genAttrs [ "normal" "select" ] (_: {
settings.keys = genAttrs [ "normal" "select" ] (_: {
D = "extend_to_line_end";
});
};
@ -213,5 +210,5 @@
yaml-language-server
# ZIG
upkgs.zls
zls
]))

View file

@ -1,7 +1,7 @@
{ ulib, pkgs, upkgs, theme, ... }: with ulib; merge3
{ config, lib, pkgs, ... }: with lib; merge
(desktopSystemConfiguration {
hardware.opengl = enabled {};
hardware.opengl = enabled;
xdg.portal = enabled {
config.common.default = "*";
@ -12,220 +12,205 @@
};
})
(desktopHomeConfiguration {
wayland.windowManager.hyprland = with theme; enabled {
package = upkgs.hyprland;
(desktopUserHomeConfiguration {
wayland.windowManager.hyprland = enabled {
settings = {
monitor = [ ",preferred,auto,1" ];
windowrule = [ "noinitialfocus" ];
extraConfig =
''
monitor = , preferred, auto, 1
''
+
''
windowrule = noinitialfocus
''
+
''
exec-once = wl-paste --type text --watch cliphist store -max-items 1000
exec-once = wl-paste --type image --watch cliphist store -max-items 1000
exec-once = [
"wl-paste --type text --watch cliphist store -max-items 1000"
"wl-paste --type image --watch cliphist store -max-items 1000"
];
exec = pkill swaybg; swaybg --image ${./wallpaper.png}
exec = [
"pkill swaybg; swaybg --image ${./wallpaper.png}"
"pkill --signal SIGUSR2 waybar"
];
exec = pkill --signal SIGUSR2 waybar
''
+
''
binde = SUPER, left , movefocus, l
binde = SUPER, down , movefocus, d
binde = SUPER, up , movefocus, u
binde = SUPER, right, movefocus, r
bindl = [
(replaceStrings [ "\n;" "\n" ] [ ";" "" ] ''
,XF86PowerOff,exec,
pkill fuzzel;
echo -en "Suspend\0icon\x1fsystem-suspend\nHibernate\0icon\x1fsystem-suspend-hibernate-alt2\nPower Off\0icon\x1fsystem-shutdown\nReboot\0icon\x1fsystem-reboot"
| fuzzel --dmenu
| tr --delete " "
| tr '[:upper:]' '[:lower:]'
| ifne xargs systemctl
'')
];
binde = SUPER, h, movefocus, l
binde = SUPER, j, movefocus, d
binde = SUPER, k, movefocus, u
binde = SUPER, l, movefocus, r
''
+
''
bind = SUPER , TAB, workspace, e+1
bind = SUPER+ALT, TAB, workspace, e-1
bindle = [
",XF86AudioRaiseVolume , exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.5"
",XF86AudioLowerVolume , exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
bind = SUPER, mouse_up, workspace, e+1
bind = SUPER, mouse_down, workspace, e-1
",XF86AudioMute , exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioMicMute , exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
bind = SUPER, 1, workspace, 1
bind = SUPER, 2, workspace, 2
bind = SUPER, 3, workspace, 3
bind = SUPER, 4, workspace, 4
bind = SUPER, 5, workspace, 5
",XF86MonBrightnessUp , exec, brightnessctl set 5%+"
",XF86MonBrightnessDown, exec, brightnessctl set --min-value=0 5%-"
];
bind = SUPER+ALT, 1, movetoworkspacesilent, 1
bind = SUPER+ALT, 2, movetoworkspacesilent, 2
bind = SUPER+ALT, 3, movetoworkspacesilent, 3
bind = SUPER+ALT, 4, movetoworkspacesilent, 4
bind = SUPER+ALT, 5, movetoworkspacesilent, 5
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:274, movewindow"
"SUPER, mouse:273, resizewindow"
];
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:274, movewindow
''
+
''
binde = SUPER+CTRL, left , resizeactive, -100 0
binde = SUPER+CTRL, down , resizeactive, 0 100
binde = SUPER+CTRL, up , resizeactive, 0 -100
binde = SUPER+CTRL, right, resizeactive, 100 0
binde = [
"SUPER, left , movefocus, l"
"SUPER, down , movefocus, d"
"SUPER, up , movefocus, u"
"SUPER, right, movefocus, r"
binde = SUPER+CTRL, h, resizeactive, -100 0
binde = SUPER+CTRL, j, resizeactive, 0 100
binde = SUPER+CTRL, k, resizeactive, 0 -100
binde = SUPER+CTRL, l, resizeactive, 100 0
"SUPER, h, movefocus, l"
"SUPER, j, movefocus, d"
"SUPER, k, movefocus, u"
"SUPER, l, movefocus, r"
bindm = SUPER, mouse:273, resizewindow
''
+
''
bind = SUPER+ALT, left , movewindow, l
bind = SUPER+ALT, down , movewindow, d
bind = SUPER+ALT, up , movewindow, u
bind = SUPER+ALT, right, movewindow, r
"SUPER+CTRL, left , resizeactive, -100 0"
"SUPER+CTRL, down , resizeactive, 0 100"
"SUPER+CTRL, up , resizeactive, 0 -100"
"SUPER+CTRL, right, resizeactive, 100 0"
bind = SUPER+ALT, h, movewindow, l
bind = SUPER+ALT, j, movewindow, d
bind = SUPER+ALT, k, movewindow, u
bind = SUPER+ALT, l, movewindow, r
''
+
''
bind = SUPER , Q, killactive
bind = SUPER , F, fullscreen
bind = SUPER+ALT, F, togglefloating
"SUPER+CTRL, h, resizeactive, -100 0"
"SUPER+CTRL, j, resizeactive, 0 100"
"SUPER+CTRL, k, resizeactive, 0 -100"
"SUPER+CTRL, l, resizeactive, 100 0"
];
bind = SUPER+ALT, RETURN, exec, kitty
bind = SUPER , RETURN, exec, ghostty --gtk-single-instance=true
bind = SUPER , W , exec, firefox
bind = SUPER , D , exec, discordcanary
bind = SUPER , E , exec, fractal
bind = SUPER , M , exec, thunderbird
bind = SUPER , T , exec, thunar
bind = SUPER , C , exec, hyprpicker --autocopy
bind = [
"SUPER , TAB, workspace, e+1"
"SUPER+ALT, TAB, workspace, e-1"
bind = SUPER, B, exec, pkill --signal SIGUSR1 waybar
"SUPER, mouse_up, workspace, e+1"
"SUPER, mouse_down, workspace, e-1"
bind = SUPER, SPACE, exec, pkill fuzzel; fuzzel
bind = SUPER, V , exec, pkill fuzzel; cliphist list | fuzzel --dmenu | cliphist decode | wl-copy
"SUPER, 1, workspace, 1"
"SUPER, 2, workspace, 2"
"SUPER, 3, workspace, 3"
"SUPER, 4, workspace, 4"
"SUPER, 5, workspace, 5"
bind = , PRINT, exec, pkill grim; grim -g "$(slurp -w 0)" - | swappy -f - -o - | wl-copy --type image/png
bind = ALT, PRINT, exec, pkill grim; grim - | swappy -f - -o - | wl-copy --type image/png
''
+
''
bindle = , XF86AudioRaiseVolume, exec, wpctl set-volume --limit 1.5 @DEFAULT_AUDIO_SINK@ 5%+
bindle = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
"SUPER+ALT, 1, movetoworkspacesilent, 1"
"SUPER+ALT, 2, movetoworkspacesilent, 2"
"SUPER+ALT, 3, movetoworkspacesilent, 3"
"SUPER+ALT, 4, movetoworkspacesilent, 4"
"SUPER+ALT, 5, movetoworkspacesilent, 5"
bindle = , XF86AudioMute , exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindle = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
"SUPER+ALT, left , movewindow, l"
"SUPER+ALT, down , movewindow, d"
"SUPER+ALT, up , movewindow, u"
"SUPER+ALT, right, movewindow, r"
bindle = , XF86MonBrightnessUp , exec, brightnessctl set 5%+
bindle = , XF86MonBrightnessDown, exec, brightnessctl set --min-value=0 5%-
"SUPER+ALT, h, movewindow, l"
"SUPER+ALT, j, movewindow, d"
"SUPER+ALT, k, movewindow, u"
"SUPER+ALT, l, movewindow, r"
"SUPER , Q, killactive"
"SUPER , F, fullscreen"
"SUPER+ALT, F, togglefloating"
bindl = , XF86PowerOff, exec, pkill fuzzel; echo -en "Suspend\0icon\x1fsystem-suspend\nHibernate\0icon\x1fsystem-suspend-hibernate-alt2\nPower Off\0icon\x1fsystem-shutdown\nReboot\0icon\x1fsystem-reboot" | fuzzel --dmenu | tr --delete " " | tr "[:upper:]" "[:lower:]" | ifne xargs systemctl
''
+
''
animations {
bezier = material_decelerate, 0.05, 0.7, 0.1, 1
"SUPER+ALT, RETURN, exec, kitty"
"SUPER , RETURN, exec, ghostty --gtk-single-instance=true"
"SUPER , W , exec, firefox"
"SUPER , D , exec, discord"
"SUPER , E , exec, fractal"
"SUPER , M , exec, thunderbird"
"SUPER , T , exec, thunar"
"SUPER , C , exec, hyprpicker --autocopy"
animation = windows, 1, 2 , material_decelerate, popin 80%
animation = border , 1, 10, default
animation = fade , 1, 2 , default
animation = workspaces,1, 3 , material_decelerate
}
''
+
''
decoration {
drop_shadow = false
rounding = ${toString cornerRadius}
"SUPER, B, exec, pkill --signal SIGUSR1 waybar"
"SUPER, SPACE, exec, pkill fuzzel; fuzzel"
"SUPER, V , exec, pkill fuzzel; cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"
blur {
enabled = false
}
}
''
+
''
general {
gaps_in = ${toString (margin/ 2)}
gaps_out = ${toString margin}
border_size = ${toString borderWidth}
" , PRINT, exec, pkill grim; grim -g \"$(slurp -w 0)\" - | swappy -f - -o - | wl-copy --type image/png"
"ALT, PRINT, exec, pkill grim; grim - | swappy -f - -o - | wl-copy --type image/png"
];
col.active_border = 0xFF${base0A}
col.nogroup_border_active = 0xFF${base0A}
general = with config.theme; {
gaps_in = margin / 2;
gaps_out = margin;
border_size = borderWidth;
col.inactive_border = 0xFF${base01}
col.nogroup_border = 0xFF${base01}
"col.active_border" = "0xFF${base0A}";
"col.nogroup_border_active" = "0xFF${base0A}";
cursor_inactive_timeout = 10
no_cursor_warps = true
"col.inactive_border" = "0xFF${base01}";
"col.nogroup_border" = "0xFF${base01}";
resize_on_border = true
}
''
+
''
gestures {
workspace_swipe = true
}
''
+
''
input {
follow_mouse = 1
cursor_inactive_timeout = 10;
no_cursor_warps = true;
kb_layout = tr
resize_on_border = true;
};
repeat_delay = 400
repeat_rate = 100
decoration = {
drop_shadow = false;
rounding = config.theme.cornerRadius;
touchpad {
clickfinger_behavior = true
drag_lock = true
blur.enabled = false;
};
natural_scroll = true
scroll_factor = 0.7
}
}
''
+
''
dwindle {
preserve_split = true
smart_resizing = false
}
''
+
''
misc {
animate_manual_resizes = true
input = {
follow_mouse = 1;
disable_hyprland_logo = true
disable_splash_rendering = true
kb_layout = "tr";
key_press_enables_dpms = true
mouse_move_enables_dpms = true
}
'';
repeat_delay = 400;
repeat_rate = 100;
touchpad = {
clickfinger_behavior = true;
drag_lock = true;
natural_scroll = true;
scroll_factor = 0.7;
};
};
gestures.workspace_swipe = true;
animations = {
bezier = [ "material_decelerate,0.05,0.7,0.1,1" ];
animation = [
"border , 1, 10, material_decelerate"
"fade , 1, 2 , material_decelerate"
"layers , 1, 2 , material_decelerate"
"windows , 1, 2 , material_decelerate, popin 80%"
"workspaces, 1, 3 , material_decelerate"
];
};
misc = {
animate_manual_resizes = true;
disable_hyprland_logo = true;
disable_splash_rendering = true;
hide_cursor_on_key_press = true;
key_press_enables_dpms = true;
mouse_move_enables_dpms = true;
};
dwindle = {
preserve_split = true;
smart_resizing = false;
};
};
};
})
(desktopHomePackages (with pkgs; [
(desktopUserHomePackages (with pkgs; [
brightnessctl
cliphist
grim
hyprpicker
slurp
swappy
swaybg
upkgs.hyprpicker
wl-clipboard
xdg-utils
xwaylandvideobridge

View file

@ -1,4 +1,4 @@
{ ulib, pkgs, ... }: with ulib;
{ lib, pkgs, ... }: with lib;
systemConfiguration {
boot.kernelPackages = pkgs.linuxPackages_latest;

View file

@ -1,9 +1,9 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
desktopSystemConfiguration {
programs.seahorse = enabled {};
programs.seahorse = enabled;
security.pam.services.login.enableGnomeKeyring = true;
services.gnome.gnome-keyring = enabled {};
services.gnome.gnome-keyring = enabled;
}

View file

@ -1,7 +1,7 @@
{ ulib, theme, ... }: with ulib;
{ config, lib, ... }: with lib;
desktopHomeConfiguration {
programs.kitty = with theme.withHashtag; enabled {
desktopUserHomeConfiguration {
programs.kitty = with config.theme.withHashtag; enabled {
font = with font; {
inherit (mono) name package;

7
modules/kresd.nix Normal file
View file

@ -0,0 +1,7 @@
{ lib, ... }: with lib;
systemConfiguration {
services.kresd = enabled;
networking.nameservers = [ "::1" "127.0.0.1" ];
}

View file

@ -1,4 +1,4 @@
{ ulib, ... }: with ulib; merge
{ lib, ... }: with lib; merge
(systemConfiguration {
console.keyMap = "trq";
@ -7,17 +7,15 @@
})
(desktopSystemConfiguration {
i18n.extraLocaleSettings = let
locale = "tr_TR.UTF-8";
in {
LC_ADDRESS = locale;
LC_IDENTIFICATION = locale;
LC_MEASUREMENT = locale;
LC_MONETARY = locale;
LC_NAME = locale;
LC_NUMERIC = locale;
LC_PAPER = locale;
LC_TELEPHONE = locale;
LC_TIME = locale;
};
i18n.extraLocaleSettings = genAttrs [
"LC_ADDRESS"
"LC_IDENTIFICATION"
"LC_MEASUREMENT"
"LC_MONETARY"
"LC_NAME"
"LC_NUMERIC"
"LC_PAPER"
"LC_TELEPHONE"
"LC_TIME"
] (_: "tr_TR.UTF-8");
})

View file

@ -1,4 +1,4 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
desktopSystemConfiguration {
services.logind.powerKey = "ignore";

View file

@ -1,7 +1,7 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
systemConfiguration {
environment.defaultPackages = [];
programs.nano.enable = false; # Garbage.
programs.nano = disabled; # Garbage.
}

View file

@ -0,0 +1,9 @@
{ lib, ... }: with lib;
systemConfiguration {
networking.networkmanager = enabled;
users.extraGroups.networkmanager.members = allNormalUsers;
environment.shellAliases.wifi = "nmcli dev wifi show-password";
}

View file

@ -1,11 +0,0 @@
{ ulib, ... }: with ulib; merge
(systemConfiguration {
networking.networkmanager = enabled {};
users.extraGroups.networkmanager.members = ulib.users.all;
})
(homeConfiguration {
programs.nushell.shellAliases.wifi = "nmcli dev wifi show-password";
})

View file

@ -1,19 +1,7 @@
{ inputs, lib, ulib, upkgs, ... }: with ulib; merge
(homeConfiguration {
programs.nushell = {
shellAliases.ns = "nix shell";
configFile.text = lib.mkAfter ''
def --wrapped nr [program: string = "", ...arguments] {
nix run $program -- ...$arguments
}
'';
};
})
{ inputs, lib, pkgs, ... }: with lib; merge
(systemConfiguration {
environment.etc."flakes".text = builtins.toJSON inputs;
environment.etc."flakes.json".text = strings.toJSON inputs;
nix = {
gc = {
@ -27,11 +15,9 @@
optimise.automatic = true;
package = upkgs.nixSuper;
registry = {
default.flake = inputs.nixpkgs;
} // builtins.mapAttrs (_: value: lib.mkIf (lib.isType "flake" value) {
} // mapAttrs (_: value: mkIf (isType "flake" value) {
flake = value;
}) inputs;
@ -39,25 +25,51 @@
"auto-allocate-uids"
"ca-derivations"
"cgroups"
"configurable-impure-env"
"flakes"
"git-hashing"
"nix-command"
"recursive-nix"
"repl-flake"
"verified-fetches"
];
settings = {
accept-flake-config = true;
builders-use-substitutes = true;
flake-registry = ""; # I DON'T WANT THE GLOBAL REGISTRY!!!
http-connections = 50;
trusted-users = [ "root" "@wheel" ];
use-cgroups = true;
warn-dirty = false;
accept-flake-config = true;
builders-use-substitutes = true;
flake-registry = ""; # I DON'T WANT THE GLOBAL REGISTRY!!!
http-connections = 50;
show-trace = true;
trusted-users = [ "root" "@wheel" ];
use-cgroups = true;
warn-dirty = false;
};
};
programs.nix-ld = enabled {};
programs.nix-ld = enabled;
})
(systemPackages (with pkgs; [
nh
nix-index
nix-output-monitor
]))
(homeConfiguration {
programs.nushell.configFile.text = mkAfter ''
def --wrapped nr [program: string = "", ...arguments] {
if ($program | str contains "#") or ($program | str contains ":") {
nix run $program -- ...$arguments
} else {
nix run ("default#" + $program) -- ...$arguments
}
}
def --wrapped ns [...programs] {
nix shell ...($programs | each {
if ($in | str contains "#") or ($in | str contains ":") {
$in
} else {
"default#" + $in
}
})
}
'';
})

Binary file not shown.

View file

@ -1,4 +1,4 @@
{ lib, ulib, ... }: ''
{ lib, ... }: ''
$env.config = {
bracketed_paste: true
buffer_editor: ""
@ -155,19 +155,7 @@ $env.config.cursor_shape = {
}
$env.config.hooks = {
command_not_found: {||
${lib.optionalString ulib.isDesktop ''
task status
| where label == boom
| get id
| each {|id|
task kill $id | null
task remove $id | null
}
task spawn --label boom { pw-play ${./boom.opus} }
''}
}
command_not_found: {||}
display_output: "table --expand"
env_change: {}
pre_execution: [

View file

@ -1,7 +1,22 @@
{ config, ulib, pkgs, ... } @ inputs: with ulib; merge3
{ config, lib, pkgs, ... } @ inputs: with lib; merge
(systemConfiguration {
users.defaultUserShell = pkgs.nushell;
users.defaultUserShell = pkgs.nushellFull;
environment.shellAliases = {
la = "ls --all";
lla = "ls --long --all";
sl = "ls";
cp = "cp --recursive --verbose --progress";
mk = "mkdir";
mv = "mv --verbose";
rm = "rm --recursive --verbose";
less = "less -FR";
pstree = "pstree -g 2";
tree = "tree -CF --dirsfirst";
};
})
(homeConfiguration {
@ -10,9 +25,9 @@
command_timeout = 100;
scan_timeout = 20;
cmd_duration.show_notifications = ulib.isDesktop;
cmd_duration.show_notifications = isDesktop;
package.disabled = ulib.isServer;
package.disabled = isServer;
character.error_symbol = "";
character.success_symbol = "";
@ -20,29 +35,16 @@
};
programs.nushell = enabled {
package = pkgs.nushellFull;
configFile.text = import ./configuration.nix.nu inputs;
envFile.text = import ./environment.nix.nu inputs;
envFile.source = ./environment.nu;
environmentVariables = {
inherit (config.environment.variables) NIX_LD;
};
environmentVariables = mapAttrs (_: value: ''"${value}"'') config.environment.variables;
shellAliases = {
shellAliases = (attrsets.removeAttrs config.environment.shellAliases [ "ls" "l" ]) // {
cdtmp = "cd (mktemp --directory)";
la = "ls --all";
ll = "ls --long";
lla = "ls --long --all";
sl = "ls";
cp = "cp --recursive --verbose --progress";
mk = "mkdir";
mv = "mv --verbose";
rm = "rm --recursive --verbose";
less = "less -FR";
pstree = "pstree -g 2";
tree = "tree -CF --dirsfirst";
ll = "ls --long";
};
};
})

View file

@ -1,5 +1,3 @@
{ upkgs, ... }: ''
$env.ENV_CONVERSIONS.PATH = {
from_string: {|string|
$string | split row (char esep) | path expand --no-symlink
@ -20,6 +18,4 @@ def --env mcg [path: path] {
git init
}
use ${upkgs.nuScripts}/modules/background_task/task.nu
zoxide init nushell --cmd cd | save --force ~/.config/nushell/zoxide.nu
''

View file

@ -1,27 +0,0 @@
{ ulib, ... }: with ulib;
serverSystemConfiguration {
programs.mosh = enabled {
openFirewall = true;
};
services.openssh = enabled {
banner = ''
_______________________________________
/ If God doesn't destroy San Francisco, \
| He should apologize to Sodom and |
\ Gomorrah. /
---------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
'';
ports = [ 2222 ];
settings = {
KbdInteractiveAuthentication = false;
PasswordAuthentication = false;
};
};
}

View file

@ -1,21 +0,0 @@
_________________________________________
/ You will pay for your sins. If you have \
| already paid, please disregard this |
\ message. /
-----------------------------------------
\ / \ //\
\ |\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~

View file

@ -1,5 +0,0 @@
{ ulib, pkgs, ... }: with ulib;
desktopHomePackages (with pkgs; [
openttd
])

View file

@ -1,4 +1,4 @@
{ ulib, pkgs, upkgs, ... }: with ulib; merge3
{ lib, pkgs, ... }: with lib; merge
(systemPackages (with pkgs; [
asciinema
@ -10,8 +10,6 @@
(fortune.override { withOffensive = true; })
hyperfine
moreutils
nix-index
nix-output-monitor
openssl
p7zip
pstree
@ -26,7 +24,7 @@
]))
(desktopSystemPackages (with pkgs; [
upkgs.ageNix
agenix
clang_16
clang-tools_16
@ -36,18 +34,17 @@
jdk
lld
maven
upkgs.zig
vlang
zig
wine
]))
(desktopHomePackages (with pkgs; [
(desktopUserHomePackages (with pkgs; [
element-desktop
fractal
qbittorrent
thunderbird
upkgs.rat
whatsapp-for-linux
krita

View file

@ -1,11 +1,11 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
desktopSystemConfiguration {
security.rtkit = enabled {};
sound = enabled {};
security.rtkit = enabled;
sound = enabled;
services.pipewire = enabled {
alsa = enabled { support32Bit = true; };
pulse = enabled {};
pulse = enabled;
};
}

View file

@ -1,39 +0,0 @@
{ ulib, ... }: with ulib;
homeConfiguration {
services.pueue = enabled {
settings = {
shared = {
pueue_directory = "~/.local/share/pueue";
use_unix_socket = true;
runtime_directory = null;
unix_socket_path = "~/.local/share/pueue/pueue_your_user.socket";
host = "localhost";
port = 6924;
daemon_cert = "~/.local/share/pueue/certs/daemon.cert";
daemon_key = "~/.local/share/pueue/certs/daemon.key";
shared_secret_path = "~/.local/share/pueue/shared_secret";
};
client = {
restart_in_place = false;
read_local_logs = true;
show_confirmation_questions = false;
show_expanded_aliases = false;
dark_mode = false;
max_status_height = null;
status_time_format = "%H:%M:%S";
status_datetime_format = "%Y-%m-%d\n%H:%M:%S";
};
daemon = {
default_parallel_tasks = 10;
pause_group_on_failure = false;
pause_all_on_failure = false;
callback = "\"Task {{ id }}\nCommand: {{ command }}\nPath: {{ path }}\nFinished with status '{{ result }}'\"";
callback_log_lines = 10;
groups.default = 1;
};
};
};
}

View file

@ -1,4 +1,10 @@
{ ulib, pkgs, ... }: with ulib; merge
{ lib, pkgs, ... }: with lib; merge
(systemConfiguration {
environment.shellAliases = {
venv = "virtualenv venv";
};
})
(systemPackages (with pkgs; [
(python311.withPackages (pkgs: with pkgs; [
@ -8,9 +14,3 @@
virtualenv
poetry
]))
(homeConfiguration {
programs.nushell.shellAliases = {
venv = "virtualenv venv";
};
})

View file

@ -1,9 +0,0 @@
{ ulib, pkgs, ... }: with ulib;
desktopHomeConfiguration {
qt = enabled {
platformTheme = "gnome";
style.name = "adwaita-dark";
style.package = pkgs.adwaita-qt;
};
}

View file

@ -1,10 +1,12 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib; merge
homeConfiguration {
programs.nushell.shellAliases = {
(systemConfiguration {
environment.shellAliases = {
rg = "rg --line-number --smart-case";
todo = ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold'';
};
})
programs.ripgrep = enabled {};
}
(homeConfiguration {
programs.ripgrep = enabled;
})

View file

@ -1,8 +1,4 @@
{ inputs, ulib, pkgs, ... }: with ulib; merge3
(desktopSystemConfiguration {
nixpkgs.overlays = [ inputs.fenix.overlays.default ];
})
{ lib, pkgs, ... }: with lib; merge
(desktopSystemPackages (with pkgs; [
cargo-expand
@ -16,6 +12,7 @@
])
]))
(desktopHomeConfiguration {
programs.nushell.environmentVariables.CARGO_NET_GIT_FETCH_WITH_CLI = ''"true"'';
(desktopSystemConfiguration {
environment.variables.CARGO_NET_GIT_FETCH_WITH_CLI = "true";
})

View file

@ -1,4 +1,4 @@
{ ulib, pkgs, ... }: with ulib; merge
{ lib, pkgs, ... }: with lib; merge
(desktopSystemPackages (with pkgs; [
mosh
@ -11,23 +11,49 @@
serverAliveCountMax = 2;
serverAliveInterval = 60;
matchBlocks."*".setEnv = {
COLORTERM = "truecolor";
TERM = "xterm-256color";
};
matchBlocks = {
"*" = {
setEnv.COLORTERM = "truecolor";
setEnv.TERM = "xterm-256color";
matchBlocks.cube = {
hostname = "5.255.78.70";
user = "rgb";
port = 2222;
identityFile = "~/.ssh/id";
};
identityFile = "~/.ssh/id";
};
matchBlocks.robotic = {
hostname = "86.105.252.189";
user = "rgbcube";
port = 2299;
identityFile = "~/.ssh/id";
cube = {
hostname = "5.255.78.70";
user = "rgb";
port = 2222;
};
disk = {
hostname = "23.164.232.40";
user = "floppy";
port = 2222;
};
robotic = {
hostname = "86.105.252.189";
user = "rgbcube";
port = 2299;
};
};
};
})
(let
port = 2222;
in serverSystemConfiguration {
programs.mosh = enabled {
openFirewall = true;
};
services.openssh = enabled {
ports = [ port ];
settings = {
KbdInteractiveAuthentication = false;
PasswordAuthentication = false;
AcceptEnv = "COLORTERM";
};
};
})

View file

@ -1,4 +1,4 @@
{ ulib, pkgs, ... }: with ulib; merge
{ lib, pkgs, ... }: with lib; merge
(desktopSystemConfiguration {
# Steam uses 32-bit drivers for some unholy fucking reason.
@ -7,6 +7,6 @@
nixpkgs.config.allowUnfree = true;
})
(desktopHomePackages (with pkgs; [
(desktopUserHomePackages (with pkgs; [
steam
]))

View file

@ -1,4 +1,4 @@
{ lib, ulib, ... }: with ulib; merge
{ lib, ... }: with lib; merge
(desktopSystemConfiguration {
security.sudo.wheelNeedsPassword = false;
@ -6,15 +6,15 @@
(systemConfiguration {
security.sudo = enabled {
execWheelOnly = true;
extraConfig = ''
Defaults lecture = never
Defaults pwfeedback
Defaults env_keep += "DISPLAY EDITOR PATH"
${lib.optionalString ulib.isServer ''
${optionalString isServer ''
Defaults timestamp_timeout = 0
''}
'';
execWheelOnly = true;
extraRules = [{
groups = [ "wheel" ];

View file

@ -1,4 +1,4 @@
{ ulib, pkgs, ... }: with ulib; merge
{ lib, pkgs, ... }: with lib; merge
(desktopSystemConfiguration {
programs.thunar = enabled {

View file

@ -1,4 +1,4 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
systemConfiguration {
boot.tmp.cleanOnBoot = true;

View file

@ -1,4 +1,4 @@
{ ulib, ... }: with ulib;
{ lib, ... }: with lib;
systemConfiguration {
users.mutableUsers = false;

View file

@ -1,12 +1,12 @@
{ ulib, pkgs, ... }: with ulib; merge
{ lib, pkgs, ... }: with lib; merge
(systemPackages (with pkgs; [
w3m
]))
(homeConfiguration {
programs.nushell.shellAliases = {
(systemConfiguration {
environment.shellAliases = {
ddg = "w3m lite.duckduckgo.com";
web = "w3m";
};
})
(systemPackages (with pkgs; [
w3m
]))

View file

@ -1,8 +1,8 @@
{ ulib, theme, ... }: with ulib;
{ config, lib, ... }: with lib;
desktopHomeConfiguration {
programs.waybar = with theme.withHashtag; enabled {
systemd = enabled {};
desktopUserHomeConfiguration {
programs.waybar = with config.theme.withHashtag; enabled {
systemd = enabled;
settings = [{
layer = "top";
@ -12,9 +12,7 @@ desktopHomeConfiguration {
margin-left = margin;
margin-top = margin;
modules-left = [
"hyprland/workspaces"
];
modules-left = [ "hyprland/workspaces" ];
"hyprland/workspaces" = {
format = "{icon}";
@ -36,16 +34,7 @@ desktopHomeConfiguration {
rewrite."(.*) nu" = "$1";
};
modules-right = [
"tray"
"pulseaudio"
"backlight"
"cpu"
"memory"
"network"
"battery"
"clock"
];
modules-right = [ "tray" "pulseaudio" "backlight" "cpu" "memory" "network" "battery" "clock" ];
tray = {
reverse-direction = true;
@ -53,35 +42,21 @@ desktopHomeConfiguration {
};
pulseaudio = {
format = "{format_source} {icon}{volume}%";
format-muted = "{format_source} 󰸈";
format = "{format_source} {icon}{volume}%";
format-muted = "{format_source} 󰸈";
format-bluetooth = "{format_source} 󰋋󰂯{volume}%";
format-bluetooth-muted = "{format_source} 󰟎󰂯";
format-source = "󰍬";
format-source-muted = "󰍭";
format-source = "󰍬";
format-source-muted = "󰍭";
format-icons.default = [
"󰕿"
"󰖀"
"󰕾"
];
format-icons.default = [ "󰕿" "󰖀" "󰕾" ];
};
backlight = {
format = "{icon}{percent}%";
format-icons = [
""
""
""
""
""
""
""
""
""
];
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
cpu.format = "{usage}%";
@ -99,26 +74,13 @@ desktopHomeConfiguration {
format-charging = "󰂄{capacity}%";
format-plugged = "󰂄{capacity}%";
format-icons = [
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
format-icons = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
states.warning = 30;
states.critical = 15;
};
clock = {
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
clock.tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
}];
style = ''