mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-24 20:52:24 +00:00
Compare commits
No commits in common. "cc69cbaa6c344cdfbaaf62ee8f4bd6eb2306ef72" and "cf19085158a2c28120b5effe874b904cc0f567c7" have entirely different histories.
cc69cbaa6c
...
cf19085158
@ -112,7 +112,6 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
mullvad.enable = false;
|
mullvad.enable = false;
|
||||||
rust.enable = true;
|
rust.enable = true;
|
||||||
terraform.enable = true;
|
terraform.enable = true;
|
||||||
wezterm.enable = true;
|
|
||||||
yt-dlp.enable = true;
|
yt-dlp.enable = true;
|
||||||
gaming = {
|
gaming = {
|
||||||
dwarf-fortress.enable = true;
|
dwarf-fortress.enable = true;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
environment =
|
environment =
|
||||||
{ }
|
{ }
|
||||||
// lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) {
|
// lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) {
|
||||||
sessionVariables.ROFI_SYSTEMD_TERM = lib.mkDefault "${pkgs.kitty}/bin/kitty";
|
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.kitty}/bin/kitty";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
@ -31,7 +31,7 @@
|
|||||||
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty";
|
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||||
|
|
||||||
# Set the Rofi terminal for running programs
|
# Set the Rofi terminal for running programs
|
||||||
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux (lib.mkDefault "${pkgs.kitty}/bin/kitty");
|
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
|
||||||
|
|
||||||
# Display images in the terminal
|
# Display images in the terminal
|
||||||
programs.fish.shellAliases = {
|
programs.fish.shellAliases = {
|
||||||
|
@ -15,11 +15,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = lib.mkIf (config.gui.enable && config.wezterm.enable) {
|
||||||
let
|
|
||||||
font = config.home-manager.users.${config.user}.programs.kitty.font.name;
|
|
||||||
in
|
|
||||||
lib.mkIf (config.gui.enable && config.wezterm.enable) {
|
|
||||||
|
|
||||||
# Set the Rofi-Systemd terminal for viewing logs
|
# Set the Rofi-Systemd terminal for viewing logs
|
||||||
# Using optionalAttrs because only available in NixOS
|
# Using optionalAttrs because only available in NixOS
|
||||||
@ -110,20 +106,19 @@
|
|||||||
|
|
||||||
-- Window
|
-- Window
|
||||||
window_padding = {
|
window_padding = {
|
||||||
left = 10,
|
left = 6,
|
||||||
right = 10,
|
right = 6,
|
||||||
top = 10,
|
top = 0,
|
||||||
bottom = 10,
|
bottom = 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
font = wezterm.font('${font}', { weight = 'Bold'}),
|
font = wezterm.font 'VictorMono Nerd Font',
|
||||||
font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"},
|
font_size = 18.0,
|
||||||
|
|
||||||
-- Tab Bar
|
-- Tab Bar
|
||||||
hide_tab_bar_if_only_one_tab = true,
|
|
||||||
window_frame = {
|
window_frame = {
|
||||||
font = wezterm.font('${font}', { weight = 'Bold'}),
|
font = wezterm.font 'VictorMono Nerd Font',
|
||||||
font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"},
|
font_size = 16.0,
|
||||||
},
|
},
|
||||||
|
|
||||||
colors = {
|
colors = {
|
||||||
|
@ -19,9 +19,10 @@
|
|||||||
options.gaming.enable = lib.mkEnableOption "Enable gaming features.";
|
options.gaming.enable = lib.mkEnableOption "Enable gaming features.";
|
||||||
|
|
||||||
config = lib.mkIf (config.gaming.enable && pkgs.stdenv.isLinux) {
|
config = lib.mkIf (config.gaming.enable && pkgs.stdenv.isLinux) {
|
||||||
hardware.graphics = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enable32Bit = true;
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
programs.gamemode.enable = true;
|
programs.gamemode.enable = true;
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,6 @@ let
|
|||||||
|
|
||||||
lockCmd = "${pkgs.betterlockscreen}/bin/betterlockscreen --lock --display 1 --blur 0.5 --span";
|
lockCmd = "${pkgs.betterlockscreen}/bin/betterlockscreen --lock --display 1 --blur 0.5 --span";
|
||||||
lockUpdate = "${pkgs.betterlockscreen}/bin/betterlockscreen --update ${config.wallpaper} --display 1 --span";
|
lockUpdate = "${pkgs.betterlockscreen}/bin/betterlockscreen --update ${config.wallpaper} --display 1 --span";
|
||||||
terminal = "wezterm";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -48,10 +47,9 @@ in
|
|||||||
assigns = {
|
assigns = {
|
||||||
"${ws1}" = [ { class = "Firefox"; } ];
|
"${ws1}" = [ { class = "Firefox"; } ];
|
||||||
"${ws2}" = [
|
"${ws2}" = [
|
||||||
{ class = "aerc"; }
|
|
||||||
{ class = "kitty"; }
|
{ class = "kitty"; }
|
||||||
|
{ class = "aerc"; }
|
||||||
{ class = "obsidian"; }
|
{ class = "obsidian"; }
|
||||||
{ class = "wezterm"; }
|
|
||||||
];
|
];
|
||||||
"${ws3}" = [ { class = "discord"; } ];
|
"${ws3}" = [ { class = "discord"; } ];
|
||||||
"${ws4}" = [
|
"${ws4}" = [
|
||||||
@ -128,9 +126,7 @@ in
|
|||||||
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
||||||
|
|
||||||
# Launchers
|
# Launchers
|
||||||
"${modifier}+Return" = "exec --no-startup-id ${
|
"${modifier}+Return" = "exec --no-startup-id kitty; workspace ${ws2}; layout tabbed";
|
||||||
config.home-manager.users.${config.user}.programs.rofi.terminal
|
|
||||||
}; workspace ${ws2}; layout tabbed";
|
|
||||||
"${modifier}+space" = "exec --no-startup-id ${config.launcherCommand}";
|
"${modifier}+space" = "exec --no-startup-id ${config.launcherCommand}";
|
||||||
"${modifier}+Shift+s" = "exec --no-startup-id ${config.systemdSearch}";
|
"${modifier}+Shift+s" = "exec --no-startup-id ${config.systemdSearch}";
|
||||||
"${modifier}+Shift+a" = "exec --no-startup-id ${config.audioSwitchCommand}";
|
"${modifier}+Shift+a" = "exec --no-startup-id ${config.audioSwitchCommand}";
|
||||||
@ -142,12 +138,8 @@ in
|
|||||||
"${modifier}+Shift+r" = "restart";
|
"${modifier}+Shift+r" = "restart";
|
||||||
"${modifier}+Shift+q" = ''exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"'';
|
"${modifier}+Shift+q" = ''exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"'';
|
||||||
"${modifier}+Shift+x" = "exec ${lockCmd}";
|
"${modifier}+Shift+x" = "exec ${lockCmd}";
|
||||||
"${modifier}+Mod1+h" = "exec --no-startup-id ${
|
"${modifier}+Mod1+h" = "exec --no-startup-id kitty sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
||||||
config.home-manager.users.${config.user}.programs.rofi.terminal
|
"${modifier}+Mod1+r" = "exec --no-startup-id kitty sh -c 'doas nixos-rebuild switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
||||||
} -e sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
|
||||||
"${modifier}+Mod1+r" = "exec --no-startup-id ${
|
|
||||||
config.home-manager.users.${config.user}.programs.rofi.terminal
|
|
||||||
} -e sh -c 'doas nixos-rebuild switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
|
||||||
|
|
||||||
# Window options
|
# Window options
|
||||||
"${modifier}+q" = "kill";
|
"${modifier}+q" = "kill";
|
||||||
|
@ -18,6 +18,9 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) {
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) {
|
||||||
|
|
||||||
|
# Set the Rofi-Systemd terminal for viewing logs
|
||||||
|
environment.sessionVariables.ROFI_SYSTEMD_TERM = lib.mkIf config.kitty.enable "${pkgs.kitty}/bin/kitty";
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
@ -12,7 +12,7 @@ let
|
|||||||
|
|
||||||
username = "prometheus";
|
username = "prometheus";
|
||||||
|
|
||||||
prometheusConfig = {
|
prometheusConfig = (pkgs.formats.yaml { }).generate "prometheus.yml" {
|
||||||
scrape_configs = [
|
scrape_configs = [
|
||||||
{
|
{
|
||||||
job_name = config.networking.hostName;
|
job_name = config.networking.hostName;
|
||||||
@ -38,6 +38,8 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
|
services.victoriametrics.extraOptions = [ "-promscrape.config=${prometheusConfig}" ];
|
||||||
|
|
||||||
systemd.services.vmauth = lib.mkIf config.services.victoriametrics.enable {
|
systemd.services.vmauth = lib.mkIf config.services.victoriametrics.enable {
|
||||||
description = "VictoriaMetrics basic auth proxy";
|
description = "VictoriaMetrics basic auth proxy";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
@ -83,18 +85,21 @@ in
|
|||||||
|
|
||||||
# VMAgent
|
# VMAgent
|
||||||
|
|
||||||
services.vmagent = {
|
services.vmagent.prometheusConfig = prometheusConfig; # Overwritten below
|
||||||
prometheusConfig = prometheusConfig;
|
systemd.services.vmagent.serviceConfig = lib.mkIf config.services.vmagent.enable {
|
||||||
remoteWrite = {
|
ExecStart = lib.mkForce ''
|
||||||
url = "https://${config.hostnames.prometheus}/api/v1/write";
|
${pkgs.victoriametrics}/bin/vmagent \
|
||||||
basicAuthUsername = username;
|
-promscrape.config=${prometheusConfig} \
|
||||||
basicAuthPasswordFile = config.secrets.vmagent.dest;
|
-remoteWrite.url="https://${config.hostnames.prometheus}/api/v1/write" \
|
||||||
};
|
-remoteWrite.basicAuth.username=${username} \
|
||||||
|
-remoteWrite.basicAuth.passwordFile=${config.secrets.vmagent.dest}'';
|
||||||
};
|
};
|
||||||
|
|
||||||
secrets.vmagent = lib.mkIf config.services.vmagent.enable {
|
secrets.vmagent = lib.mkIf config.services.vmagent.enable {
|
||||||
source = ../../../private/prometheus.age;
|
source = ../../../private/prometheus.age;
|
||||||
dest = "${config.secretsDirectory}/vmagent";
|
dest = "${config.secretsDirectory}/vmagent";
|
||||||
|
owner = "vmagent";
|
||||||
|
group = "vmagent";
|
||||||
};
|
};
|
||||||
systemd.services.vmagent-secret = lib.mkIf config.services.vmagent.enable {
|
systemd.services.vmagent-secret = lib.mkIf config.services.vmagent.enable {
|
||||||
requiredBy = [ "vmagent.service" ];
|
requiredBy = [ "vmagent.service" ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user