mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 03:27:45 +00:00
Start refactor
This commit is contained in:
parent
99b7ccfadb
commit
06cce18e72
155 changed files with 2139 additions and 3738 deletions
|
@ -1,20 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(desktopUserHomeConfiguration {
|
||||
xdg.configFile."Vencord/settings/quickCss.css".text = config.theme.discordCss;
|
||||
})
|
||||
|
||||
(desktopUserHomePackages (with pkgs; [
|
||||
((discord.override {
|
||||
withOpenASAR = true;
|
||||
withVencord = true;
|
||||
}).overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ makeWrapper ];
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/opt/Discord/Discord \
|
||||
--set ELECTRON_OZONE_PLATFORM_HINT "auto" \
|
||||
--add-flags "--enable-features=UseOzonePlatform --ozone-platform=wayland"
|
||||
'';
|
||||
}))
|
||||
]))
|
|
@ -1,10 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
# Steam uses 32-bit drivers for some unholy fucking reason.
|
||||
hardware.graphics.enable32Bit = true;
|
||||
})
|
||||
|
||||
(desktopUserHomePackages (with pkgs; [
|
||||
steam
|
||||
]))
|
|
@ -1,13 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
age.identityPaths = [ "/root/.ssh/id" ];
|
||||
})
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
environment.shellAliases.agenix = "agenix --identity ~/.ssh/id";
|
||||
})
|
||||
|
||||
(desktopSystemPackages (with pkgs; [
|
||||
agenix
|
||||
]))
|
|
@ -1,22 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
environment.variables = {
|
||||
MANPAGER = "bat --plain";
|
||||
PAGER = "bat --plain";
|
||||
};
|
||||
|
||||
environment.shellAliases = {
|
||||
cat = "bat";
|
||||
less = "bat --plain";
|
||||
};
|
||||
})
|
||||
|
||||
(homeConfiguration {
|
||||
programs.bat = enabled {
|
||||
config.theme = "base16";
|
||||
themes.base16.src = pkgs.writeText "base16.tmTheme" config.theme.tmTheme;
|
||||
|
||||
config.pager = "less -FR";
|
||||
};
|
||||
})
|
|
@ -1,11 +0,0 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
homeConfiguration {
|
||||
xdg.configFile."btop/themes/base16.theme".text = config.theme.btopTheme;
|
||||
|
||||
programs.btop = enabled {
|
||||
settings.color_theme = "base16";
|
||||
|
||||
settings.rounded_corners = config.theme.cornerRadius > 0;
|
||||
};
|
||||
}
|
17
modules/common/agenix.nix
Normal file
17
modules/common/agenix.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) attrNames head mkAliasOptionModule mkIf;
|
||||
in {
|
||||
imports = [(mkAliasOptionModule [ "secrets" ] [ "age" "secrets" ])];
|
||||
|
||||
age.identityPaths = [
|
||||
(if config.isLinux then
|
||||
"/root/.ssh/id"
|
||||
else
|
||||
"/Users/${config.users.users |> attrNames |> head}/.ssh/id")
|
||||
];
|
||||
|
||||
environment = mkIf config.isDesktop {
|
||||
shellAliases.agenix = "agenix --identity ~/.ssh/id";
|
||||
systemPackages = [ pkgs.agenix ];
|
||||
};
|
||||
}
|
20
modules/common/bat.nix
Normal file
20
modules/common/bat.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
environment.variables = {
|
||||
MANPAGER = "bat --plain";
|
||||
PAGER = "bat --plain";
|
||||
};
|
||||
environment.shellAliases = {
|
||||
cat = "bat";
|
||||
less = "bat --plain";
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
programs.bat = enabled {
|
||||
config.theme = "base16";
|
||||
themes.base16.src = pkgs.writeText "base16.tmTheme" config.theme.tmTheme;
|
||||
config.pager = "less -FR";
|
||||
};
|
||||
}];
|
||||
}
|
13
modules/common/btop.nix
Normal file
13
modules/common/btop.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
home-manager.sharedModules = [{
|
||||
xdg.configFile."btop/themes/base16.theme".text = config.theme.btopTheme;
|
||||
|
||||
programs.btop = enabled {
|
||||
settings.color_theme = "base16";
|
||||
|
||||
settings.rounded_corners = config.theme.cornerRadius > 0;
|
||||
};
|
||||
}];
|
||||
}
|
22
modules/common/discord.nix
Normal file
22
modules/common/discord.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedModules = [{
|
||||
xdg.configFile."Vencord/settings/quickCss.css".text = config.theme.discordCss;
|
||||
}];
|
||||
|
||||
environment.systemPackages = mkIf config.isLinux [
|
||||
((pkgs.discord.override {
|
||||
withOpenASAR = true;
|
||||
withVencord = true;
|
||||
}).overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.makeWrapper ];
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/opt/Discord/Discord \
|
||||
--set ELECTRON_OZONE_PLATFORM_HINT "auto" \
|
||||
--add-flags "--enable-features=UseOzonePlatform --ozone-platform=wayland"
|
||||
'';
|
||||
}))
|
||||
];
|
||||
}
|
24
modules/common/dns.nix
Normal file
24
modules/common/dns.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ lib, ... }: let
|
||||
inherit (lib) mkConst;
|
||||
in {
|
||||
options.dnsServers = mkConst [
|
||||
"45.90.28.0#7f2bf8.dns.nextdns.io"
|
||||
"2a07:a8c0::#7f2bf8.dns.nextdns.io"
|
||||
"45.90.30.0#7f2bf8.dns.nextdns.io"
|
||||
"2a07:a8c1::#7f2bf8.dns.nextdns.io"
|
||||
];
|
||||
|
||||
options.fallbackDnsServers = mkConst [
|
||||
"1.1.1.1#one.one.one.one"
|
||||
"2606:4700:4700::1111#one.one.one.one"
|
||||
|
||||
"1.0.0.1#one.one.one.one"
|
||||
"2606:4700:4700::1001#one.one.one.one"
|
||||
|
||||
"8.8.8.8#dns.google"
|
||||
"2001:4860:4860::8888#dns.google"
|
||||
|
||||
"8.8.4.4#dns.google"
|
||||
"2001:4860:4860::8844#dns.google"
|
||||
];
|
||||
}
|
78
modules/common/ghostty.nix
Normal file
78
modules/common/ghostty.nix
Normal file
|
@ -0,0 +1,78 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled mapAttrsToList merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedModules = [{
|
||||
programs.nushell.environmentVariables = {
|
||||
TERMINAL = mkIf config.isLinux "ghostty";
|
||||
TERM_PROGRAM = mkIf config.isDarwin "ghostty";
|
||||
};
|
||||
|
||||
programs.ghostty = enabled {
|
||||
# Don't actually install Ghostty if we are on Darwin.
|
||||
# For some reason it is marked as broken.
|
||||
package = mkIf config.isDarwin <| pkgs.writeScriptBin "not-ghostty" "";
|
||||
|
||||
# Bat syntax points to emptyDirectory.
|
||||
installBatSyntax = !config.isDarwin;
|
||||
|
||||
clearDefaultKeybinds = true;
|
||||
|
||||
settings = with config.theme; {
|
||||
font-size = font.size.normal;
|
||||
font-family = font.mono.name;
|
||||
|
||||
window-padding-x = padding;
|
||||
window-padding-y = padding;
|
||||
|
||||
confirm-close-surface = false;
|
||||
|
||||
window-decoration = config.isDarwin;
|
||||
|
||||
config-file = toString <| pkgs.writeText "base16-config" ghosttyConfig;
|
||||
|
||||
keybind = mapAttrsToList (name: value: "ctrl+shift+${name}=${value}") {
|
||||
c = "copy_to_clipboard";
|
||||
v = "paste_from_clipboard";
|
||||
|
||||
z = "jump_to_prompt:-2";
|
||||
x = "jump_to_prompt:2";
|
||||
|
||||
h = "write_scrollback_file:paste";
|
||||
i = "inspector:toggle";
|
||||
|
||||
page_down = "scroll_page_fractional:0.33";
|
||||
down = "scroll_page_lines:1";
|
||||
j = "scroll_page_lines:1";
|
||||
|
||||
page_up = "scroll_page_fractional:-0.33";
|
||||
up = "scroll_page_lines:-1";
|
||||
k = "scroll_page_lines:-1";
|
||||
|
||||
home = "scroll_to_top";
|
||||
end = "scroll_to_bottom";
|
||||
|
||||
enter = "reset_font_size";
|
||||
plus = "increase_font_size:1";
|
||||
minus = "decrease_font_size:1";
|
||||
|
||||
t = "new_tab";
|
||||
q = "close_surface";
|
||||
|
||||
"physical:one" = "goto_tab:1";
|
||||
"physical:two" = "goto_tab:2";
|
||||
"physical:three" = "goto_tab:3";
|
||||
"physical:four" = "goto_tab:4";
|
||||
"physical:five" = "goto_tab:5";
|
||||
"physical:six" = "goto_tab:6";
|
||||
"physical:seven" = "goto_tab:7";
|
||||
"physical:eight" = "goto_tab:8";
|
||||
"physical:nine" = "goto_tab:9";
|
||||
"physical:zero" = "goto_tab:10";
|
||||
} ++ mapAttrsToList (name: value: "ctrl+${name}=${value}") {
|
||||
"physical:tab" = "next_tab";
|
||||
"shift+physical:tab" = "previous_tab";
|
||||
};
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
161
modules/common/git.nix
Normal file
161
modules/common/git.nix
Normal file
|
@ -0,0 +1,161 @@
|
|||
{ self, config, lib, pkgs, ... }: let
|
||||
inherit (lib) head mkAfter enabled merge mkIf;
|
||||
inherit (lib.strings) match;
|
||||
in {
|
||||
environment.shellAliases = merge {
|
||||
g = "git";
|
||||
|
||||
ga = "git add";
|
||||
gaa = "git add ./";
|
||||
|
||||
gab = "git absorb";
|
||||
gabr = "git absorb --and-rebase";
|
||||
|
||||
gb = "git branch";
|
||||
gbv = "git branch --verbose";
|
||||
|
||||
gc = "git commit";
|
||||
gca = "git commit --amend --no-edit";
|
||||
gcm = "git commit --message";
|
||||
gcam = "git commit --amend --message";
|
||||
|
||||
gcl = "git clone";
|
||||
|
||||
gd = "git diff";
|
||||
gds = "git diff --staged";
|
||||
|
||||
gp = "git push";
|
||||
gpf = "git push --force-with-lease";
|
||||
|
||||
gl = "git log";
|
||||
glo = "git log --oneline --graph";
|
||||
glp = "git log -p --ext-diff";
|
||||
|
||||
gpl = "git pull";
|
||||
gplr = "git pull --rebase";
|
||||
gplff = "git pull --ff-only";
|
||||
|
||||
gr = "git recent";
|
||||
|
||||
grb = "git rebase";
|
||||
grba = "git rebase --abort";
|
||||
grbc = "git rebase --continue";
|
||||
grbi = "git rebase --interactive";
|
||||
grbm = "git rebase master";
|
||||
|
||||
grl = "git reflog";
|
||||
|
||||
grm = "git remote";
|
||||
grma = "git remote add";
|
||||
grmv = "git remote --verbose";
|
||||
grmsu = "git remote set-url";
|
||||
|
||||
grs = "git reset";
|
||||
grsh = "git reset --hard";
|
||||
|
||||
gs = "git stash";
|
||||
gsp = "git stash pop";
|
||||
|
||||
gsw = "git switch";
|
||||
gswm = "git switch master";
|
||||
|
||||
gsh = "git show --ext-diff";
|
||||
|
||||
gst = "git status";
|
||||
} <| mkIf config.isDesktop {
|
||||
"\"??\"" = "gh copilot suggest --target shell";
|
||||
"\"gh?\"" = "gh copilot suggest --target gh";
|
||||
"\"git?\"" = "gh copilot suggest --target git";
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.git-absorb
|
||||
pkgs.tig
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [
|
||||
(let
|
||||
# TODO: gitUrl = self.cube.services.forgejo.settings.server.ROOT_URL;
|
||||
gitUrl = "https://git.rgbcu.be/";
|
||||
gitDomain = head <| match "https://(.*)/" gitUrl;
|
||||
|
||||
# TODO: mailDomain = head self.disk.mailserver.domains;
|
||||
mailDomain = "rgbcu.be";
|
||||
in {
|
||||
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 {
|
||||
$user_and_repo
|
||||
} else {
|
||||
"RGBCube/" + $user_and_repo
|
||||
}
|
||||
|
||||
git remote add origin ("${gitUrl}" + $user_and_repo)
|
||||
}
|
||||
'';
|
||||
|
||||
programs.git = enabled {
|
||||
package = pkgs.gitFull;
|
||||
|
||||
userName = "RGBCube";
|
||||
userEmail = "git@${mailDomain}";
|
||||
|
||||
lfs = enabled;
|
||||
|
||||
difftastic = enabled {
|
||||
background = "dark";
|
||||
};
|
||||
|
||||
extraConfig = merge {
|
||||
init.defaultBranch = "master";
|
||||
|
||||
commit.verbose = true;
|
||||
|
||||
log.date = "iso";
|
||||
column.ui = "auto";
|
||||
|
||||
branch.sort = "-committerdate";
|
||||
tag.sort = "version:refname";
|
||||
|
||||
diff.algorithm = "histogram";
|
||||
diff.colorMoved = "default";
|
||||
|
||||
pull.rebase = true;
|
||||
push.autoSetupRemote = true;
|
||||
|
||||
merge.conflictStyle = "zdiff3";
|
||||
|
||||
rebase.autoSquash = true;
|
||||
rebase.autoStash = true;
|
||||
rebase.updateRefs = true;
|
||||
rerere.enabled = true;
|
||||
|
||||
fetch.fsckObjects = true;
|
||||
receive.fsckObjects = true;
|
||||
transfer.fsckobjects = true;
|
||||
|
||||
# https://bernsteinbear.com/git
|
||||
alias.recent = "! git branch --sort=-committerdate --format=\"%(committerdate:relative)%09%(refname:short)\" | head -10";
|
||||
} <| mkIf config.isDesktop {
|
||||
core.sshCommand = "ssh -i ~/.ssh/id";
|
||||
url."ssh://git@github.com/".insteadOf = "https://github.com/";
|
||||
# TODO: url."ssh://forgejo@${gitDomain}:${toString (head self.cube.services.openssh.ports)}/".insteadOf = gitUrl;
|
||||
url."ssh://forgejo@${gitDomain}:2222/".insteadOf = gitUrl;
|
||||
|
||||
commit.gpgSign = true;
|
||||
tag.gpgSign = true;
|
||||
|
||||
gpg.format = "ssh";
|
||||
user.signingKey = "~/.ssh/id";
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf config.isDesktop {
|
||||
programs.gh = enabled {
|
||||
settings.git_protocol = "ssh";
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
196
modules/common/helix.nix
Normal file
196
modules/common/helix.nix
Normal file
|
@ -0,0 +1,196 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) const enabled genAttrs mkAfter mkIf;
|
||||
in {
|
||||
environment = {
|
||||
variables.EDITOR = "hx";
|
||||
shellAliases.x = "hx";
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
programs.nushell.configFile.text = mkIf (config.isDesktop && config.isLinux) <| 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
|
||||
denoFormatter = language: {
|
||||
command = "deno";
|
||||
args = [ "fmt" "-" "--ext" language ];
|
||||
};
|
||||
|
||||
denoFormatterLanguages = map (name: {
|
||||
inherit name;
|
||||
|
||||
auto-format = true;
|
||||
formatter = denoFormatter name;
|
||||
}) [ "markdown" "json" ];
|
||||
|
||||
prettier = language: {
|
||||
command = "prettier";
|
||||
args = [ "--parser" language ];
|
||||
};
|
||||
|
||||
prettierLanguages = map (name: {
|
||||
inherit name;
|
||||
|
||||
auto-format = true;
|
||||
formatter = prettier name;
|
||||
}) [ "css" "scss" "yaml" ];
|
||||
in denoFormatterLanguages ++ prettierLanguages ++ [
|
||||
{
|
||||
name = "nix";
|
||||
auto-format = false;
|
||||
formatter.command = "alejandra";
|
||||
}
|
||||
{
|
||||
name = "html";
|
||||
# Added vto.
|
||||
file-types = [ "asp" "aspx" "htm" "html" "jshtm" "jsp" "rhtml" "shtml" "volt" "vto" "xht" "xhtml" ];
|
||||
auto-format = false;
|
||||
formatter = prettier "html";
|
||||
}
|
||||
{
|
||||
name = "javascript";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "js";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
{
|
||||
name = "jsx";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "jsx";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
{
|
||||
name = "typescript";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "ts";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
{
|
||||
name = "tsx";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "tsx";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
];
|
||||
|
||||
languages.language-server = {
|
||||
deno = {
|
||||
command = "deno";
|
||||
args = [ "lsp" ];
|
||||
|
||||
environment.NO_COLOR = "1";
|
||||
|
||||
config.deno = enabled {
|
||||
lint = true;
|
||||
unstable = true;
|
||||
|
||||
suggest.imports.hosts."https://deno.land" = true;
|
||||
|
||||
inlayHints = {
|
||||
enumMemberValues.enabled = true;
|
||||
functionLikeReturnTypes.enabled = true;
|
||||
parameterNames.enabled = "all";
|
||||
parameterTypes.enabled = true;
|
||||
propertyDeclarationTypes.enabled = true;
|
||||
variableTypes.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rust-analyzer.config.check.command = "clippy";
|
||||
};
|
||||
|
||||
settings.theme = "gruvbox_dark_hard";
|
||||
|
||||
settings.editor = {
|
||||
color-modes = true;
|
||||
completion-replace = true;
|
||||
completion-trigger-len = 0;
|
||||
cursor-shape.insert = "bar";
|
||||
cursorline = true;
|
||||
bufferline = "multiple";
|
||||
file-picker.hidden = false;
|
||||
idle-timeout = 0;
|
||||
line-number = "relative";
|
||||
shell = [ "bash" "-c" ];
|
||||
text-width = 100;
|
||||
};
|
||||
|
||||
settings.editor.indent-guides = {
|
||||
character = "▏";
|
||||
render = true;
|
||||
};
|
||||
|
||||
settings.editor.statusline.mode = {
|
||||
insert = "INSERT";
|
||||
normal = "NORMAL";
|
||||
select = "SELECT";
|
||||
};
|
||||
|
||||
settings.editor.whitespace = {
|
||||
characters.tab = "→";
|
||||
render.tab = "all";
|
||||
};
|
||||
|
||||
settings.keys = genAttrs [ "normal" "select" ] (const {
|
||||
D = "extend_to_line_end";
|
||||
});
|
||||
};
|
||||
}];
|
||||
|
||||
environment.systemPackages = mkIf config.isDesktop [
|
||||
# CMAKE
|
||||
pkgs.cmake-language-server
|
||||
|
||||
# GO
|
||||
pkgs.gopls
|
||||
|
||||
# HTML
|
||||
pkgs.vscode-langservers-extracted
|
||||
pkgs.nodePackages_latest.prettier
|
||||
|
||||
# KOTLIN
|
||||
pkgs.kotlin-language-server
|
||||
|
||||
# LATEX
|
||||
pkgs.texlab
|
||||
|
||||
# LUA
|
||||
pkgs.lua-language-server
|
||||
|
||||
# MARKDOWN
|
||||
pkgs.marksman
|
||||
|
||||
# NIX
|
||||
pkgs.alejandra
|
||||
pkgs.nil
|
||||
|
||||
# PYTHON
|
||||
pkgs.python311Packages.python-lsp-server
|
||||
|
||||
# RUST
|
||||
pkgs.rust-analyzer-nightly
|
||||
|
||||
# TYPESCRIPT & OTHERS
|
||||
pkgs.deno
|
||||
|
||||
# YAML
|
||||
pkgs.yaml-language-server
|
||||
|
||||
# ZIG
|
||||
pkgs.zls
|
||||
];
|
||||
}
|
||||
|
6
modules/common/home-manager.nix
Normal file
6
modules/common/home-manager.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
};
|
||||
}
|
61
modules/common/nix.nix
Normal file
61
modules/common/nix.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{ self, config, inputs, lib, pkgs, ... }: let
|
||||
inherit (lib) concatStringsSep const disabled filterAttrs flip isType mapAttrs mapAttrsToList merge mkAfter optionalAttrs;
|
||||
inherit (lib.strings) toJSON;
|
||||
|
||||
registryMap = inputs
|
||||
|> filterAttrs (const <| isType "flake");
|
||||
in {
|
||||
# We don't want this to be garbage collected away because if
|
||||
# that happens rebuilds are slow thanks to my garbage WiFi.
|
||||
environment.etc.".system-inputs.json".text = toJSON registryMap;
|
||||
|
||||
nix.nixPath = registryMap
|
||||
|> mapAttrsToList (name: value: "${name}=${value}")
|
||||
|> concatStringsSep ":";
|
||||
|
||||
nix.registry = registryMap // { default = inputs.nixpkgs; }
|
||||
|> mapAttrs (_: flake: { inherit flake; });
|
||||
|
||||
nix.channel = disabled;
|
||||
|
||||
nix.settings = (import <| self + /flake.nix).nixConfig
|
||||
|> flip removeAttrs (if config.isDarwin then [ "use-cgroups" ] else []);
|
||||
|
||||
nix.gc = merge {
|
||||
automatic = true;
|
||||
options = "--delete-older-than 3d";
|
||||
} <| optionalAttrs config.isLinux {
|
||||
dates = "weekly";
|
||||
persistent = true;
|
||||
};
|
||||
|
||||
nix.optimise.automatic = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.nh
|
||||
pkgs.nix-index
|
||||
pkgs.nix-output-monitor
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
'';
|
||||
}];
|
||||
}
|
92
modules/common/nushell/default.nix
Normal file
92
modules/common/nushell/default.nix
Normal file
|
@ -0,0 +1,92 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled filter first foldl' getExe last match mkIf nameValuePair optionalAttrs readFile removeAttrs splitString;
|
||||
in {
|
||||
users = optionalAttrs config.isLinux { defaultUserShell = pkgs.nushell; };
|
||||
|
||||
environment.shells = mkIf config.isDarwin [ pkgs.nushell ];
|
||||
|
||||
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";
|
||||
|
||||
pstree = "pstree -g 2";
|
||||
tree = "tree -CF --dirsfirst";
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.fish # For completions.
|
||||
pkgs.zoxide # For completions and better cd.
|
||||
];
|
||||
|
||||
environment.variables.STARSHIP_LOG = "error";
|
||||
|
||||
home-manager.sharedModules = [(homeArgs: {
|
||||
xdg.configFile = {
|
||||
"nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
|
||||
${getExe pkgs.zoxide} init nushell --cmd cd > $out
|
||||
'';
|
||||
|
||||
"nushell/ls_colors.txt".source = pkgs.runCommand "ls_colors.txt" {} ''
|
||||
${getExe pkgs.vivid} generate gruvbox-dark-hard > $out
|
||||
'';
|
||||
|
||||
"nushell/starship.nu".source = pkgs.runCommand "starship.nu" {} ''
|
||||
${getExe pkgs.starship} init nu > $out
|
||||
'';
|
||||
};
|
||||
|
||||
programs.starship = enabled {
|
||||
# No because we are doing it at build time instead of the way
|
||||
# this retarded does it. Why the hell do you generate the config
|
||||
# every time the shell is launched?
|
||||
enableNushellIntegration = false;
|
||||
|
||||
settings = {
|
||||
command_timeout = 100;
|
||||
scan_timeout = 20;
|
||||
|
||||
cmd_duration.show_notifications = config.isDesktop;
|
||||
|
||||
package.disabled = config.isServer;
|
||||
|
||||
character.error_symbol = "";
|
||||
character.success_symbol = "";
|
||||
};
|
||||
};
|
||||
|
||||
programs.nushell = enabled {
|
||||
configFile.text = readFile ./configuration.nu;
|
||||
envFile.text = readFile ./environment.nu;
|
||||
|
||||
environmentVariables = let
|
||||
environmentVariables = config.environment.variables;
|
||||
|
||||
homeVariables = homeArgs.config.home.sessionVariables;
|
||||
homeVariablesExtra = pkgs.runCommand "home-variables-extra.env" {} ''
|
||||
alias export=echo
|
||||
# echo foo > $out
|
||||
# FIXME
|
||||
eval $(cat ${homeArgs.config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh) > $out
|
||||
''
|
||||
# |> (aaa: (_: break _) aaa)
|
||||
|> readFile
|
||||
|> splitString "\n"
|
||||
|> filter (s: s != "")
|
||||
|> map (match "([^=]+)=(.*)")
|
||||
|> map (keyAndValue: nameValuePair (first keyAndValue) (last keyAndValue))
|
||||
|> foldl' (x: y: x // y) {};
|
||||
in environmentVariables // homeVariables // homeVariablesExtra;
|
||||
|
||||
shellAliases = removeAttrs config.environment.shellAliases [ "ls" "l" ] // {
|
||||
cdtmp = "cd (mktemp --directory)";
|
||||
ll = "ls --long";
|
||||
};
|
||||
};
|
||||
})];
|
||||
}
|
58
modules/common/packages.nix
Normal file
58
modules/common/packages.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) optionals;
|
||||
in {
|
||||
environment.systemPackages = [
|
||||
pkgs.asciinema
|
||||
pkgs.cowsay
|
||||
pkgs.curlHTTP3
|
||||
pkgs.dig
|
||||
pkgs.doggo
|
||||
pkgs.fastfetch
|
||||
pkgs.fd
|
||||
(pkgs.fortune.override { withOffensive = true; })
|
||||
pkgs.hyperfine
|
||||
pkgs.moreutils
|
||||
pkgs.openssl
|
||||
pkgs.p7zip
|
||||
pkgs.pstree
|
||||
pkgs.rsync
|
||||
pkgs.timg
|
||||
pkgs.tree
|
||||
pkgs.uutils-coreutils-noprefix
|
||||
pkgs.yazi
|
||||
pkgs.yt-dlp
|
||||
] ++ optionals config.isLinux [
|
||||
pkgs.traceroute
|
||||
pkgs.usbutils
|
||||
pkgs.strace
|
||||
] ++ optionals config.isDesktop [
|
||||
pkgs.clang_16
|
||||
pkgs.clang-tools_16
|
||||
pkgs.deno
|
||||
pkgs.gh
|
||||
pkgs.go
|
||||
pkgs.jdk
|
||||
pkgs.lld
|
||||
pkgs.maven
|
||||
pkgs.zig
|
||||
|
||||
pkgs.element-desktop
|
||||
|
||||
pkgs.qbittorrent
|
||||
] ++ optionals (config.isLinux && config.isDesktop) [
|
||||
pkgs.thunderbird
|
||||
|
||||
pkgs.whatsapp-for-linux
|
||||
|
||||
pkgs.zulip
|
||||
pkgs.fractal
|
||||
|
||||
pkgs.obs-studio
|
||||
|
||||
pkgs.krita
|
||||
|
||||
pkgs.libreoffice
|
||||
pkgs.hunspellDicts.en_US
|
||||
pkgs.hunspellDicts.en_GB-ize
|
||||
];
|
||||
}
|
10
modules/common/python.nix
Normal file
10
modules/common/python.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, ... }: {
|
||||
environment.systemPackages = [
|
||||
(pkgs.python311.withPackages (pkgs: [
|
||||
pkgs.pip
|
||||
pkgs.requests
|
||||
]))
|
||||
|
||||
pkgs.uv
|
||||
];
|
||||
}
|
14
modules/common/ripgrep.nix
Normal file
14
modules/common/ripgrep.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ lib, ... }: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
environment.shellAliases.todo = ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold'';
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
programs.ripgrep = enabled {
|
||||
arguments = [
|
||||
"--line-number"
|
||||
"--smart-case"
|
||||
];
|
||||
};
|
||||
}];
|
||||
}
|
18
modules/common/rust.nix
Normal file
18
modules/common/rust.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, ... }: {
|
||||
environment.variables.CARGO_NET_GIT_FETCH_WITH_CLI = "true";
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.cargo-expand
|
||||
pkgs.cargo-fuzz
|
||||
|
||||
pkgs.evcxr
|
||||
|
||||
(pkgs.fenix.complete.withComponents [
|
||||
"cargo"
|
||||
"clippy"
|
||||
"rust-src"
|
||||
"rustc"
|
||||
"rustfmt"
|
||||
])
|
||||
];
|
||||
}
|
12
modules/common/ssh/config.age
Normal file
12
modules/common/ssh/config.age
Normal file
|
@ -0,0 +1,12 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 +rZ0Tw nOt0AMht8Aod+1V2bTWMJnMWtYVm8AckH27mnwFAQS4
|
||||
rBp+kJFoQwh8jD0q5Dv9O6O/iT7tTbPioQGUnOE4Eyc
|
||||
-> ssh-ed25519 spFFQA 7s4U2WKZZwRIYRsZNBmnXI7Yawkh7ZZ0YuTDeaoHCww
|
||||
NX/akV5Cj5WEyeg86kd2JVPGq8f54oixuyR020c6aqs
|
||||
-> ssh-ed25519 dASlBQ fGx+vne56PxD8gaACu1f8iR+Nhscxqs292rH4uEeChc
|
||||
mVq1++pve3Kk0kRbhf4LCTutiEJBEbmsy4fVS+QYrYM
|
||||
-> ssh-ed25519 CzqbPQ Pj0lZnFQXqQrJk9fyi15923rqnVA2GbhR+kRxNMm3Ec
|
||||
yu14hvCAV2MzexoDeiza5CfisuKC5e1p2JbDHbyPy0E
|
||||
--- 8UNtL1+o7GYCfWOYk0E+mIXFt3kb7NhAVzTnBkx0YPQ
|
||||
årm÷õJ)Á–‹²4¢UCßܘ¸JÕÃ`°çvY,ÜÚ<C39C>ô˜CÇÁâ|<7C>›`¶'[œw"\Èþ@‹I
|
||||
.'Ã{nkEÐø@Õ §Ô6È
|
61
modules/common/ssh/default.nix
Normal file
61
modules/common/ssh/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{ self, config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled mkIf;
|
||||
|
||||
controlPath = "~/.ssh/control";
|
||||
in {
|
||||
secrets.sshConfig = {
|
||||
file = ./config.age;
|
||||
mode = "444";
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
home.activation.createControlPath = {
|
||||
after = [ "writeBoundary" ];
|
||||
before = [];
|
||||
data = "mkdir --parents ${controlPath}";
|
||||
};
|
||||
|
||||
programs.ssh = enabled {
|
||||
controlMaster = "auto";
|
||||
controlPath = "${controlPath}/%r@%n:%p";
|
||||
controlPersist = "60m";
|
||||
serverAliveCountMax = 2;
|
||||
serverAliveInterval = 60;
|
||||
|
||||
includes = [ config.secrets.sshConfig.path ];
|
||||
|
||||
matchBlocks = {
|
||||
"*" = {
|
||||
setEnv.COLORTERM = "truecolor";
|
||||
setEnv.TERM = "xterm-256color";
|
||||
|
||||
identityFile = "~/.ssh/id";
|
||||
};
|
||||
|
||||
# TODO: Maybe autogenerate these?
|
||||
|
||||
# cube = {
|
||||
# hostname = self.cube.networking.ipv4;
|
||||
# user = "rgb";
|
||||
# port = 2222;
|
||||
# };
|
||||
|
||||
# disk = {
|
||||
# hostname = self.disk.networking.ipv4;
|
||||
# user = "floppy";
|
||||
# port = 2222;
|
||||
# };
|
||||
|
||||
# nine = {
|
||||
# hostname = self.nine.networking.ipv4;
|
||||
# user = "seven";
|
||||
# port = 2222;
|
||||
# };
|
||||
};
|
||||
};
|
||||
}];
|
||||
|
||||
environment.systemPackages = mkIf config.isDesktop [
|
||||
pkgs.mosh
|
||||
];
|
||||
}
|
13
modules/common/system.nix
Normal file
13
modules/common/system.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) any elem last mapAttrsToList mkConst splitString;
|
||||
in {
|
||||
options = {
|
||||
os = mkConst <| last <| splitString "-" config.nixpkgs.hostPlatform.system;
|
||||
|
||||
isLinux = mkConst <| config.os == "linux";
|
||||
isDarwin = mkConst <| config.os == "darwin";
|
||||
|
||||
isDesktop = mkConst <| config.isDarwin || (any <| mapAttrsToList (_: value: elem "graphical" value.extraGroups) config.users.users);
|
||||
isServer = mkConst <| !config.isDesktop;
|
||||
};
|
||||
}
|
7
modules/common/tailscale.nix
Normal file
7
modules/common/tailscale.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ lib, ... }: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
environment.shellAliases.ts = "sudo tailscale";
|
||||
|
||||
services.tailscale = enabled;
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
{
|
||||
environment.shellAliases.tb = "nc termbin.com 9999";
|
||||
}
|
||||
|
24
modules/common/theme.nix
Normal file
24
modules/common/theme.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ lib, pkgs, themes, ... }: let
|
||||
inherit (lib) mkValue;
|
||||
in {
|
||||
options.theme = mkValue <| themes.custom <| themes.raw.gruvbox-dark-hard // {
|
||||
cornerRadius = 4;
|
||||
borderWidth = 2;
|
||||
|
||||
margin = 0;
|
||||
padding = 8;
|
||||
|
||||
font.size.normal = 16;
|
||||
font.size.big = 20;
|
||||
|
||||
font.sans.name = "Lexend";
|
||||
font.sans.package = pkgs.lexend;
|
||||
|
||||
font.mono.name = "JetBrainsMono Nerd Font";
|
||||
font.mono.package = pkgs.nerd-fonts.jetbrains-mono;
|
||||
|
||||
icons.name = "Gruvbox-Plus-Dark";
|
||||
icons.package = pkgs.gruvbox-plus-icons;
|
||||
};
|
||||
}
|
||||
|
10
modules/common/w3m.nix
Normal file
10
modules/common/w3m.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, ... }: {
|
||||
environment.shellAliases = {
|
||||
ddg = "w3m lite.duckduckgo.com";
|
||||
web = "w3m";
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.w3m
|
||||
];
|
||||
}
|
6
modules/darwin/aerospace.nix
Normal file
6
modules/darwin/aerospace.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ lib, ... }: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
services.aerospace = enabled {
|
||||
};
|
||||
}
|
14
modules/darwin/dns.nix
Normal file
14
modules/darwin/dns.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) head map splitString;
|
||||
in {
|
||||
# Yeah, no DNSSEC or DoT or anything.
|
||||
# That's what you get for using Darwin I guess.
|
||||
networking.dns = config.dnsServers
|
||||
|> map (splitString "#")
|
||||
|> map head;
|
||||
|
||||
networking.knownNetworkServices = [
|
||||
"Thunderbolt Bridge"
|
||||
"Wi-Fi"
|
||||
];
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib;
|
||||
|
||||
let
|
||||
fakeSSHPort = 22;
|
||||
in serverSystemConfiguration {
|
||||
services.prometheus.exporters.endlessh-go = enabled {
|
||||
listenAddress = "[::]";
|
||||
};
|
||||
|
||||
# `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 = [ fakeSSHPort ];
|
||||
|
||||
services.endlessh-go = enabled {
|
||||
listenAddress = "[::]";
|
||||
port = fakeSSHPort;
|
||||
|
||||
extraOptions = [
|
||||
"-alsologtostderr"
|
||||
"-geoip_supplier max-mind-db"
|
||||
"-max_mind_db ${pkgs.clash-geoip}/etc/clash/Country.mmdb"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
desktopUserHomeConfiguration {
|
||||
programs.firefox = enabled {
|
||||
profiles.default = {
|
||||
settings = with config.theme.font; {
|
||||
"general.autoScroll" = true;
|
||||
"privacy.donottrackheader.enabled" = true;
|
||||
|
||||
"browser.fixup.domainsuffixwhitelist.idk" = true;
|
||||
|
||||
"font.name.serif.x-western" = sans.name;
|
||||
"font.size.variable.x-western" = builtins.ceil (1.3 * size.normal);
|
||||
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
|
||||
userChrome = ''
|
||||
#TabsToolbar {
|
||||
visibility: collapse;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: with lib;
|
||||
|
||||
desktopUserHomeConfiguration {
|
||||
programs.nushell.environmentVariables.TERMINAL = "ghostty";
|
||||
|
||||
programs.ghostty = enabled {
|
||||
clearDefaultKeybinds = true;
|
||||
|
||||
settings = with config.theme; {
|
||||
font-size = font.size.normal;
|
||||
font-family = font.mono.name;
|
||||
|
||||
window-padding-x = padding;
|
||||
window-padding-y = padding;
|
||||
|
||||
confirm-close-surface = false;
|
||||
|
||||
window-decoration = false;
|
||||
|
||||
config-file = toString (pkgs.writeText "base16-config" ghosttyConfig);
|
||||
|
||||
keybind = (mapAttrsToList (name: value: "ctrl+shift+${name}=${value}") {
|
||||
c = "copy_to_clipboard";
|
||||
v = "paste_from_clipboard";
|
||||
|
||||
z = "jump_to_prompt:-2";
|
||||
x = "jump_to_prompt:2";
|
||||
|
||||
h = "write_scrollback_file";
|
||||
i = "inspector:toggle";
|
||||
|
||||
page_down = "scroll_page_fractional:0.33";
|
||||
down = "scroll_page_lines:1";
|
||||
j = "scroll_page_lines:1";
|
||||
|
||||
page_up = "scroll_page_fractional:-0.33";
|
||||
up = "scroll_page_lines:-1";
|
||||
k = "scroll_page_lines:-1";
|
||||
|
||||
home = "scroll_to_top";
|
||||
end = "scroll_to_bottom";
|
||||
|
||||
"physical:kp_enter" = "reset_font_size";
|
||||
"physical:kp_add" = "increase_font_size:1";
|
||||
"physical:kp_subtract" = "decrease_font_size:1";
|
||||
|
||||
t = "new_tab";
|
||||
q = "close_surface";
|
||||
|
||||
"physical:one" = "goto_tab:1";
|
||||
"physical:two" = "goto_tab:2";
|
||||
"physical:three" = "goto_tab:3";
|
||||
"physical:four" = "goto_tab:4";
|
||||
"physical:five" = "goto_tab:5";
|
||||
"physical:six" = "goto_tab:6";
|
||||
"physical:seven" = "goto_tab:7";
|
||||
"physical:eight" = "goto_tab:8";
|
||||
"physical:nine" = "goto_tab:9";
|
||||
"physical:zero" = "goto_tab:10";
|
||||
}) ++ (mapAttrsToList (name: value: "ctrl+${name}=${value}") {
|
||||
"physical:tab" = "next_tab";
|
||||
"shift+physical:tab" = "previous_tab";
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
159
modules/git.nix
159
modules/git.nix
|
@ -1,159 +0,0 @@
|
|||
{ self, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
environment.shellAliases = {
|
||||
g = "git";
|
||||
|
||||
ga = "git add";
|
||||
gaa = "git add ./";
|
||||
|
||||
gab = "git absorb";
|
||||
gabr = "git absorb --and-rebase";
|
||||
|
||||
gb = "git branch";
|
||||
gbv = "git branch --verbose";
|
||||
|
||||
gc = "git commit";
|
||||
gca = "git commit --amend --no-edit";
|
||||
gcm = "git commit --message";
|
||||
gcam = "git commit --amend --message";
|
||||
|
||||
gcl = "git clone";
|
||||
|
||||
gd = "git diff";
|
||||
gds = "git diff --staged";
|
||||
|
||||
gp = "git push";
|
||||
gpf = "git push --force-with-lease";
|
||||
|
||||
gl = "git log";
|
||||
glo = "git log --oneline --graph";
|
||||
glp = "git log -p --ext-diff";
|
||||
|
||||
gpl = "git pull";
|
||||
gplr = "git pull --rebase";
|
||||
gplff = "git pull --ff-only";
|
||||
|
||||
gr = "git recent";
|
||||
|
||||
grb = "git rebase";
|
||||
grba = "git rebase --abort";
|
||||
grbc = "git rebase --continue";
|
||||
grbi = "git rebase --interactive";
|
||||
grbm = "git rebase master";
|
||||
|
||||
grl = "git reflog";
|
||||
|
||||
grm = "git remote";
|
||||
grma = "git remote add";
|
||||
grmv = "git remote --verbose";
|
||||
grmsu = "git remote set-url";
|
||||
|
||||
grs = "git reset";
|
||||
grsh = "git reset --hard";
|
||||
|
||||
gs = "git stash";
|
||||
gsp = "git stash pop";
|
||||
|
||||
gsw = "git switch";
|
||||
gswm = "git switch master";
|
||||
|
||||
gsh = "git show --ext-diff";
|
||||
|
||||
gst = "git status";
|
||||
};
|
||||
})
|
||||
|
||||
(let
|
||||
gitUrl = self.cube.services.forgejo.settings.server.ROOT_URL;
|
||||
gitDomain = head (strings.match "https://(.*)/" gitUrl);
|
||||
|
||||
mailDomain = head self.disk.mailserver.domains;
|
||||
in 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 {
|
||||
$user_and_repo
|
||||
} else {
|
||||
"RGBCube/" + $user_and_repo
|
||||
}
|
||||
|
||||
git remote add origin ("${gitUrl}" + $user_and_repo)
|
||||
}
|
||||
'';
|
||||
|
||||
programs.git = enabled {
|
||||
package = pkgs.gitFull;
|
||||
|
||||
userName = "RGBCube";
|
||||
userEmail = "git@${mailDomain}";
|
||||
|
||||
lfs = enabled;
|
||||
|
||||
difftastic = enabled {
|
||||
background = "dark";
|
||||
};
|
||||
|
||||
extraConfig = merge {
|
||||
init.defaultBranch = "master";
|
||||
|
||||
commit.verbose = true;
|
||||
|
||||
log.date = "iso";
|
||||
column.ui = "auto";
|
||||
|
||||
branch.sort = "-committerdate";
|
||||
tag.sort = "version:refname";
|
||||
|
||||
diff.algorithm = "histogram";
|
||||
diff.colorMoved = "default";
|
||||
|
||||
pull.rebase = true;
|
||||
push.autoSetupRemote = true;
|
||||
|
||||
merge.conflictStyle = "zdiff3";
|
||||
|
||||
rebase.autoSquash = true;
|
||||
rebase.autoStash = true;
|
||||
rebase.updateRefs = true;
|
||||
rerere.enabled = true;
|
||||
|
||||
fetch.fsckObjects = true;
|
||||
receive.fsckObjects = true;
|
||||
transfer.fsckobjects = true;
|
||||
|
||||
# https://bernsteinbear.com/git
|
||||
alias.recent = "! git branch --sort=-committerdate --format=\"%(committerdate:relative)%09%(refname:short)\" | head -10";
|
||||
} (mkIf isDesktop {
|
||||
core.sshCommand = "ssh -i ~/.ssh/id";
|
||||
url."ssh://git@github.com/".insteadOf = "https://github.com/";
|
||||
url."ssh://forgejo@${gitDomain}:${toString (head self.cube.services.openssh.ports)}/".insteadOf = gitUrl;
|
||||
|
||||
commit.gpgSign = true;
|
||||
tag.gpgSign = true;
|
||||
|
||||
gpg.format = "ssh";
|
||||
user.signingKey = "~/.ssh/id";
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
(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";
|
||||
};
|
||||
})
|
||||
|
||||
(systemPackages (with pkgs; [
|
||||
git-absorb
|
||||
tig
|
||||
]))
|
|
@ -1,27 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
programs.dconf = enabled;
|
||||
})
|
||||
|
||||
(desktopUserHomeConfiguration {
|
||||
gtk = enabled {
|
||||
gtk3.extraCss = config.theme.adwaitaGtkCss;
|
||||
gtk4.extraCss = config.theme.adwaitaGtkCss;
|
||||
|
||||
font = with config.theme.font; {
|
||||
inherit (sans) name package;
|
||||
|
||||
size = size.normal;
|
||||
};
|
||||
|
||||
iconTheme = config.theme.icons;
|
||||
|
||||
theme = {
|
||||
name = "Adwaita-dark";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
environment = {
|
||||
variables.EDITOR = "hx";
|
||||
shellAliases.x = "hx";
|
||||
};
|
||||
})
|
||||
|
||||
(homeConfiguration {
|
||||
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
|
||||
denoFormatter = language: {
|
||||
command = "deno";
|
||||
args = [ "fmt" "-" "--ext" language ];
|
||||
};
|
||||
|
||||
denoFormatterLanguages = map (name: {
|
||||
inherit name;
|
||||
|
||||
auto-format = true;
|
||||
formatter = denoFormatter name;
|
||||
}) [ "markdown" "json" ];
|
||||
|
||||
prettier = language: {
|
||||
command = "prettier";
|
||||
args = [ "--parser" language ];
|
||||
};
|
||||
|
||||
prettierLanguages = map (name: {
|
||||
inherit name;
|
||||
|
||||
auto-format = true;
|
||||
formatter = prettier name;
|
||||
}) [ "css" "scss" "yaml" ];
|
||||
in denoFormatterLanguages ++ prettierLanguages ++ [
|
||||
{
|
||||
name = "nix";
|
||||
auto-format = false;
|
||||
formatter.command = "alejandra";
|
||||
}
|
||||
{
|
||||
name = "html";
|
||||
# Added vto.
|
||||
file-types = [ "asp" "aspx" "htm" "html" "jshtm" "jsp" "rhtml" "shtml" "volt" "vto" "xht" "xhtml" ];
|
||||
auto-format = false;
|
||||
formatter = prettier "html";
|
||||
}
|
||||
{
|
||||
name = "javascript";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "js";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
{
|
||||
name = "jsx";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "jsx";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
{
|
||||
name = "typescript";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "ts";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
{
|
||||
name = "tsx";
|
||||
auto-format = true;
|
||||
formatter = denoFormatter "tsx";
|
||||
language-servers = [ "deno" ];
|
||||
}
|
||||
];
|
||||
|
||||
languages.language-server = {
|
||||
deno = {
|
||||
command = "deno";
|
||||
args = [ "lsp" ];
|
||||
|
||||
environment.NO_COLOR = "1";
|
||||
|
||||
config.deno = enabled {
|
||||
lint = true;
|
||||
unstable = true;
|
||||
|
||||
suggest.imports.hosts."https://deno.land" = true;
|
||||
|
||||
inlayHints = {
|
||||
enumMemberValues.enabled = true;
|
||||
functionLikeReturnTypes.enabled = true;
|
||||
parameterNames.enabled = "all";
|
||||
parameterTypes.enabled = true;
|
||||
propertyDeclarationTypes.enabled = true;
|
||||
variableTypes.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rust-analyzer.config.check.command = "clippy";
|
||||
};
|
||||
|
||||
settings.theme = "gruvbox_dark_hard";
|
||||
|
||||
settings.editor = {
|
||||
color-modes = true;
|
||||
completion-replace = true;
|
||||
completion-trigger-len = 0;
|
||||
cursor-shape.insert = "bar";
|
||||
cursorline = true;
|
||||
bufferline = "multiple";
|
||||
file-picker.hidden = false;
|
||||
idle-timeout = 0;
|
||||
line-number = "relative";
|
||||
shell = [ "bash" "-c" ];
|
||||
text-width = 100;
|
||||
};
|
||||
|
||||
settings.editor.indent-guides = {
|
||||
character = "▏";
|
||||
render = true;
|
||||
};
|
||||
|
||||
settings.editor.statusline.mode = {
|
||||
insert = "INSERT";
|
||||
normal = "NORMAL";
|
||||
select = "SELECT";
|
||||
};
|
||||
|
||||
settings.editor.whitespace = {
|
||||
characters.tab = "→";
|
||||
render.tab = "all";
|
||||
};
|
||||
|
||||
settings.keys = genAttrs [ "normal" "select" ] (const {
|
||||
D = "extend_to_line_end";
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
(desktopSystemPackages (with pkgs; [
|
||||
# CMAKE
|
||||
cmake-language-server
|
||||
|
||||
# GO
|
||||
gopls
|
||||
|
||||
# HTML
|
||||
vscode-langservers-extracted
|
||||
nodePackages_latest.prettier
|
||||
|
||||
# KOTLIN
|
||||
# kotlin-language-server
|
||||
|
||||
# LATEX
|
||||
texlab
|
||||
|
||||
# LUA
|
||||
lua-language-server
|
||||
|
||||
# MARKDOWN
|
||||
marksman
|
||||
|
||||
# NIX
|
||||
alejandra
|
||||
nil
|
||||
|
||||
# PYTHON
|
||||
python311Packages.python-lsp-server
|
||||
|
||||
# RUST
|
||||
rust-analyzer-nightly
|
||||
|
||||
# TYPESCRIPT & OTHERS
|
||||
deno
|
||||
|
||||
# YAML
|
||||
yaml-language-server
|
||||
|
||||
# ZIG
|
||||
# zls
|
||||
]))
|
|
@ -1,48 +0,0 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
desktopUserHomeConfiguration {
|
||||
services.dunst = with config.theme.withHashtag; enabled {
|
||||
iconTheme = icons;
|
||||
|
||||
settings.global = {
|
||||
width = "(300, 900)";
|
||||
|
||||
dmenu = "fuzzel --dmenu";
|
||||
|
||||
corner_radius = cornerRadius;
|
||||
gap_size = margin;
|
||||
horizontal_padding = padding;
|
||||
padding = padding;
|
||||
|
||||
frame_color = base0A;
|
||||
frame_width = borderWidth;
|
||||
separator_color = "frame";
|
||||
|
||||
background = base00;
|
||||
foreground = base05;
|
||||
|
||||
alignment = "center";
|
||||
font = "${font.sans.name} ${toString font.size.normal}";
|
||||
|
||||
min_icon_size = 64;
|
||||
|
||||
offset = "0x${toString margin}";
|
||||
origin = "top-center";
|
||||
};
|
||||
|
||||
settings.urgency_low = {
|
||||
frame_color = base0A;
|
||||
timeout = 5;
|
||||
};
|
||||
|
||||
settings.urgency_normal = {
|
||||
frame_color = base09;
|
||||
timeout = 10;
|
||||
};
|
||||
|
||||
settings.urgency_critical = {
|
||||
frame_color = base08;
|
||||
timeout = 15;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
desktopUserHomeConfiguration {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
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
|
||||
'')];
|
||||
|
||||
bind = [
|
||||
"SUPER , SPACE, exec, pkill fuzzel; fuzzel"
|
||||
"SUPER , E , exec, pkill fuzzel; cat ${./emojis.txt} | fuzzel --no-fuzzy --dmenu | cut -d ' ' -f 1 | tr -d '\\n' | wl-copy"
|
||||
"SUPER+ALT, E , exec, pkill fuzzel; cat ${./emojis.txt} | fuzzel --no-fuzzy --dmenu | cut -d ' ' -f 1 | tr -d '\\n' | wtype -"
|
||||
"SUPER , V , exec, pkill fuzzel; cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"
|
||||
];
|
||||
};
|
||||
|
||||
services.cliphist = enabled {
|
||||
extraOptions = [ "-max-items" "1000" ];
|
||||
};
|
||||
|
||||
programs.fuzzel = with config.theme; enabled {
|
||||
settings.main = {
|
||||
dpi-aware = false;
|
||||
font = "${font.sans.name}:size=${toString font.size.big}";
|
||||
icon-theme = icons.name;
|
||||
|
||||
layer = "overlay";
|
||||
prompt = ''"❯ "'';
|
||||
|
||||
terminal = "ghostty -e";
|
||||
|
||||
tabs = 4;
|
||||
|
||||
horizontal-pad = padding;
|
||||
vertical-pad = padding;
|
||||
inner-pad = padding;
|
||||
};
|
||||
|
||||
settings.colors = mapAttrs (const (color: color + "FF")) {
|
||||
background = base00;
|
||||
text = base05;
|
||||
match = base0A;
|
||||
selection = base05;
|
||||
selection-text = base00;
|
||||
border = base0A;
|
||||
};
|
||||
|
||||
settings.border = {
|
||||
radius = cornerRadius;
|
||||
width = borderWidth;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{ lib, ... }: with lib; merge
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
services.geoclue2 = enabled {
|
||||
appConfig.gammstep = {
|
||||
isAllowed = true;
|
||||
isSystem = false;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(desktopUserHomeConfiguration {
|
||||
services.gammastep = enabled {
|
||||
provider = "geoclue2";
|
||||
};
|
||||
})
|
|
@ -1,243 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
hardware.graphics = enabled;
|
||||
|
||||
services.logind.powerKey = "ignore";
|
||||
|
||||
xdg.portal = enabled {
|
||||
config.common.default = "*";
|
||||
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-hyprland
|
||||
];
|
||||
|
||||
configPackages = with pkgs; [
|
||||
hyprland
|
||||
];
|
||||
};
|
||||
|
||||
programs.xwayland = enabled;
|
||||
})
|
||||
|
||||
(desktopUserHomeConfiguration {
|
||||
xdg.configFile."xkb/symbols/tr-swapped-i".text = ''
|
||||
default partial
|
||||
xkb_symbols "basic" {
|
||||
include "tr(basic)"
|
||||
|
||||
name[Group1]="Turkish (i and ı swapped)";
|
||||
|
||||
key <AC11> { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", [ idotless, Iabovedot, paragraph , none ]};
|
||||
key <AD08> { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", [ i , I , apostrophe, dead_caron ]};
|
||||
};
|
||||
'';
|
||||
|
||||
wayland.windowManager.hyprland = enabled {
|
||||
systemd = enabled {
|
||||
enableXdgAutostart = true;
|
||||
};
|
||||
|
||||
# plugins = with pkgs; [ hyprcursors ];
|
||||
|
||||
# settings.plugin.dynamic-cursors = {
|
||||
# mode = "rotate";
|
||||
|
||||
# shake = {
|
||||
# threshold = 3;
|
||||
|
||||
# effects = true;
|
||||
# nearest = false;
|
||||
# };
|
||||
# };
|
||||
|
||||
settings = {
|
||||
monitor = [ ", preferred, auto, 1.5" ];
|
||||
|
||||
windowrule = [ "noinitialfocus" ];
|
||||
windowrulev2 = [ "workspace special silent, initialclass:^(xwaylandvideobridge)$" ];
|
||||
|
||||
exec = [ "pkill swaybg; swaybg --image ${./wallpaper.png}" ];
|
||||
|
||||
bindle = [
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.5"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
|
||||
", XF86MonBrightnessUp , exec, brightnessctl set 5%+"
|
||||
", XF86MonBrightnessDown, exec, brightnessctl set --min-value=0 5%-"
|
||||
|
||||
"SUPER, Prior, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.5"
|
||||
"SUPER, Next , exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
|
||||
"SUPER, Home, exec, brightnessctl set 5%+"
|
||||
"SUPER, End , exec, brightnessctl set --min-value=0 5%-"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
", XF86AudioMute , exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
|
||||
"SUPER+ALT, Insert, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
"SUPER+ALT, Delete, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
"SUPER, mouse:272, movewindow"
|
||||
"SUPER, mouse:274, movewindow"
|
||||
"SUPER, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
binde = [
|
||||
"SUPER, left , movefocus, l"
|
||||
"SUPER, down , movefocus, d"
|
||||
"SUPER, up , movefocus, u"
|
||||
"SUPER, right, movefocus, r"
|
||||
|
||||
"SUPER, h, movefocus, l"
|
||||
"SUPER, j, movefocus, d"
|
||||
"SUPER, k, movefocus, u"
|
||||
"SUPER, l, movefocus, 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"
|
||||
|
||||
"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 = flatten [
|
||||
"SUPER , TAB, workspace, e+1"
|
||||
"SUPER+ALT, TAB, workspace, e-1"
|
||||
|
||||
"SUPER, mouse_up, workspace, e+1"
|
||||
"SUPER, mouse_down, workspace, e-1"
|
||||
|
||||
(map (n: [
|
||||
"SUPER , ${toString n}, workspace , ${toString n}"
|
||||
"SUPER+ALT, ${toString n}, movetoworkspacesilent, ${toString n}"
|
||||
]) (range 1 9))
|
||||
"SUPER , 0, workspace , 10"
|
||||
"SUPER+ALT, 0, movetoworkspacesilent, 10"
|
||||
|
||||
"SUPER+ALT, left , movewindow, l"
|
||||
"SUPER+ALT, down , movewindow, d"
|
||||
"SUPER+ALT, up , movewindow, u"
|
||||
"SUPER+ALT, right, movewindow, r"
|
||||
|
||||
"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"
|
||||
|
||||
"SUPER+ALT, RETURN, exec, kitty"
|
||||
"SUPER , RETURN, exec, ghostty --gtk-single-instance=true"
|
||||
"SUPER , W , exec, firefox"
|
||||
"SUPER , D , exec, discord"
|
||||
"SUPER , Z , exec, zulip"
|
||||
"SUPER , M , exec, thunderbird"
|
||||
"SUPER , T , exec, thunar"
|
||||
# "SUPER , C , exec, hyprpicker --autocopy"
|
||||
|
||||
" , 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"
|
||||
];
|
||||
|
||||
general = with config.theme; {
|
||||
gaps_in = margin / 2;
|
||||
gaps_out = margin;
|
||||
border_size = borderWidth;
|
||||
|
||||
"col.active_border" = "0xFF${base0A}";
|
||||
"col.nogroup_border_active" = "0xFF${base0A}";
|
||||
|
||||
"col.inactive_border" = "0xFF${base01}";
|
||||
"col.nogroup_border" = "0xFF${base01}";
|
||||
|
||||
resize_on_border = true;
|
||||
};
|
||||
|
||||
decoration = {
|
||||
drop_shadow = false;
|
||||
rounding = config.theme.cornerRadius;
|
||||
|
||||
blur.enabled = false;
|
||||
};
|
||||
|
||||
input = {
|
||||
follow_mouse = 1;
|
||||
|
||||
kb_layout = "tr-swapped-i";
|
||||
|
||||
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, 2, material_decelerate"
|
||||
"fade , 1, 2, material_decelerate"
|
||||
"layers , 1, 2, material_decelerate"
|
||||
"windows , 1, 2, material_decelerate, popin 80%"
|
||||
"workspaces, 1, 2, material_decelerate"
|
||||
];
|
||||
};
|
||||
|
||||
misc = {
|
||||
animate_manual_resizes = true;
|
||||
|
||||
background_color = config.theme.with0x.base00;
|
||||
disable_hyprland_logo = true;
|
||||
disable_splash_rendering = true;
|
||||
|
||||
key_press_enables_dpms = true;
|
||||
mouse_move_enables_dpms = true;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
hide_on_key_press = true;
|
||||
inactive_timeout = 10;
|
||||
no_warps = true;
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
preserve_split = true;
|
||||
smart_resizing = false;
|
||||
};
|
||||
|
||||
debug.error_position = 1;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(desktopUserHomePackages (with pkgs; [
|
||||
brightnessctl
|
||||
grim
|
||||
# hyprpicker
|
||||
slurp
|
||||
swappy
|
||||
swaybg
|
||||
wl-clipboard
|
||||
wtype
|
||||
xdg-utils
|
||||
xwaylandvideobridge
|
||||
]))
|
Binary file not shown.
Before Width: | Height: | Size: 148 KiB |
|
@ -1,142 +0,0 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
desktopUserHomeConfiguration {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec = [ "pkill --signal SIGUSR2 waybar" ];
|
||||
bind = [ "SUPER, B, exec, pkill --signal SIGUSR1 waybar" ];
|
||||
};
|
||||
|
||||
programs.waybar = with config.theme.withHashtag; enabled {
|
||||
systemd = enabled;
|
||||
|
||||
settings = [{
|
||||
layer = "top";
|
||||
height = 2 * cornerRadius;
|
||||
|
||||
margin-right = margin;
|
||||
margin-left = margin;
|
||||
margin-top = margin;
|
||||
|
||||
modules-left = [ "hyprland/workspaces" ];
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons.default = "";
|
||||
format-icons.active = "";
|
||||
|
||||
persistent-workspaces."*" = 10;
|
||||
};
|
||||
|
||||
modules-center = [
|
||||
"hyprland/window"
|
||||
];
|
||||
|
||||
"hyprland/window" = {
|
||||
seperate-outputs = true;
|
||||
|
||||
rewrite."(.*) - Discord" = " $1";
|
||||
rewrite."(.*) — Mozilla Firefox" = " $1";
|
||||
rewrite."(.*) — nu" = " $1";
|
||||
};
|
||||
|
||||
modules-right = [ "tray" "pulseaudio" "backlight" "cpu" "memory" "network" "battery" "clock" ];
|
||||
|
||||
tray = {
|
||||
reverse-direction = true;
|
||||
spacing = 5;
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
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-icons.default = [ "" "" "" ];
|
||||
};
|
||||
|
||||
backlight = {
|
||||
format = "{icon} {percent}%";
|
||||
format-icons = [ "" "" "" "" "" "" "" "" "" ];
|
||||
};
|
||||
|
||||
cpu.format = " {usage}%";
|
||||
memory.format = " {}%";
|
||||
|
||||
network = {
|
||||
format-disconnected = " ";
|
||||
format-ethernet = " {ipaddr}/{cidr}";
|
||||
format-linked = " {ifname} (No IP)";
|
||||
format-wifi = " {signalStrength}%";
|
||||
};
|
||||
|
||||
battery = {
|
||||
format = "{icon} {capacity}%";
|
||||
format-charging = " {capacity}%";
|
||||
format-plugged = " {capacity}%";
|
||||
|
||||
format-icons = [ "" "" "" "" "" "" "" "" "" "" ];
|
||||
|
||||
states.warning = 30;
|
||||
states.critical = 15;
|
||||
};
|
||||
|
||||
clock.tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
}];
|
||||
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: ${toString cornerRadius}px;
|
||||
font-family: "${font.sans.name}";
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin-right: ${toString padding}px;
|
||||
}
|
||||
|
||||
#waybar {
|
||||
background: ${base00};
|
||||
color: ${base05};
|
||||
}
|
||||
|
||||
#workspaces button:nth-child(1) { color: ${base08}; }
|
||||
#workspaces button:nth-child(2) { color: ${base09}; }
|
||||
#workspaces button:nth-child(3) { color: ${base0A}; }
|
||||
#workspaces button:nth-child(4) { color: ${base0B}; }
|
||||
#workspaces button:nth-child(5) { color: ${base0C}; }
|
||||
#workspaces button:nth-child(6) { color: ${base0D}; }
|
||||
#workspaces button:nth-child(7) { color: ${base0E}; }
|
||||
#workspaces button:nth-child(8) { color: ${base0F}; }
|
||||
#workspaces button:nth-child(9) { color: ${base04}; }
|
||||
#workspaces button:nth-child(10) { color: ${base06}; }
|
||||
|
||||
#workspaces button.empty {
|
||||
color: ${base02};
|
||||
}
|
||||
|
||||
#tray, #pulseaudio, #backlight, #cpu, #memory, #network, #battery, #clock {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
color: ${base05};
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
animation-direction: alternate;
|
||||
animation-duration: 0.5s;
|
||||
animation-iteration-count: infinite;
|
||||
animation-name: blink;
|
||||
animation-timing-function: linear;
|
||||
color: ${base08};
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
desktopUserHomeConfiguration {
|
||||
programs.kitty = with config.theme.withHashtag; enabled {
|
||||
font = with font; {
|
||||
inherit (mono) name package;
|
||||
|
||||
size = size.normal;
|
||||
};
|
||||
|
||||
settings = {
|
||||
allow_remote_control = true;
|
||||
confirm_os_window_close = 0;
|
||||
focus_follows_mouse = true;
|
||||
mouse_hide_wait = 0;
|
||||
window_padding_width = padding;
|
||||
|
||||
scrollback_lines = 100000;
|
||||
scrollback_pager = "bat --chop-long-lines";
|
||||
|
||||
cursor = base05;
|
||||
cursor_text_color = base00;
|
||||
cursor_shape = "beam";
|
||||
|
||||
url_color = base0D;
|
||||
|
||||
strip_trailing_spaces = "always";
|
||||
|
||||
enable_audio_bell = false;
|
||||
|
||||
active_border_color = base0A;
|
||||
inactive_border_color = base01;
|
||||
window_border_width = "0pt";
|
||||
|
||||
background = base00;
|
||||
foreground = base05;
|
||||
|
||||
selection_background = base02;
|
||||
selection_foreground = base00;
|
||||
|
||||
tab_bar_edge = "top";
|
||||
tab_bar_style = "powerline";
|
||||
|
||||
active_tab_background = base00;
|
||||
active_tab_foreground = base05;
|
||||
|
||||
inactive_tab_background = base01;
|
||||
inactive_tab_foreground = base05;
|
||||
|
||||
color0 = base00;
|
||||
color1 = base08;
|
||||
color2 = base0B;
|
||||
color3 = base0A;
|
||||
color4 = base0D;
|
||||
color5 = base0E;
|
||||
color6 = base0C;
|
||||
color7 = base05;
|
||||
color8 = base03;
|
||||
color9 = base08;
|
||||
color10 = base0B;
|
||||
color11 = base0A;
|
||||
color12 = base0D;
|
||||
color13 = base0E;
|
||||
color14 = base0C;
|
||||
color15 = base07;
|
||||
color16 = base09;
|
||||
color17 = base0F;
|
||||
color18 = base01;
|
||||
color19 = base02;
|
||||
color20 = base04;
|
||||
color21 = base06;
|
||||
};
|
||||
};
|
||||
}
|
7
modules/linux/crash.nix
Normal file
7
modules/linux/crash.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) getExe;
|
||||
in {
|
||||
environment.sessionVariables.SHELLS = getExe config.environment.sessionVariables.SHELL;
|
||||
|
||||
users.defaultUserShell = pkgs.crash;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
{ lib, ... }: let
|
||||
inherit (lib) enabled disabled;
|
||||
in {
|
||||
documentation = {
|
||||
doc = disabled;
|
||||
info = disabled;
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
{ config, lib, ... }: let
|
||||
inherit (lib) remove;
|
||||
in {
|
||||
boot.binfmt.emulatedSystems = remove config.nixpkgs.hostPlatform.system [
|
||||
"aarch64-linux"
|
||||
"riscv64-linux"
|
50
modules/linux/endlessh-go.nix
Normal file
50
modules/linux/endlessh-go.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled merge mkEnableOption mkIf mkOption types;
|
||||
|
||||
fakeSSHPort = 22;
|
||||
in merge <| mkIf config.isServer {
|
||||
config.services.prometheus.exporters.endlessh-go = enabled {
|
||||
listenAddress = "[::]";
|
||||
};
|
||||
|
||||
# `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.
|
||||
config.networking.firewall.allowedTCPPorts = [ fakeSSHPort ];
|
||||
|
||||
config.services.endlessh-go = enabled {
|
||||
listenAddress = "[::]";
|
||||
port = fakeSSHPort;
|
||||
|
||||
extraOptions = [
|
||||
"-alsologtostderr"
|
||||
"-geoip_supplier max-mind-db"
|
||||
"-max_mind_db ${pkgs.clash-geoip}/etc/clash/Country.mmdb"
|
||||
];
|
||||
|
||||
prometheus = config.services.prometheus.exporters.endlessh-go;
|
||||
};
|
||||
|
||||
# And yes, I've tried lib.mkAliasOptionModule.
|
||||
# It doesn't work for a mysterious reason,
|
||||
# says it can't find `services.prometheus.exporters.endlessh-go`.
|
||||
#
|
||||
# This works, however.
|
||||
#
|
||||
# TODO: I may be stupid, because the above note says that I tried
|
||||
# to alias to a nonexistent option, rather than the other way around.
|
||||
# Let's try mkAliasOptionModule again later.
|
||||
options.services.prometheus.exporters.endlessh-go = {
|
||||
enable = mkEnableOption "Prometheus integration";
|
||||
|
||||
listenAddress = mkOption {
|
||||
type = types.str;
|
||||
default = "0.0.0.0";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 2112;
|
||||
};
|
||||
};
|
||||
}
|
28
modules/linux/firefox.nix
Normal file
28
modules/linux/firefox.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedModules = [{
|
||||
programs.firefox = enabled {
|
||||
profiles.default = {
|
||||
settings = with config.theme.font; {
|
||||
"general.autoScroll" = true;
|
||||
"privacy.donottrackheader.enabled" = true;
|
||||
|
||||
"browser.fixup.domainsuffixwhitelist.idk" = true;
|
||||
|
||||
"font.name.serif.x-western" = sans.name;
|
||||
"font.size.variable.x-western" = builtins.ceil (1.3 * size.normal);
|
||||
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
|
||||
userChrome = ''
|
||||
#TabsToolbar {
|
||||
visibility: collapse;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
||||
|
|
@ -1,14 +1,15 @@
|
|||
{ config, lib, pkgs, ... }: with lib; merge
|
||||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) disabled merge mkIf;
|
||||
in merge
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
(mkIf config.isDesktop {
|
||||
console = {
|
||||
earlySetup = true;
|
||||
font = "Lat2-Terminus16";
|
||||
packages = with pkgs; [ terminus_font ];
|
||||
packages = [ pkgs.terminus_font ];
|
||||
};
|
||||
})
|
||||
|
||||
(desktopSystemFonts [
|
||||
fonts.packages = [
|
||||
config.theme.font.sans.package
|
||||
config.theme.font.mono.package
|
||||
|
||||
|
@ -16,8 +17,9 @@
|
|||
pkgs.noto-fonts-cjk-sans
|
||||
pkgs.noto-fonts-lgc-plus
|
||||
pkgs.noto-fonts-emoji
|
||||
])
|
||||
];
|
||||
})
|
||||
|
||||
(serverSystemConfiguration {
|
||||
(mkIf config.isServer {
|
||||
fonts.fontconfig = disabled;
|
||||
})
|
26
modules/linux/gtk.nix
Normal file
26
modules/linux/gtk.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled mkIf merge;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
programs.dconf = enabled;
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
gtk = enabled {
|
||||
gtk3.extraCss = config.theme.adwaitaGtkCss;
|
||||
gtk4.extraCss = config.theme.adwaitaGtkCss;
|
||||
|
||||
font = with config.theme.font; {
|
||||
inherit (sans) name package;
|
||||
|
||||
size = size.normal;
|
||||
};
|
||||
|
||||
iconTheme = config.theme.icons;
|
||||
|
||||
theme = {
|
||||
name = "Adwaita-dark";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
||||
|
50
modules/linux/hyprland/dunst.nix
Normal file
50
modules/linux/hyprland/dunst.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedModules = [{
|
||||
services.dunst = with config.theme.withHashtag; enabled {
|
||||
iconTheme = icons;
|
||||
|
||||
settings.global = {
|
||||
width = "(300, 900)";
|
||||
|
||||
dmenu = "fuzzel --dmenu";
|
||||
|
||||
corner_radius = cornerRadius;
|
||||
gap_size = margin;
|
||||
horizontal_padding = padding;
|
||||
padding = padding;
|
||||
|
||||
frame_color = base0A;
|
||||
frame_width = borderWidth;
|
||||
separator_color = "frame";
|
||||
|
||||
background = base00;
|
||||
foreground = base05;
|
||||
|
||||
alignment = "center";
|
||||
font = "${font.sans.name} ${toString font.size.normal}";
|
||||
|
||||
min_icon_size = 64;
|
||||
|
||||
offset = "0x${toString margin}";
|
||||
origin = "top-center";
|
||||
};
|
||||
|
||||
settings.urgency_low = {
|
||||
frame_color = base0A;
|
||||
timeout = 5;
|
||||
};
|
||||
|
||||
settings.urgency_normal = {
|
||||
frame_color = base09;
|
||||
timeout = 10;
|
||||
};
|
||||
|
||||
settings.urgency_critical = {
|
||||
frame_color = base08;
|
||||
timeout = 15;
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
61
modules/linux/hyprland/fuzzel.nix
Normal file
61
modules/linux/hyprland/fuzzel.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled mapAttrs merge mkIf replaceStrings;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedNodules = [{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
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
|
||||
'')];
|
||||
|
||||
bind = [
|
||||
"SUPER , SPACE, exec, pkill fuzzel; fuzzel"
|
||||
"SUPER , E , exec, pkill fuzzel; cat ${./emojis.txt} | fuzzel --no-fuzzy --dmenu | cut -d ' ' -f 1 | tr -d '\\n' | wl-copy"
|
||||
"SUPER+ALT, E , exec, pkill fuzzel; cat ${./emojis.txt} | fuzzel --no-fuzzy --dmenu | cut -d ' ' -f 1 | tr -d '\\n' | wtype -"
|
||||
"SUPER , V , exec, pkill fuzzel; cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"
|
||||
];
|
||||
};
|
||||
|
||||
services.cliphist = enabled {
|
||||
extraOptions = [ "-max-items" "1000" ];
|
||||
};
|
||||
|
||||
programs.fuzzel = with config.theme; enabled {
|
||||
settings.main = {
|
||||
dpi-aware = false;
|
||||
font = "${font.sans.name}:size=${toString font.size.big}";
|
||||
icon-theme = icons.name;
|
||||
|
||||
layer = "overlay";
|
||||
prompt = ''"❯ "'';
|
||||
|
||||
terminal = "ghostty -e";
|
||||
|
||||
tabs = 4;
|
||||
|
||||
horizontal-pad = padding;
|
||||
vertical-pad = padding;
|
||||
inner-pad = padding;
|
||||
};
|
||||
|
||||
settings.colors = mapAttrs (_: color: color + "FF") {
|
||||
background = base00;
|
||||
text = base05;
|
||||
match = base0A;
|
||||
selection = base05;
|
||||
selection-text = base00;
|
||||
border = base0A;
|
||||
};
|
||||
|
||||
settings.border = {
|
||||
radius = cornerRadius;
|
||||
width = borderWidth;
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
16
modules/linux/hyprland/gammastep.nix
Normal file
16
modules/linux/hyprland/gammastep.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
services.geoclue2 = enabled {
|
||||
appConfig.gammstep = {
|
||||
isAllowed = true;
|
||||
isSystem = false;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
services.gammastep = enabled {
|
||||
provider = "geoclue2";
|
||||
};
|
||||
}];
|
||||
}
|
243
modules/linux/hyprland/hyprland.nix
Normal file
243
modules/linux/hyprland/hyprland.nix
Normal file
|
@ -0,0 +1,243 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled merge mkIf flatten range;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
hardware.graphics = enabled;
|
||||
|
||||
services.logind.powerKey = "ignore";
|
||||
|
||||
xdg.portal = enabled {
|
||||
config.common.default = "*";
|
||||
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-hyprland
|
||||
];
|
||||
|
||||
configPackages = with pkgs; [
|
||||
hyprland
|
||||
];
|
||||
};
|
||||
|
||||
programs.xwayland = enabled;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.brightnessctl
|
||||
pkgs.grim
|
||||
# pkgs.hyprpicker
|
||||
pkgs.slurp
|
||||
pkgs.swappy
|
||||
pkgs.swaybg
|
||||
pkgs.wl-clipboard
|
||||
pkgs.wtype
|
||||
pkgs.xdg-utils
|
||||
pkgs.xwaylandvideobridge
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
xdg.configFile."xkb/symbols/tr-swapped-i".text = ''
|
||||
default partial
|
||||
xkb_symbols "basic" {
|
||||
include "tr(basic)"
|
||||
|
||||
name[Group1]="Turkish (i and ı swapped)";
|
||||
|
||||
key <AC11> { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", [ idotless, Iabovedot, paragraph , none ]};
|
||||
key <AD08> { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", [ i , I , apostrophe, dead_caron ]};
|
||||
};
|
||||
'';
|
||||
|
||||
wayland.windowManager.hyprland = enabled {
|
||||
systemd = enabled {
|
||||
enableXdgAutostart = true;
|
||||
};
|
||||
|
||||
# plugins = with pkgs; [ hyprcursors ];
|
||||
|
||||
# settings.plugin.dynamic-cursors = {
|
||||
# mode = "rotate";
|
||||
|
||||
# shake = {
|
||||
# threshold = 3;
|
||||
|
||||
# effects = true;
|
||||
# nearest = false;
|
||||
# };
|
||||
# };
|
||||
|
||||
settings = {
|
||||
monitor = [ ", preferred, auto, 1.5" ];
|
||||
|
||||
windowrule = [ "noinitialfocus" ];
|
||||
windowrulev2 = [ "workspace special silent, initialclass:^(xwaylandvideobridge)$" ];
|
||||
|
||||
exec = [ "pkill swaybg; swaybg --image ${./wallpaper.png}" ];
|
||||
|
||||
bindle = [
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.5"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
|
||||
", XF86MonBrightnessUp , exec, brightnessctl set 5%+"
|
||||
", XF86MonBrightnessDown, exec, brightnessctl set --min-value=0 5%-"
|
||||
|
||||
"SUPER, Prior, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.5"
|
||||
"SUPER, Next , exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
|
||||
"SUPER, Home, exec, brightnessctl set 5%+"
|
||||
"SUPER, End , exec, brightnessctl set --min-value=0 5%-"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
", XF86AudioMute , exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
|
||||
"SUPER+ALT, Insert, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
"SUPER+ALT, Delete, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
"SUPER, mouse:272, movewindow"
|
||||
"SUPER, mouse:274, movewindow"
|
||||
"SUPER, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
binde = [
|
||||
"SUPER, left , movefocus, l"
|
||||
"SUPER, down , movefocus, d"
|
||||
"SUPER, up , movefocus, u"
|
||||
"SUPER, right, movefocus, r"
|
||||
|
||||
"SUPER, h, movefocus, l"
|
||||
"SUPER, j, movefocus, d"
|
||||
"SUPER, k, movefocus, u"
|
||||
"SUPER, l, movefocus, 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"
|
||||
|
||||
"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 = flatten [
|
||||
"SUPER , TAB, workspace, e+1"
|
||||
"SUPER+ALT, TAB, workspace, e-1"
|
||||
|
||||
"SUPER, mouse_up, workspace, e+1"
|
||||
"SUPER, mouse_down, workspace, e-1"
|
||||
|
||||
(map (n: [
|
||||
"SUPER , ${toString n}, workspace , ${toString n}"
|
||||
"SUPER+ALT, ${toString n}, movetoworkspacesilent, ${toString n}"
|
||||
]) <| range 1 9)
|
||||
"SUPER , 0, workspace , 10"
|
||||
"SUPER+ALT, 0, movetoworkspacesilent, 10"
|
||||
|
||||
"SUPER+ALT, left , movewindow, l"
|
||||
"SUPER+ALT, down , movewindow, d"
|
||||
"SUPER+ALT, up , movewindow, u"
|
||||
"SUPER+ALT, right, movewindow, r"
|
||||
|
||||
"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"
|
||||
|
||||
"SUPER+ALT, RETURN, exec, kitty"
|
||||
"SUPER , RETURN, exec, ghostty --gtk-single-instance=true"
|
||||
"SUPER , W , exec, firefox"
|
||||
"SUPER , D , exec, discord"
|
||||
"SUPER , Z , exec, zulip"
|
||||
"SUPER , M , exec, thunderbird"
|
||||
"SUPER , T , exec, thunar"
|
||||
# "SUPER , C , exec, hyprpicker --autocopy"
|
||||
|
||||
" , 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"
|
||||
];
|
||||
|
||||
general = with config.theme; {
|
||||
gaps_in = margin / 2;
|
||||
gaps_out = margin;
|
||||
border_size = borderWidth;
|
||||
|
||||
"col.active_border" = "0xFF${base0A}";
|
||||
"col.nogroup_border_active" = "0xFF${base0A}";
|
||||
|
||||
"col.inactive_border" = "0xFF${base01}";
|
||||
"col.nogroup_border" = "0xFF${base01}";
|
||||
|
||||
resize_on_border = true;
|
||||
};
|
||||
|
||||
decoration = {
|
||||
drop_shadow = false;
|
||||
rounding = config.theme.cornerRadius;
|
||||
|
||||
blur.enabled = false;
|
||||
};
|
||||
|
||||
input = {
|
||||
follow_mouse = 1;
|
||||
|
||||
kb_layout = "tr-swapped-i";
|
||||
|
||||
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, 2, material_decelerate"
|
||||
"fade , 1, 2, material_decelerate"
|
||||
"layers , 1, 2, material_decelerate"
|
||||
"windows , 1, 2, material_decelerate, popin 80%"
|
||||
"workspaces, 1, 2, material_decelerate"
|
||||
];
|
||||
};
|
||||
|
||||
misc = {
|
||||
animate_manual_resizes = true;
|
||||
|
||||
background_color = config.theme.with0x.base00;
|
||||
disable_hyprland_logo = true;
|
||||
disable_splash_rendering = true;
|
||||
|
||||
key_press_enables_dpms = true;
|
||||
mouse_move_enables_dpms = true;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
hide_on_key_press = true;
|
||||
inactive_timeout = 10;
|
||||
no_warps = true;
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
preserve_split = true;
|
||||
smart_resizing = false;
|
||||
};
|
||||
|
||||
debug.error_position = 1;
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
144
modules/linux/hyprland/waybar.nix
Normal file
144
modules/linux/hyprland/waybar.nix
Normal file
|
@ -0,0 +1,144 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedModules = [{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec = [ "pkill --signal SIGUSR2 waybar" ];
|
||||
bind = [ "SUPER, B, exec, pkill --signal SIGUSR1 waybar" ];
|
||||
};
|
||||
|
||||
programs.waybar = with config.theme.withHashtag; enabled {
|
||||
systemd = enabled;
|
||||
|
||||
settings = [{
|
||||
layer = "top";
|
||||
height = 2 * cornerRadius;
|
||||
|
||||
margin-right = margin;
|
||||
margin-left = margin;
|
||||
margin-top = margin;
|
||||
|
||||
modules-left = [ "hyprland/workspaces" ];
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons.default = "";
|
||||
format-icons.active = "";
|
||||
|
||||
persistent-workspaces."*" = 10;
|
||||
};
|
||||
|
||||
modules-center = [
|
||||
"hyprland/window"
|
||||
];
|
||||
|
||||
"hyprland/window" = {
|
||||
separate-outputs = true;
|
||||
|
||||
rewrite."(.*) - Discord" = " $1";
|
||||
rewrite."(.*) — Mozilla Firefox" = " $1";
|
||||
rewrite."(.*) — nu" = " $1";
|
||||
};
|
||||
|
||||
modules-right = [ "tray" "pulseaudio" "backlight" "cpu" "memory" "network" "battery" "clock" ];
|
||||
|
||||
tray = {
|
||||
reverse-direction = true;
|
||||
spacing = 5;
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
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-icons.default = [ "" "" "" ];
|
||||
};
|
||||
|
||||
backlight = {
|
||||
format = "{icon} {percent}%";
|
||||
format-icons = [ "" "" "" "" "" "" "" "" "" ];
|
||||
};
|
||||
|
||||
cpu.format = " {usage}%";
|
||||
memory.format = " {}%";
|
||||
|
||||
network = {
|
||||
format-disconnected = " ";
|
||||
format-ethernet = " {ipaddr}/{cidr}";
|
||||
format-linked = " {ifname} (No IP)";
|
||||
format-wifi = " {signalStrength}%";
|
||||
};
|
||||
|
||||
battery = {
|
||||
format = "{icon} {capacity}%";
|
||||
format-charging = " {capacity}%";
|
||||
format-plugged = " {capacity}%";
|
||||
|
||||
format-icons = [ "" "" "" "" "" "" "" "" "" "" ];
|
||||
|
||||
states.warning = 30;
|
||||
states.critical = 15;
|
||||
};
|
||||
|
||||
clock.tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
}];
|
||||
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: ${toString cornerRadius}px;
|
||||
font-family: "${font.sans.name}";
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin-right: ${toString padding}px;
|
||||
}
|
||||
|
||||
#waybar {
|
||||
background: ${base00};
|
||||
color: ${base05};
|
||||
}
|
||||
|
||||
#workspaces button:nth-child(1) { color: ${base08}; }
|
||||
#workspaces button:nth-child(2) { color: ${base09}; }
|
||||
#workspaces button:nth-child(3) { color: ${base0A}; }
|
||||
#workspaces button:nth-child(4) { color: ${base0B}; }
|
||||
#workspaces button:nth-child(5) { color: ${base0C}; }
|
||||
#workspaces button:nth-child(6) { color: ${base0D}; }
|
||||
#workspaces button:nth-child(7) { color: ${base0E}; }
|
||||
#workspaces button:nth-child(8) { color: ${base0F}; }
|
||||
#workspaces button:nth-child(9) { color: ${base04}; }
|
||||
#workspaces button:nth-child(10) { color: ${base06}; }
|
||||
|
||||
#workspaces button.empty {
|
||||
color: ${base02};
|
||||
}
|
||||
|
||||
#tray, #pulseaudio, #backlight, #cpu, #memory, #network, #battery, #clock {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
color: ${base05};
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
animation-direction: alternate;
|
||||
animation-duration: 0.5s;
|
||||
animation-iteration-count: infinite;
|
||||
animation-name: blink;
|
||||
animation-timing-function: linear;
|
||||
color: ${base08};
|
||||
}
|
||||
'';
|
||||
};
|
||||
}];
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
{ lib, pkgs, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
{ pkgs, ... }: {
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Credits:
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
desktopSystemConfiguration {
|
||||
{ lib, ... }: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
programs.seahorse = enabled;
|
||||
|
||||
security.pam.services.login.enableGnomeKeyring = true;
|
76
modules/linux/kitty.nix
Normal file
76
modules/linux/kitty.nix
Normal file
|
@ -0,0 +1,76 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedModules = [{
|
||||
programs.kitty = with config.theme.withHashtag; enabled {
|
||||
font = with font; {
|
||||
inherit (mono) name package;
|
||||
|
||||
size = size.normal;
|
||||
};
|
||||
|
||||
settings = {
|
||||
allow_remote_control = true;
|
||||
confirm_os_window_close = 0;
|
||||
focus_follows_mouse = true;
|
||||
mouse_hide_wait = 0;
|
||||
window_padding_width = padding;
|
||||
|
||||
scrollback_lines = 100000;
|
||||
scrollback_pager = "bat --chop-long-lines";
|
||||
|
||||
cursor = base05;
|
||||
cursor_text_color = base00;
|
||||
cursor_shape = "beam";
|
||||
|
||||
url_color = base0D;
|
||||
|
||||
strip_trailing_spaces = "always";
|
||||
|
||||
enable_audio_bell = false;
|
||||
|
||||
active_border_color = base0A;
|
||||
inactive_border_color = base01;
|
||||
window_border_width = "0pt";
|
||||
|
||||
background = base00;
|
||||
foreground = base05;
|
||||
|
||||
selection_background = base02;
|
||||
selection_foreground = base00;
|
||||
|
||||
tab_bar_edge = "top";
|
||||
tab_bar_style = "powerline";
|
||||
|
||||
active_tab_background = base00;
|
||||
active_tab_foreground = base05;
|
||||
|
||||
inactive_tab_background = base01;
|
||||
inactive_tab_foreground = base05;
|
||||
|
||||
color0 = base00;
|
||||
color1 = base08;
|
||||
color2 = base0B;
|
||||
color3 = base0A;
|
||||
color4 = base0D;
|
||||
color5 = base0E;
|
||||
color6 = base0C;
|
||||
color7 = base05;
|
||||
color8 = base03;
|
||||
color9 = base08;
|
||||
color10 = base0B;
|
||||
color11 = base0A;
|
||||
color12 = base0D;
|
||||
color13 = base0E;
|
||||
color14 = base0C;
|
||||
color15 = base07;
|
||||
color16 = base09;
|
||||
color17 = base0F;
|
||||
color18 = base01;
|
||||
color19 = base02;
|
||||
color20 = base04;
|
||||
color21 = base06;
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) const genAttrs merge mkIf;
|
||||
in merge {
|
||||
console.keyMap = pkgs.writeText "trq-swapped-i.map" ''
|
||||
include "${pkgs.kbd}/share/keymaps/i386/qwerty/trq.map"
|
||||
|
||||
|
@ -12,9 +12,7 @@
|
|||
'';
|
||||
|
||||
i18n.defaultLocale = "C.UTF-8";
|
||||
})
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
} <| mkIf config.isDesktop {
|
||||
i18n.extraLocaleSettings = genAttrs [
|
||||
"LC_ADDRESS"
|
||||
"LC_IDENTIFICATION"
|
||||
|
@ -25,5 +23,6 @@
|
|||
"LC_PAPER"
|
||||
"LC_TELEPHONE"
|
||||
"LC_TIME"
|
||||
] (const "tr_TR.UTF-8");
|
||||
})
|
||||
] <| const "tr_TR.UTF-8";
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
{ lib, ... }: let
|
||||
inherit (lib) disabled;
|
||||
in {
|
||||
environment.defaultPackages = [];
|
||||
|
||||
programs.nano = disabled; # Garbage.
|
12
modules/linux/network-manager.nix
Normal file
12
modules/linux/network-manager.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) attrNames const enabled filterAttrs getAttr;
|
||||
in {
|
||||
networking.networkmanager = enabled;
|
||||
|
||||
users.extraGroups.networkmanager.members = config.users.users
|
||||
|> filterAttrs (const <| getAttr "isNormalUser")
|
||||
|> attrNames;
|
||||
|
||||
environment.shellAliases.wifi = "nmcli dev wifi show-password";
|
||||
}
|
||||
|
5
modules/linux/nix-ld.nix
Normal file
5
modules/linux/nix-ld.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ lib, ... }: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
programs.nix-ld = enabled;
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
serverSystemConfiguration {
|
||||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isServer {
|
||||
services.prometheus.exporters.node = enabled {
|
||||
enabledCollectors = [ "processes" "systemd" ];
|
||||
listenAddress = "[::]";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
desktopSystemConfiguration {
|
||||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
security.rtkit = enabled;
|
||||
|
||||
services.pipewire = enabled {
|
||||
|
@ -8,3 +8,4 @@ desktopSystemConfiguration {
|
|||
pulse = enabled;
|
||||
};
|
||||
}
|
||||
|
10
modules/linux/qt.nix
Normal file
10
modules/linux/qt.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
home-manager.sharedModules = [{
|
||||
qt = enabled {
|
||||
platformTheme.name = "adwaita";
|
||||
style.name = "adwaita";
|
||||
};
|
||||
}];
|
||||
}
|
14
modules/linux/resolved.nix
Normal file
14
modules/linux/resolved.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled concatStringsSep map;
|
||||
in {
|
||||
services.resolved = enabled {
|
||||
dnssec = "true";
|
||||
dnsovertls = "true";
|
||||
|
||||
extraConfig = config.dnsServers
|
||||
|> map (server: "DNS=${server}")
|
||||
|> concatStringsSep "\n";
|
||||
|
||||
fallbackDns = config.fallbackDnsServers;
|
||||
};
|
||||
}
|
20
modules/linux/restic/default.nix
Normal file
20
modules/linux/restic/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) genAttrs merge mkConst mkIf remove;
|
||||
in merge <| mkIf config.isServer {
|
||||
options.resticHosts = mkConst <| remove config.networking.hostName [ "cube" "disk" "nine" ];
|
||||
|
||||
config.secrets.resticPassword.file = ./password.age;
|
||||
|
||||
config.services.restic.backups = genAttrs config.resticHosts (host: {
|
||||
repository = "sftp:backup@${host}:${config.networking.hostName}-backup";
|
||||
passwordFile = config.secrets.resticPassword.path;
|
||||
initialize = true;
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
});
|
||||
}
|
||||
|
11
modules/linux/restic/password.age
Normal file
11
modules/linux/restic/password.age
Normal file
|
@ -0,0 +1,11 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 +rZ0Tw 06oZk46oR6ELo5J27k6yawjranT3zRItKK+rl0P9bgk
|
||||
Zl9FaZ0zz7X+NNa8YZ7mF+I3NM6uIQ4OyOxHCC7tG0s
|
||||
-> ssh-ed25519 spFFQA lNlbKPxx4NolZih3OdSW+Om6LfLzQGPcOateTm7PmjE
|
||||
faPPdpWeJytmEGMCfNiup4hE/wjwAp9hdFBRR9PJ7JE
|
||||
-> ssh-ed25519 dASlBQ 0hpF2NYQrE8k0yQWjecxaEmxPswUfqjr/isjwcuRbio
|
||||
zy5tvK0/6WaxzOOzmhRdMIdWeMyE0YYvRI+UAx4sW1c
|
||||
-> ssh-ed25519 CzqbPQ VuaclNfcFIo7wIFauMBcy4amv4QDMUwmWevaCaMICxg
|
||||
JpO3lbn95Hfhqi7x2SRUSzVHQ7tS/Ay9Gn+mFhQpKbE
|
||||
--- iuP1ypvDk453T8/jiyTnWRnVpKZ89yLdWbrMJubNwq8
|
||||
›nßÞâæ ìQ’š)p›Õº1 Cbn)Tœ™<C593>íÿa±öO^VLšßç}„4@QÓ
|
18
modules/linux/sshd.nix
Normal file
18
modules/linux/sshd.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ lib, ...}: let
|
||||
inherit (lib) enabled;
|
||||
port = 2222;
|
||||
in {
|
||||
programs.mosh = enabled {
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.openssh = enabled {
|
||||
ports = [ port ];
|
||||
settings = {
|
||||
KbdInteractiveAuthentication = false;
|
||||
PasswordAuthentication = false;
|
||||
|
||||
AcceptEnv = "SHELLS COLORTERM";
|
||||
};
|
||||
};
|
||||
}
|
8
modules/linux/steam.nix
Normal file
8
modules/linux/steam.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ pkgs, ... }: {
|
||||
# Steam uses 32-bit drivers for some unholy fucking reason.
|
||||
hardware.graphics.enable32Bit = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.steam
|
||||
];
|
||||
}
|
|
@ -1,17 +1,13 @@
|
|||
{ lib, ... }: with lib; merge
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
})
|
||||
|
||||
(systemConfiguration {
|
||||
{ config, lib, ... }: let
|
||||
inherit (lib) enabled merge mkIf optionalString;
|
||||
in merge {
|
||||
security.sudo = enabled {
|
||||
execWheelOnly = true;
|
||||
extraConfig = ''
|
||||
Defaults lecture = never
|
||||
Defaults pwfeedback
|
||||
Defaults env_keep += "DISPLAY EDITOR PATH"
|
||||
${optionalString isServer ''
|
||||
${optionalString config.isServer ''
|
||||
Defaults timestamp_timeout = 0
|
||||
''}
|
||||
'';
|
||||
|
@ -65,4 +61,6 @@
|
|||
];
|
||||
}];
|
||||
};
|
||||
})
|
||||
} <| mkIf config.isDesktop {
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
{
|
||||
environment.shellAliases = {
|
||||
sc = "systemctl";
|
||||
scd = "systemctl stop";
|
|
@ -1,11 +1,9 @@
|
|||
{ lib, ... }: with lib;
|
||||
{ lib, ... }: let
|
||||
inherit (lib) enabled;
|
||||
|
||||
let
|
||||
# Shorter is better for networking interfaces IMO.
|
||||
interface = "ts0";
|
||||
in systemConfiguration {
|
||||
environment.shellAliases.ts = "sudo tailscale";
|
||||
|
||||
in {
|
||||
# This doesn't work with dig but works with curl, Firefox
|
||||
# and all other tools. Skill issue.
|
||||
services.resolved.domains = [ "warthog-major.ts.net" ];
|
18
modules/linux/thunar.nix
Normal file
18
modules/linux/thunar.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) enabled merge mkIf;
|
||||
in merge <| mkIf config.isDesktop {
|
||||
programs.thunar = enabled {
|
||||
plugins = [
|
||||
pkgs.xfce.thunar-archive-plugin
|
||||
pkgs.xfce.thunar-media-tags-plugin
|
||||
pkgs.xfce.thunar-volman
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.ark
|
||||
pkgs.ffmpegthumbnailer
|
||||
pkgs.libgsf
|
||||
pkgs.xfce.tumbler
|
||||
];
|
||||
}
|
3
modules/linux/tmp.nix
Normal file
3
modules/linux/tmp.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
}
|
3
modules/linux/users.nix
Normal file
3
modules/linux/users.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
users.mutableUsers = false;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
networking.networkmanager = enabled;
|
||||
|
||||
users.extraGroups.networkmanager.members = allNormalUsers;
|
||||
|
||||
environment.shellAliases.wifi = "nmcli dev wifi show-password";
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
{ self, inputs, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
environment.etc."flakes.json".text = strings.toJSON inputs;
|
||||
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 3d";
|
||||
persistent = true;
|
||||
};
|
||||
|
||||
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||
|
||||
optimise.automatic = true;
|
||||
|
||||
registry = {
|
||||
default.flake = inputs.nixpkgs;
|
||||
} // mapAttrs (const (value: mkIf (isType "flake" value) {
|
||||
flake = value;
|
||||
})) inputs;
|
||||
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"auto-allocate-uids"
|
||||
"ca-derivations"
|
||||
"cgroups"
|
||||
"flakes"
|
||||
"nix-command"
|
||||
"recursive-nix"
|
||||
];
|
||||
|
||||
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;
|
||||
} // (import (self + /flake.nix)).nixConfig;
|
||||
};
|
||||
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
'';
|
||||
})
|
|
@ -1,92 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
users.defaultUserShell = pkgs.crash;
|
||||
|
||||
environment.sessionVariables = {
|
||||
SHELLS = lib.getExe pkgs.nushell;
|
||||
|
||||
STARSHIP_LOG = "error";
|
||||
};
|
||||
|
||||
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";
|
||||
|
||||
pstree = "pstree -g 2";
|
||||
tree = "tree -CF --dirsfirst";
|
||||
};
|
||||
})
|
||||
|
||||
(homeConfiguration (homeArgs: {
|
||||
xdg.configFile = {
|
||||
"nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
|
||||
${lib.getExe pkgs.zoxide} init nushell --cmd cd > $out
|
||||
'';
|
||||
|
||||
"nushell/ls_colors.txt".source = pkgs.runCommand "ls_colors.txt" {} ''
|
||||
${lib.getExe pkgs.vivid} generate gruvbox-dark-hard > $out
|
||||
'';
|
||||
|
||||
"nushell/starship.nu".source = pkgs.runCommand "starship.nu" {} ''
|
||||
${lib.getExe pkgs.starship} init nu > $out
|
||||
'';
|
||||
};
|
||||
|
||||
# No `enabled` because home-manager is terrible and spits out something
|
||||
# that does it at runtime instead of doing it at system realization time.
|
||||
programs.starship = {
|
||||
settings = {
|
||||
command_timeout = 100;
|
||||
scan_timeout = 20;
|
||||
|
||||
cmd_duration.show_notifications = isDesktop;
|
||||
|
||||
package.disabled = isServer;
|
||||
|
||||
character.error_symbol = "";
|
||||
character.success_symbol = "";
|
||||
};
|
||||
};
|
||||
|
||||
programs.nushell = enabled {
|
||||
configFile.text = readFile ./configuration.nu;
|
||||
envFile.source = ./environment.nu;
|
||||
|
||||
environmentVariables = let
|
||||
environmentVariables = config.environment.variables;
|
||||
|
||||
homeVariables = homeArgs.config.home.sessionVariables;
|
||||
homeVariablesExtra = pipe (pkgs.runCommand "home-variables-extra.env" {} ''
|
||||
alias export=echo
|
||||
# echo foo > $out
|
||||
# FIXME
|
||||
eval $(cat ${homeArgs.config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh) > $out
|
||||
'') [
|
||||
# (aaa: (_: break _) aaa)
|
||||
readFile
|
||||
(splitString "\n")
|
||||
(filter (s: s != ""))
|
||||
(map (strings.match "([^=]+)=(.*)"))
|
||||
(map (keyAndValue: nameValuePair (first keyAndValue) (last keyAndValue)))
|
||||
(foldl' (x: y: x // y) {})
|
||||
];
|
||||
in environmentVariables // homeVariables // homeVariablesExtra;
|
||||
|
||||
shellAliases = (attrsets.removeAttrs config.environment.shellAliases [ "ls" "l" ]) // {
|
||||
cdtmp = "cd (mktemp --directory)";
|
||||
ll = "ls --long";
|
||||
};
|
||||
};
|
||||
}))
|
||||
|
||||
(systemPackages (with pkgs; [
|
||||
fish # For completions.
|
||||
zoxide # For completions and better cd.
|
||||
]))
|
|
@ -1,58 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemPackages (with pkgs; [
|
||||
asciinema
|
||||
cowsay
|
||||
curlHTTP3
|
||||
dig
|
||||
doggo
|
||||
fastfetch
|
||||
fd
|
||||
(fortune.override { withOffensive = true; })
|
||||
hyperfine
|
||||
moreutils
|
||||
openssl
|
||||
p7zip
|
||||
pstree
|
||||
rsync
|
||||
strace
|
||||
timg
|
||||
traceroute
|
||||
tree
|
||||
usbutils
|
||||
uutils-coreutils-noprefix
|
||||
yazi
|
||||
yt-dlp
|
||||
]))
|
||||
|
||||
(desktopSystemPackages (with pkgs; [
|
||||
clang_16
|
||||
clang-tools_16
|
||||
deno
|
||||
gh
|
||||
go
|
||||
jdk
|
||||
lld
|
||||
maven
|
||||
zig
|
||||
|
||||
# wine
|
||||
]))
|
||||
|
||||
(desktopUserHomePackages (with pkgs; [
|
||||
element-desktop
|
||||
fractal
|
||||
# whatsapp-for-linux
|
||||
# zulip
|
||||
|
||||
qbittorrent
|
||||
|
||||
thunderbird
|
||||
|
||||
# krita
|
||||
obs-studio
|
||||
|
||||
libreoffice
|
||||
hunspellDicts.en_US
|
||||
hunspellDicts.en_GB-ize
|
||||
]))
|
|
@ -1,16 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
environment.shellAliases = {
|
||||
venv = "virtualenv venv";
|
||||
};
|
||||
})
|
||||
|
||||
(systemPackages (with pkgs; [
|
||||
(python311.withPackages (pkgs: with pkgs; [
|
||||
pip
|
||||
requests
|
||||
]))
|
||||
virtualenv
|
||||
poetry
|
||||
]))
|
|
@ -1,8 +0,0 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
desktopUserHomeConfiguration {
|
||||
qt = enabled {
|
||||
platformTheme.name = "adwaita";
|
||||
style.name = "adwaita";
|
||||
};
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
services.resolved = enabled {
|
||||
dnssec = "true";
|
||||
dnsovertls = "true";
|
||||
|
||||
extraConfig = ''
|
||||
DNS=45.90.28.0#7f2bf8.dns.nextdns.io
|
||||
DNS=2a07:a8c0::#7f2bf8.dns.nextdns.io
|
||||
DNS=45.90.30.0#7f2bf8.dns.nextdns.io
|
||||
DNS=2a07:a8c1::#7f2bf8.dns.nextdns.io
|
||||
'';
|
||||
|
||||
fallbackDns = [
|
||||
"1.1.1.1#one.one.one.one"
|
||||
"2606:4700:4700::1111#one.one.one.one"
|
||||
|
||||
"1.0.0.1#one.one.one.one"
|
||||
"2606:4700:4700::1001#one.one.one.one"
|
||||
|
||||
"8.8.8.8#dns.google"
|
||||
"2001:4860:4860::8888#dns.google"
|
||||
|
||||
"8.8.4.4#dns.google"
|
||||
"2001:4860:4860::8844#dns.google"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
{ config, lib, ... }: with lib;
|
||||
|
||||
serverSystemConfiguration {
|
||||
options.resticHosts = mkConst (remove config.networking.hostName [ "cube" "disk" "nine" ]);
|
||||
|
||||
config = {
|
||||
secrets.resticPassword.file = ./password.age;
|
||||
|
||||
services.restic.backups = genAttrs config.resticHosts (host: {
|
||||
repository = "sftp:backup@${host}:${config.networking.hostName}-backup";
|
||||
passwordFile = config.secrets.resticPassword.path;
|
||||
initialize = true;
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 +rZ0Tw Em0WbO4gplG2ja+XW889tC0EGeuc8Mv3IfOWvwN0QXE
|
||||
5zIOO6qXiBcOOPe00D5hWMaQiA8pM6zmsWxV2wubNJE
|
||||
-> ssh-ed25519 spFFQA Dp3QVWKHnrPnJXQ3n9t6PzDLuulZu98CZDm25WZaJgA
|
||||
4PexDQzjTEA3KQ2oo+2lC8cHdYp8iOc5ilKrnf54uOU
|
||||
-> ssh-ed25519 CzqbPQ Ove5RO0REKpcyDrcihPYFqAxO0ynvK9MIJhM2BX8v1A
|
||||
KyIbllnvM+Eiir2wsMp1mdkyjbKPcsCQy8tNLoF+CNA
|
||||
-> ssh-ed25519 dASlBQ P3eVN6O2MfcSzdIlV6z7ALBtKC0HhtW296qDIjtayEk
|
||||
+drcAG52h0dzmp45woWadyNlUqaY156XaGEeq5AR0JM
|
||||
-> ssh-ed25519 f5VzMA 4e4M6qzgt1qiZp2DJrd9Jk5wDEVBB8Gac31litJ62Ug
|
||||
QretaVV5MLi5qwt18eQyDCJiTvicV/VAvvImfx1//FI
|
||||
--- 5AqRIM2qsjiMytT70BtR7JS/XRNj5U7mpzSu6mjmmrY
|
||||
}ÅM<C385> }€K6ÓÝÐå¸ëaG„sâ’ž¨¥ßÿBá$¿âiÑ[Õ¶Ã@LoIÉL
|
|
@ -1,12 +0,0 @@
|
|||
{ lib, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
environment.shellAliases = {
|
||||
rg = "rg --line-number --smart-case";
|
||||
todo = ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold'';
|
||||
};
|
||||
})
|
||||
|
||||
(homeConfiguration {
|
||||
programs.ripgrep = enabled;
|
||||
})
|
|
@ -1,21 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(desktopSystemPackages (with pkgs; [
|
||||
cargo-expand
|
||||
cargo-fuzz
|
||||
|
||||
evcxr
|
||||
|
||||
(fenix.complete.withComponents [
|
||||
"cargo"
|
||||
"clippy"
|
||||
"rust-src"
|
||||
"rustc"
|
||||
"rustfmt"
|
||||
])
|
||||
]))
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
environment.variables.CARGO_NET_GIT_FETCH_WITH_CLI = "true";
|
||||
})
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 +rZ0Tw /j82x9Agw/wG4Who2GuKYOhFyhfM6Uw4yfLr+oUrrwk
|
||||
N0Oymf68GGLw3/1G32qGBlMsj7Sd/HqBtu5eXDcJ+v0
|
||||
-> ssh-ed25519 spFFQA mHhwVQIcInJogAuz8FNqzgOSv4xEw6aW/PuZMmv9HzQ
|
||||
PAjt/looW3SZSEpiwQYyVS7u3H0/hdqoJ7RW7toMVzQ
|
||||
-> ssh-ed25519 CzqbPQ ykwSohQ1MZIUMOS+9+8EzFxiKWK8YuOxJskJMpIqpCY
|
||||
yK8USN5UjK+Zm6x7sX+GEaHa0WF7lvjTMJU4hXYuHg4
|
||||
-> ssh-ed25519 dASlBQ bNmzApWOoO6arrfuOJXbEBQ+jSjsNZYK2WhOjhlHTBw
|
||||
GYyUFRzChbg2+4R15nhyHV9jjgSnYaGovuco+d5l3b4
|
||||
-> ssh-ed25519 f5VzMA bu1zjVKLXsZrtLISB9RQQK6ywhq6KXnk3B1DTMS8R2Q
|
||||
jx2W7veML38YXA0a7vh8EVdrgBjM+Cc84AQ6+e9w4WA
|
||||
-> ssh-ed25519 V6IHIQ /IRDpxzKESL6IJr4Eq1J1VTIqJXcAmFwkYdJTRCL9Cs
|
||||
nvrlP/fEowlvvPjGVVwx/DF+904OWR0rX33aOh77C0s
|
||||
--- sMYN2M/dRMasneiSvIWDpVSRiLgNVUN2oPr7NqWdlKk
|
||||
3F(7©ÉmRNŸNÈ{%P²<50>‚ %Ý<02>K©0»ÀH¼ÅÊ´¹¨.oÄÄ<C384>‰
|
||||
ËMª‘½ÏFÝåÂÒ± '‚§JľXêÈÆmªÚ´@¼nI(©%LHÂá
|
|
@ -1,79 +0,0 @@
|
|||
{ self, config, lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
secrets.sshConfig = {
|
||||
file = ./config.age;
|
||||
mode = "444";
|
||||
};
|
||||
})
|
||||
|
||||
(desktopSystemPackages (with pkgs; [
|
||||
mosh
|
||||
]))
|
||||
|
||||
(let
|
||||
controlPath = "~/.ssh/control";
|
||||
in homeConfiguration {
|
||||
home.activation.createControlPath = {
|
||||
after = [ "writeBoundary" ];
|
||||
before = [];
|
||||
data = "mkdir --parents ${controlPath}";
|
||||
};
|
||||
|
||||
programs.ssh = enabled {
|
||||
controlMaster = "auto";
|
||||
controlPath = "${controlPath}/%r@%n:%p";
|
||||
controlPersist = "60m";
|
||||
serverAliveCountMax = 2;
|
||||
serverAliveInterval = 60;
|
||||
|
||||
includes = [ config.secrets.sshConfig.path ];
|
||||
|
||||
matchBlocks = {
|
||||
"*" = {
|
||||
setEnv.COLORTERM = "truecolor";
|
||||
setEnv.TERM = "xterm-256color";
|
||||
|
||||
identityFile = "~/.ssh/id";
|
||||
};
|
||||
|
||||
# Maybe autogenerate these?
|
||||
|
||||
cube = {
|
||||
hostname = self.cube.networking.ipv4;
|
||||
user = "rgb";
|
||||
port = 2222;
|
||||
};
|
||||
|
||||
disk = {
|
||||
hostname = self.disk.networking.ipv4;
|
||||
user = "floppy";
|
||||
port = 2222;
|
||||
};
|
||||
|
||||
nine = {
|
||||
hostname = self.nine.networking.ipv4;
|
||||
user = "seven";
|
||||
port = 2222;
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(let
|
||||
port = 2222;
|
||||
in serverSystemConfiguration {
|
||||
programs.mosh = enabled {
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.openssh = enabled {
|
||||
ports = [ port ];
|
||||
settings = {
|
||||
KbdInteractiveAuthentication = false;
|
||||
PasswordAuthentication = false;
|
||||
|
||||
AcceptEnv = "SHELLS COLORTERM";
|
||||
};
|
||||
};
|
||||
})
|
|
@ -1,18 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(desktopSystemConfiguration {
|
||||
programs.thunar = enabled {
|
||||
plugins = with pkgs.xfce; [
|
||||
thunar-archive-plugin
|
||||
thunar-media-tags-plugin
|
||||
thunar-volman
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
(desktopSystemPackages (with pkgs; [
|
||||
ark
|
||||
ffmpegthumbnailer
|
||||
libgsf
|
||||
xfce.tumbler
|
||||
]))
|
|
@ -1,5 +0,0 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{ lib, ... }: with lib;
|
||||
|
||||
systemConfiguration {
|
||||
users.mutableUsers = false;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
{ lib, pkgs, ... }: with lib; merge
|
||||
|
||||
(systemConfiguration {
|
||||
environment.shellAliases = {
|
||||
ddg = "w3m lite.duckduckgo.com";
|
||||
web = "w3m";
|
||||
};
|
||||
})
|
||||
|
||||
(systemPackages (with pkgs; [
|
||||
w3m
|
||||
]))
|
Loading…
Add table
Add a link
Reference in a new issue