1
Fork 0

Started working on guest@euporie

This commit is contained in:
Matei Adriel 2023-05-28 02:00:10 +02:00
parent 0503a81ee8
commit 230a739327
No known key found for this signature in database
62 changed files with 188 additions and 135 deletions

12
home/features/README.md Normal file
View file

@ -0,0 +1,12 @@
# Common home manager stuff
## File structure
| Directory | Description |
| -------------------- | --------------------------------------------- |
| [cli/](./cli) | Configuration for terminal stuff |
| [desktop](./desktop) | Desktop apps usable on both wayland and xorg |
| [xorg](./xorg) | Xorg only stuff |
| [wayland](./wayland) | Wayland only stuff |
| [neovim](./neovim) | Neovim (to be expanded in the future ) |
| [games](./games) | Similar to [desktop](./desktop) but for games |

View file

@ -0,0 +1,8 @@
{
# Enabling this produces an uglier theme for some reason.
# options.stylix.targets.bat.enable =true;
programs.bat = {
enable = true;
config.theme = "base16-256";
};
}

View file

@ -0,0 +1,35 @@
{ pkgs, ... }: {
imports = [
./exa.nix
./bat.nix
./ssh.nix
./git.nix
./starship.nix
./direnv.nix
./fish
./tmux
];
# Enable bash
programs.bash.enable = true;
# Install clis
home.packages = with pkgs; [
ranger # Terminal file explorer
comma # Intstall and run programs by sticking a , before them
bc # Calculator
ncdu # TUI disk usage
du-dust # Similar to du and ncdu in purpose.
ripgrep # Better grep
fd # Better find
sd # Better sed
httpie # Better curl
mkpasswd # Hash passwords
neofetch # Display system information
zip # Zipping files
unzip # Unzipping files
unrar # For extracting shit from rars
tokei # Useless but fun line of code counter (sloc alternative)
bottom # System monitor
];
}

View file

@ -0,0 +1,11 @@
{
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
home.sessionVariables = {
# No more long command warnings
DIRENV_WARN_TIMEOUT = "24h";
# No more usesless logs
DIRENV_LOG_FORMAT = "";
};
}

16
home/features/cli/exa.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }: {
home.packages = [ pkgs.exa ];
# TODO: generalize alias creation to all shells
programs.fish.shellAliases =
let exa = "${pkgs.exa}/bin/exa";
in
rec {
ls = "${exa} --icons --long";
la = "${ls} --all";
lt = "${ls} --tree"; # Similar to tree, but also has --long!
# I am used to using pkgs.tree, so this is nice to have!
tree = "${exa} --icons --tree";
};
}

View file

@ -0,0 +1,42 @@
# {{{ Start tmux if not already inside tmux
if status is-interactive
and not set -q TMUX
and not set -q NO_TMUX
exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux"
end
# }}}
# {{{ Sets cursor based on vim mode
set fish_cursor_default block # Set the normal and visual mode cursors to a block
set fish_cursor_insert line # Set the insert mode cursor to a line
set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore
# Force fish to skip some checks (I think?)
# TODO: research why this is here
set fish_vi_force_cursor
# }}}
# {{{ Disable greeting
set fish_greeting
# }}}
# {{{ Keybinds
function fish_user_key_bindings
# {{{ Use vim-style keybinds
# Use the vim keybinds
fish_vi_key_bindings
bind -e -M insert -k f10 # unbinds f10
bind -M insert -m default -k f10 'commandline -f repaint' # Exit insert mode with <f10>
# }}}
# {{{ C-x to clear screen
bind -M default \cx "clear && commandline -f repaint"
bind -M insert \cx "clear && commandline -f repaint"
# }}}
# {{{ C-enter to run command through less
bind -M default \e\[13\;2u "commandline -a ' | less' && commandline -f execute"
bind -M insert \e\[13\;2u "commandline -a ' | less' && commandline -f execute"
# }}}
# {{{ C-g to open neogit
bind -M default \cg "nvim +Neogit"
bind -M insert \cg "nvim +Neogit"
# }}}
end
# }}}

View file

@ -0,0 +1,33 @@
{ pkgs, ... }:
{
programs.fish = {
enable = true;
shellAbbrs = {
battery = "acpi";
};
shellAliases = {
cat = "bat";
df = "df -h";
du = "du -h";
duh = "du -hd 1"; # short for du here
};
# with pkgs.fishPlugins;
plugins = [
# Jump to directories by typing "z <directory-name>"
{
name = "z";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "z";
rev = "85f863f20f24faf675827fb00f3a4e15c7838d76";
sha256 = "1kaa0k9d535jnvy8vnyxd869jgs0ky6yg55ac1mxcxm8n0rh2mgq";
};
}
];
interactiveShellInit = builtins.readFile ./config.fish;
};
}

33
home/features/cli/git.nix Normal file
View file

@ -0,0 +1,33 @@
{ pkgs, config, ... }: {
programs.git = {
enable = true;
package = pkgs.gitFull;
aliases.graph = "log --decorate --oneline --graph";
userName = "Matei Adriel";
userEmail = "rafaeladriel11@gmail.com";
extraConfig = {
github.user = "Mateiadrielrafael";
hub.protocol = "ssh";
core.editor = "nvim";
rebase.autoStash = true;
init.defaultBranch = "main";
# Sign commits using ssh
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_ed25519.pub";
# Sign everything by default
commit.gpgsign = true;
tag.gpgsign = true;
};
};
# Github cli
programs.gh = {
enable = true;
settings.git_protocol = "ssh";
};
}

View file

@ -0,0 +1,7 @@
{ ... }: {
programs.ssh.enable = true;
# home.persistence = {
# "/persist/home/adrielus".directories = [ ".ssh" ];
# };
}

View file

@ -0,0 +1,5 @@
{
programs.starship = {
enable = true;
};
}

View file

@ -0,0 +1,38 @@
{ pkgs, config, ... }:
let base16-tmux = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-tmux";
sha256 = "1p6czpd9f0sbibdsph1hdw4ljp6zzjij2159bks16wbfbg3p1hhx";
rev = "3312bb2cbb26db7eeb2d2235ae17d4ffaef5e59b";
};
};
in
{
programs.tmux = {
enable = true;
clock24 = true; # 24h clock format
historyLimit = 10000; # increase amount of saved lines
plugins = with pkgs.tmuxPlugins; [
sessionist # Nicer workflow for switching around between sessions
resurrect # Save / restore tmux sessions
{
plugin = continuum; # Automatically restore tmux sessions
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
'';
}
];
extraConfig = ''
# Main config
source ${./tmux.conf}
# Theme
source ${base16-tmux}
'';
};
}

View file

@ -0,0 +1,66 @@
# {{{ Remap prefix to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# }}}
# {{{ Hide status bar
set -g status off
# }}}
# {{{ Don't rename windows automatically
set-option -g allow-rename off
# }}}
# {{{ Fix slow esc key
set -sg escape-time 10
# }}}
# {{{ Visual stuff
# See https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",$TERM:RGB"
# }}}
# {{{ Split panes with "-" and "\"
bind \\ split-window -h
bind - split-window -v
unbind '"'
unbind %
# }}}
# {{{ Zoom with M-z
bind -n M-z resize-pane -Z
# }}}
# {{{ Vim-mode
set-window-option -g mode-keys vi
# }}}
# {{{ Vim like keybinds for leaving insert mode
unbind [ # unbind the default way to copy text
bind -T prefix j copy-mode # allow exiting insert mode with C-a j
# }}}
# {{{ Vim like keybinds for copying and pasting
bind -T copy-mode-vi p paste-buffer
bind -T copy-mode-vi V send-keys -X rectangle-toggle # Check if this works
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection
# }}}
# {{{ Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# Also see: https://github.com/christoomey/vim-tmux-navigator/issues/264
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|\.?n?vim?x?(-wrapped)?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# }}}
# {{{ Get titles to work
set-option -g set-titles on
set-option -g set-titles-string "#T"
# }}}

View file

@ -0,0 +1,19 @@
{ config, pkgs, lib, ... }:
{
stylix.targets.alacritty.enable = true;
programs.alacritty = {
enable = true;
settings = {
window.opacity = lib.mkForce 0.5; # Conflicts with stylix
window.padding = {
x = 4;
y = 4;
};
env = { TERM = "tmux-256color"; };
working_directory = "${config.home.homeDirectory}/Projects/";
};
};
}

View file

@ -0,0 +1,12 @@
{ config, ... }: {
programs.discord = {
enable = true;
enableOpenASAR = false;
disableUpdateCheck = true;
enableDevtools = true;
};
satellite.persistence.at.state.apps.Discord.directories = [
"${config.xdg.configHome}/discord" # Why tf does discord store it's state here 💀
];
}

View file

@ -0,0 +1,18 @@
{ config, pkgs, ... }:
let
base16-eww = config.lib.stylix.colors {
template = builtins.readFile ./template.yuck;
};
widgets = config.satellite.dev.path "home/adrielus/features/desktop/common/eww/widgets";
in
{
home.packages = [ pkgs.eww ];
xdg.configFile."eww/eww.yuck".text = ''
# Color scheme
(include ${base16-eww})
# My widgets
(include ${widgets}/dashboard)
'';
}

View file

@ -0,0 +1,16 @@
(defvar base00 "{{base00-hex}}")
(defvar base01 "{{base01-hex}}")
(defvar base02 "{{base02-hex}}")
(defvar base03 "{{base03-hex}}")
(defvar base04 "{{base04-hex}}")
(defvar base05 "{{base05-hex}}")
(defvar base06 "{{base06-hex}}")
(defvar base07 "{{base07-hex}}")
(defvar base08 "{{base08-hex}}")
(defvar base09 "{{base09-hex}}")
(defvar base0A "{{base0A-hex}}")
(defvar base0B "{{base0B-hex}}")
(defvar base0C "{{base0C-hex}}")
(defvar base0D "{{base0D-hex}}")
(defvar base0E "{{base0E-hex}}")
(defvar base0F "{{base0F-hex}}")

View file

@ -0,0 +1,12 @@
(defwindow dashboard
:stacking "bg"
; :windowtype "normal"
:wm-ignore false
:reserve (struts :distance "40px" :side "left")
:geometry (geometry
:width "40px"
:height "100%")
(dashboard_layout))
(defwidget dashboard_layout []
(label :text "A"))

View file

@ -0,0 +1 @@
/nix/store/jfni99vrwsgh0i4i2kjiv953aa0gqp2m-home-manager-files/.config/eww/eww.yuck

View file

@ -0,0 +1,238 @@
{ pkgs, inputs, ... }:
let
# {{{ Global extensions
extensions = with inputs.firefox-addons.packages.${pkgs.system}; [
buster-captcha-solver
bypass-paywalls-clean
clearurls # removes ugly args from urls
don-t-fuck-with-paste # disallows certain websites from disabling pasting
gesturefy # mouse gestures
i-dont-care-about-cookies
localcdn # caches libraries locally
privacy-badger # blocks some trackers
privacy-pass # captcha stuff
skip-redirect # attempts to skip to the final reddirect for certain urls
terms-of-service-didnt-read
translate-web-pages
ublock-origin
unpaywall
user-agent-string-switcher
];
# }}}
in
{
programs.firefox = {
enable = true;
profiles.adrielus = {
# {{{ High level user settings
# Unique user id
id = 0;
# Make this the default user
isDefault = true;
# Forcefully replace the search configuration
search.force = true;
# Set default search engine
search.default = "Google";
# Set styles applied to every website
userContent = builtins.readFile ./userContent.css;
# }}}
# {{{ Extensions
extensions = with inputs.firefox-addons.packages.${pkgs.system}; extensions ++ [
firenvim # summon a nvim instance inside the browser
lovely-forks # displays forks on github
octolinker # github import to link thingy
octotree # github file tree
refined-github # a bunch of github modifications
return-youtube-dislikes
steam-database # adds info from steamdb on storepages
sponsorblock # skip youtube sponsors
vimium-c # vim keybinds
youtube-shorts-block
];
# }}}
# {{{ Search engines
search.engines =
let
# {{{ Search engine creation helpers
mkBasicSearchEngine = { aliases, url, param }: {
urls = [{
template = url;
params = [
{ name = param; value = "{searchTerms}"; }
];
}];
definedAliases = aliases;
};
mkNixPackagesEngine = { aliases, type }:
let basicEngine = mkBasicSearchEngine
{
aliases = aliases;
url = "https://search.nixos.org/${type}";
param = "query";
};
in
basicEngine // {
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
};
# }}}
in
# {{{ Engine declarations
{
"Nix Packages" = mkNixPackagesEngine {
aliases = [ "@np" "@nix-packages" ];
type = "packages";
};
"Nix options" = mkNixPackagesEngine {
aliases = [ "@no" "@nix-options" ];
type = "options";
};
# Purescript packages
"Pursuit" = mkBasicSearchEngine {
url = "https://pursuit.purescript.org/search";
param = "q";
aliases = [ "@ps" "@pursuit" ];
};
"Wikipedia" = mkBasicSearchEngine {
url = "https://en.wikipedia.org/wiki/Special:Search";
param = "search";
aliases = [ "@wk" "@wikipedia" ];
};
"Github" = mkBasicSearchEngine {
url = "https://github.com/search";
param = "q";
aliases = [ "@gh" "@github" ];
};
"Youtube" = mkBasicSearchEngine {
url = "https://www.youtube.com/results";
param = "search_query";
aliases = [ "@yt" "@youtube" ];
};
"Noita wiki" = mkBasicSearchEngine {
url = "https://noita.wiki.gg/index.php";
param = "search";
aliases = [ "@noita" ];
};
"Rain world wiki" = mkBasicSearchEngine {
url = "https://rainworld.miraheze.org/w/index.php";
param = "search";
aliases = [ "@rw" "@rain-world" ];
};
"Factorio wiki" = mkBasicSearchEngine {
url = "https://wiki.factorio.com/index.php";
param = "search";
aliases = [ "@fw" "@factorio-wiki" ];
};
"Factorio mod portal" = mkBasicSearchEngine {
url = "https://mods.factorio.com/";
param = "query";
aliases = [ "@fm" "@factorio-mods" ];
};
"Google".metaData.alias = "@g";
};
# }}}
# }}}
# {{{ Other lower level settings
settings = {
# Required for figma to be able to export to svg
"dom.events.asyncClipboard.clipboardItem" = true;
# Customize css
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
# Set language to english
"general.useragent.locale" = "en-GB";
# Do not restore sessions after what looks like a "crash"
"browser.sessionstore.resume_from_crash" = false;
# Tell firefox to make multiple requests at once
# See [this random page](https://doorsanchar.com/how-to-make-mozilla-firefox-30-times-faster/)
# "network.http.pipelining" = true;
# "network.http.proxy.pipelining" = true;
# "network.http.pipelining.maxrequests" = 30; # Allow 30 requests at once
# "nglayout.initialpaint.delay" = 0;
};
# }}}
};
# {{{ Standalone "apps" which actually run inside a browser.
apps.extensions = extensions;
apps.app = {
# {{{ Job stuff
asana = {
url = "https://app.asana.com/";
icon = ./icons/asana.png;
displayName = "Asana";
id = 1;
};
clockodo = {
url = "https://my.clockodo.com/en/";
icon = ./icons/clockodo.png;
displayName = "Clockodo";
id = 2;
};
# }}}
gitlab = {
url = "https://gitlab.com";
icon = ./icons/gitlab.png;
displayName = "Gitlab";
id = 3;
};
desmos = {
url = "https://www.desmos.com/calculator";
icon = ./icons/desmos.png;
displayName = "Desmos";
id = 4;
};
monkey-type = {
url = "https://monkeytype.com/";
icon = ./icons/monkeytype.png;
displayName = "Monkeytype";
id = 5;
};
};
# }}}
};
# {{{ Make firefox the default
# Use firefox as the default browser to open stuff.
xdg.mimeApps.defaultApplications = {
"text/html" = [ "firefox.desktop" ];
"text/xml" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
};
# Tell apps firefox is the default browser using an env var.
home.sessionVariables.BROWSER = "firefox";
# }}}
# {{{ Persistence
home.persistence."/persist/home/adrielus".directories = [
".cache/mozilla/firefox" # Non important cache
".mozilla/firefox" # More important stuff
];
# }}}
}

Binary file not shown.

After

(image error) Size: 423 B

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 16 KiB

Binary file not shown.

After

(image error) Size: 19 KiB

Binary file not shown.

After

(image error) Size: 23 KiB

View file

@ -0,0 +1,5 @@
/* add '[pdf]' next to links to PDF files */
a[href$=".pdf"]:after {
font-size: smaller;
content: " [pdf]";
}

View file

@ -0,0 +1,14 @@
{ pkgs, config, ... }: {
home.packages = [
pkgs.qbittorrent
];
satellite.persistence.at.state.apps.QBittorrent.directories = [
"${config.xdg.configHome}/qBittorrent" # Config options
];
satellite.persistence.at.cache.apps.QBittorrent.directories = [
# TODO: investigate which subdirectories/files I actually want to keep
"${config.xdg.dataHome}/qBittorrent" # Torrent files, logs, etc
];
}

View file

@ -0,0 +1,9 @@
{ pkgs, config, ... }: {
home.packages = [
pkgs.signal-desktop # Signal client
];
satellite.persistence.at.state.apps.Signal.directories = [
"${config.xdg.configHome}/Signal" # Why tf does signal store it's state here 💀
];
}

View file

@ -0,0 +1,10 @@
{ pkgs, config, ... }: {
homeage.file.wakatime = {
source = ./wakatime_config.age;
symlinks = [
"${config.home.homeDirectory}/.wakatime.cfg"
];
};
home.packages = with pkgs; [ wakatime ];
}

View file

@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 UUF9JQ xZrl2Wl0woDhkVrg+1pI+BbWHCg3XV3T7pFoXgedR30
+/LVZ/HO8Larngohcw1qJlNOrx81U4dUwgZjl3eSr8E
-> ><tHMt-grease P^L r%s
Tr98KsZbbA+iwetDDuqha/D3aNESSYJTeiziDjNrCCtQpVvdJ4+5R9UKfR3PCPcE
dx1DrUOF1XLlEX/cjnGP02J/CsfRJXN0vqI
--- 5zpFcCG6y7y2C8dwzwHQ8bJsIvyObCVkGovZMOLIGio
š" DÚ‡WŒñg:ü^^ßÖôüG"I<>?¥haeä+|1õ|ó1Šm8Xíà}İ×$®Ÿ8Ì/ê0Æ·hâx¤õžÅ4ý¾¨‰F ~Zèka˜Ã"Fp

View file

@ -0,0 +1,8 @@
{ pkgs, config, ... }: {
home.packages = [ pkgs.wezterm ];
# Create link to config
xdg.configFile."wezterm/colorscheme.lua".text = config.satellite.colorscheme.lua;
xdg.configFile."wezterm/wezterm.lua".source =
config.satellite.dev.path "home/adrielus/features/desktop/common/wezterm/wezterm.lua";
}

View file

@ -0,0 +1,68 @@
-- {{{ Import stuff & create config object
local wezterm = require("wezterm")
local colorscheme = require("colorscheme") -- injected by nix!
-- This table will hold the configuration.
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
-- }}}
local font_size = 20.0
-- {{{ Theming
config.colors = wezterm.color.load_base16_scheme(colorscheme.source)
-- {{{ Window frame
config.window_frame = {
font = wezterm.font({ family = colorscheme.fonts.monospace }),
font_size = font_size,
active_titlebar_bg = colorscheme.base00,
inactive_titlebar_bg = colorscheme.base00,
}
-- }}}
-- {{{ Tab bar colors
config.colors.tab_bar = {
background = colorscheme.base02,
active_tab = {
bg_color = colorscheme.base0A,
fg_color = colorscheme.base00,
},
inactive_tab = {
bg_color = colorscheme.base02,
fg_color = colorscheme.base05,
},
inactive_tab_hover = {
bg_color = colorscheme.base01,
fg_color = colorscheme.base05,
},
new_tab = {
bg_color = colorscheme.base02,
fg_color = colorscheme.base05,
},
new_tab_hover = {
bg_color = colorscheme.base02,
fg_color = colorscheme.base05,
italic = true,
},
}
-- }}}
-- }}}
-- {{{ Main config options
config.adjust_window_size_when_changing_font_size = false -- Makes it work with fixed window sizes.
config.automatically_reload_config = true
config.font_size = font_size
config.use_fancy_tab_bar = false
config.disable_default_key_bindings = true
-- config.enable_kitty_keyboard = true -- Let's apps recognise more distinct keys
config.enable_csi_u_key_encoding = true -- For some reason I need this for all keybinds to work inside neovim.
-- }}}
-- {{{ Keybinds
-- }}}
-- and finally, return the configuration to wezterm
return config

View file

@ -0,0 +1,25 @@
{ config, pkgs, ... }:
let base16-zathura = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "doenerkebap";
repo = "base16-zathura";
sha256 = "1zcrzll13d4lmyzibwdqkkdssyhr3c9s4yxhqigg3azsizk8adb4";
rev = "2caef8fff6a5412e05950c6105c5020a6f16ead2";
};
};
in
{
programs.zathura = {
enable = true;
extraConfig = ''
# Generated theme
include ${base16-zathura}
# Open document in fit-width mode by default
set adjust-open "best-fit"
# Inject font
set font "${config.stylix.fonts.sansSerif.name}"
'';
};
}

View file

@ -0,0 +1,3 @@
{
imports = [ ./wine.nix ./lutris.nix ./steam.nix ];
}

View file

@ -0,0 +1,15 @@
{ pkgs, config, ... }:
{
home.packages = [
pkgs.lutris
];
home.persistence."/persist/home/adrielus".directories = [
("Lutris/.config/lutris") # General config data
".cache/lutris/banners" # Game banners
".cache/lutris/coverart" # Game cover art
# Aparently IO intensive stuff like games prefer symlinks?
{ directory = "Games/Lutris"; method = "symlink"; } # Lutris games
];
}

View file

@ -0,0 +1,20 @@
# Although steam is installed globally by nixos,
# there's some extra settings we make for a specific user!
{
home.persistence."/persist/home/adrielus" = {
files = [
".steam/registry.vdf" # It seems like auto-login does not work without this
];
directories = [
# TODO: perhaps this should leave in it's own file?
".factorio"
# A couple of games don't play well with bindfs
{
directory = ".local/share/Steam";
method = "symlink";
}
];
};
}

View file

@ -0,0 +1,6 @@
# TODO(imperanence): handle persistence
{ pkgs, ... }: {
home.packages = [
pkgs.wine
];
}

View file

@ -0,0 +1,197 @@
# TODO(imperanence): handle persistence of things like harpoon, lazy, etc
{ pkgs, upkgs, lib, config, paths, inputs, ... }:
let
# {{{ extraPackages
extraPackages = with pkgs; [
# Language servers
nodePackages.typescript-language-server # typescript
nodePackages_latest.purescript-language-server # purescript
# REASON: not in stable
upkgs.lua-language-server # lua
rnix-lsp # nix
nil # nix
haskell-language-server # haskell
dhall-lsp-server # dhall
tectonic # something related to latex (?)
texlab # latex
nodePackages_latest.vscode-langservers-extracted # web stuff
python310Packages.python-lsp-server # python
pyright # python
rust-analyzer # rust
upkgs.typst-lsp # typst
# Formatters
luaformatter # Lua
stylua # Lua
ormolu # Haskell
black # Python
yapf # Python
isort # Reorder python imports
nodePackages_latest.purs-tidy # Purescript
nodePackages_latest.prettier # Js & friends
nodePackages_latest.prettier_d_slim # Js & friends
upkgs.typst-fmt # Typst
# Linters
ruff # Python linter
mypy # Python typechecking
# Languages
nodePackages.typescript # typescript
lua # For repls and whatnot
wakatime # time tracking
rustfmt
# Others
fd # file finder
ripgrep # Grep rewrite
update-nix-fetchgit # Useful for nix stuff
tree-sitter # Syntax highlighting
libstdcxx5 # Required by treesitter aparently
python310Packages.jupytext # Convert between jupyter notebooks and python files
graphviz # For rust crate graph
# Preview
zathura # Pdf reader
xdotool # For zathura reverse search or whatever it's called
glow # Md preview in terminal
pandoc # Md processing
libsForQt5.falkon # Needed for one of the md preview plugins I tried
# Latex setup
texlive.combined.scheme-full # Latex stuff
python38Packages.pygments # required for latex syntax highlighting
sage
sagetex # sage in latex
# required for the telescope fzf extension
gnumake
cmake
gcc
# Required by magma-nvim:
# python310Packages.pynvim
# python310Packages.jupyter
];
# }}}
# {{{ extraRuntime
extraRuntime = env: [
# Snippets
(config.satellite.dev.path "dotfiles/vscode-snippets")
# Base16 theme
(pkgs.writeTextDir
"lua/nix/theme.lua"
config.satellite.colorscheme.lua
)
# Provide hints as to what app we are in
# (Useful because neovide does not provide the info itself right away)
(pkgs.writeTextDir
"lua/nix/env.lua"
"return '${env}'"
)
];
# }}}
# {{{ Client wrapper
# Wraps a neovim client, providing the dependencies
# and setting some flags:
#
# - NVIM_EXTRA_RUNTIME provides extra directories to add to the runtimepath.
# I cannot just install those dirs using the builtin package support because
# my package manager (lazy.nvim) disables those.
wrapClient = { base, name, binName ? name, extraArgs ? "" }:
pkgs.symlinkJoin {
inherit (base) name meta;
paths = [ base ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/${binName} \
--prefix PATH : ${lib.makeBinPath extraPackages} \
--set NVIM_EXTRA_RUNTIME ${lib.strings.concatStringsSep "," (extraRuntime name)} \
${extraArgs}
'';
};
# }}}
# {{{ Clients
neovim = wrapClient {
# REASON: nvim 9.0
base = upkgs.neovim;
name = "nvim";
};
neovide = wrapClient {
# REASON: neovide 10.0.4
base = upkgs.neovide;
name = "neovide";
extraArgs = "--set NEOVIDE_MULTIGRID true";
};
firenvim = wrapClient {
base = pkgs.neovim;
name = "firenvim";
binName = "nvim";
extraArgs = "--set GIT_DISCOVERY_ACROSS_FILESYSTEM 1";
};
# }}}
in
{
# {{{ Basic config
# Do not manage neovim via nix
programs.neovim.enable = false;
xdg.configFile.nvim.source = config.satellite.dev.path "dotfiles/neovim";
home.sessionVariables.EDITOR = "nvim";
home.packages = [
neovim
neovide
];
# }}}
# {{{ Firenvim
home.file.".mozilla/native-messaging-hosts/firenvim.json".text =
let
# God knows what this does
# https://github.com/glacambre/firenvim/blob/87c9f70d3e6aa2790982aafef3c696dbe962d35b/autoload/firenvim.vim#L592
firenvim_init = pkgs.writeText "firenvim_init.vim" ''
let g:firenvim_i=[]
let g:firenvim_o=[]
let g:Firenvim_oi={i,d,e->add(g:firenvim_i,d)}
let g:Firenvim_oo={t->[chansend(2,t)]+add(g:firenvim_o,t)}
let g:firenvim_c=stdioopen({'on_stdin':{i,d,e->g:Firenvim_oi(i,d,e)},'on_print':{t->g:Firenvim_oo(t)}})
let g:started_by_firenvim = v:true
'';
firenvim_file_loaded = pkgs.writeText "firenvim_file_loaded.vim"
''
try
call firenvim#run()
catch /Unknown function/
call chansend(g:firenvim_c,["f\n\n\n"..json_encode({"messages":["Your plugin manager did not load the Firenvim plugin for neovim."],"version":"0.0.0"})])
call chansend(2,["Firenvim not in runtime path. &rtp="..&rtp])
qall!
catch
call chansend(g:firenvim_c,["l\n\n\n"..json_encode({"messages": ["Something went wrong when running firenvim. See troubleshooting guide."],"version":"0.0.0"})])
call chansend(2,[v:exception])
qall!
endtry
'';
in
builtins.toJSON
{
name = "firenvim";
description = "Turn your browser into a Neovim GUI.";
type = "stdio";
allowed_extensions = [ "firenvim@lacamb.re" ];
path = pkgs.writeShellScript "firenvim.sh" ''
mkdir -p /run/user/$UID/firenvim
chmod 700 /run/user/$UID/firenvim
cd /run/user/$UID/firenvim
exec '${firenvim}/bin/nvim' --headless \
--cmd 'source "${firenvim_init}"' \
-S '${firenvim_file_loaded}'
'';
};
# }}}
}

View file

@ -0,0 +1,60 @@
# Common wayland stuff
{ lib, pkgs, upkgs, ... }: {
imports = [
./wofi.nix
./dunst.nix
../desktop/wezterm # Default hyprland terminal
];
# Makes some stuff run on wayland (?)
# Taken from [here](https://github.com/fufexan/dotfiles/blob/3b0075fa7a5d38de13c8c32140c4b020b6b32761/home/wayland/default.nix#L14)
# TODO: ask author what those do
# home.sessionVariables = {
# QT_QPA_PLATFORM = "wayland";
# SDL_VIDEODRIVER = "wayland";
# XDG_SESSION_TYPE = "wayland";
# };
# TODO: set up
# - wallpaper
# - notification daemon
# - screen recording
# - volume/backlight controls
# - eww bar
# - configure hyprland colors using base16 stuff
# - look into swaylock or whatever people use
# - look into greetd or something
# - multiple keyboard layouts
home.packages =
let
_ = lib.getExe;
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
# TODO: put this in it's own file perhaps?
# Taken from [here](https://github.com/fufexan/dotfiles/blob/3b0075fa7a5d38de13c8c32140c4b020b6b32761/home/wayland/default.nix#L14)
wl-ocr = pkgs.writeShellScriptBin "wl-ocr" ''
${_ pkgs.grim} -g "$(${_ pkgs.slurp})" -t ppm - \
| ${_ pkgs.tesseract5} - - \
| ${wl-copy}
${_ pkgs.libnotify} "Run ocr on area with output \"$(${wl-paste})\""
'';
in
with pkgs; [
# Utils
libnotify # Send notifications
wl-ocr # Custom ocr script
wl-clipboard # Clipboard manager
wlogout # Nice logout script
# REASON: not available on stable yet
upkgs.hyprpicker # Color picker
# Screenshot related tools
grim # Take screenshot
slurp # Area selector
];
}

View file

@ -0,0 +1,5 @@
{
services.dunst = {
enable = true;
};
}

View file

@ -0,0 +1,11 @@
{ pkgs, inputs, ... }: {
imports = [ ../default.nix ];
home.packages = [ inputs.hyprland-contrib.packages.${pkgs.system}.grimblast ];
wayland.windowManager.hyprland = {
enable = true;
recommendedEnvironment = true;
extraConfig = builtins.readFile ./hyprland.conf;
};
}

View file

@ -0,0 +1,131 @@
# Monitors
# https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1
general {
cursor_inactive_timeout = 30 # Hide cursor after being inactive for 30s
resize_on_border = true # Click on borders with the mouse to resize
}
decoration {
rounding = 10 # Rounded corners of 10px
blur = true
blur_size = 10
blur_passes = 3
active_opacity = 0.9
inactive_opacity = 0.9
}
input {
kb_layout = us
# TODO: standardize the touchpad settings.
# Right now I also have similar settings for xorg.
touchpad {
natural_scroll = true # Invert scrolling direction
}
}
gestures {
workspace_swipe = true
workspace_swipe_fingers = 3
}
# Execute apps at launch
exec-once = NO_TMUX=1 wezterm & firefox & discord
# {{{ Window rules
# {{{ Automatically move stuff to workspaces
windowrulev2 = workspace 2 silent, title:^(.*Firefox.*)$
windowrulev2 = workspace 3 silent, title:^(.*(Disc|WebC)ord.*)$
windowrulev2 = workspace 6 silent, title:^(.*Spotify.*)$
# }}}
# {{{ Idleinhibit rules
# - while firefox is fullscreen
windowrulev2 = idleinhibit fullscreen, class:^(firefox)$
# - while watching videos
windowrulev2 = idleinhibit focus, class:^(mpv|.+exe)$
windowrulev2 = idleinhibit focus, class:^(firefox)$, title:^(.*YouTube.*)$
# }}}
# }}}
# {{{ Keybinds
$mod = SUPER
#u {{{ General
bind = $mod, C, killactive, # Kill current
bind = $mod, F, fullscreen, # Fullscreen
# Execute external things
bind = $mod, return, exec, NO_TMUX=1 wezterm # Launch wezterm
bind = $mod, T, exec, wl-ocr # Use ocr script
bind = $mod SHIFT, T, exec, hyprpicker | wl-copy && libnotify "Copied color $(wp-paste)" # Color picker
bind = $mod, Q, exec, wlogout # Show logout menu
bind = $mod, L, exec, loginctl lock-session # Lock screen
bind = $mod, P, exec, wofi --show drun # Launch app
# Work with the special workspace
bind = $mod, x, togglespecialworkspace,
bind = $mod SHIFT, x, movetoworkspace, special
# }}}
# {{{ Screenshotting
bind = $mod, S, exec, grimblast --notify copysave area
bind = $mod SHIFT, S, exec, grimblast --notify copysave active
bind = $mod CONTROL, S, exec, grimblast --notify copysave screen
# }}}
# {{{ Grouping
bind = $mod, G, togglegroup,
bind = $mod SHIFT, D, changegroupactive, f
bind = $mod SHIFT, S, changegroupactive, b
# }}}
# {{{ Mouse move/resize
# Move/resize windows with mod + LMB/RMB and dragging
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow
# }}}
# {{{ Move focus
bind = $mod, h, movefocus, l
bind = $mod, l, movefocus, r
bind = $mod, k, movefocus, u
bind = $mod, j, movefocus, d
# }}}
# {{{ Switch to workspace
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10
# }}}
# {{{ Send to workspace
# Move active window to a workspace with mod + SHIFT + [0-9]
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10
# }}}
# {{{ Resize
bind=SUPER,R,submap,resize
submap=resize
# sets repeatable binds for resizing the active window
binde=,l,resizeactive,10 0
binde=,h,resizeactive,-10 0
binde=,k,resizeactive,0 -10
binde=,j,resizeactive,0 10
bind=,escape,submap,reset
submap=reset
# }}}
# }}}

View file

@ -0,0 +1,23 @@
{ pkgs, config, ... }:
let
base16-wofi = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromSourcehut {
owner = "~knezi";
repo = "base16-wofi";
rev = "2182a5ad36d372e625b3d8e1a20ba7447e77ed22";
sha256 = "0hzn9lgh7rzahmzzdsgxnz4f8vvcpx5diwsnc7gb29gj9nbb1a8f";
};
};
in
{
programs.wofi = {
enable = true;
settings = {
allow_markup = true;
allow_images = true;
};
};
# xdg.configFile."wofi/style.css".source = base16-wofi;
}

View file

@ -0,0 +1,15 @@
{ pkgs, ... }: {
imports = [
../desktop/eww
./rofi
./polybar
./feh.nix
];
# Other packages I want to install:
home.packages = with pkgs; [
xclip # Clipboard stuff
spectacle # Take screenshots
vimclip # Vim anywhere!
];
}

View file

@ -0,0 +1,5 @@
{ config, pkgs, ... }:
{
xsession.initExtra =
"${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}";
}

View file

@ -0,0 +1,33 @@
{ pkgs, lib, paths, config, ... }:
let
base16-polybar = config.lib.stylix.colors {
template = builtins.readFile ./template.mustache;
};
script = ''
polybar main &
'';
in
{
services.polybar = {
enable = true;
script = ""; # Otherwise this tries starting on wayland
extraConfig = ''
; Generated theme
include-file = ${base16-polybar}
; Consistent fonts
[fonts]
regular = "${config.stylix.fonts.sansSerif.name}"
monospace = "${config.stylix.fonts.monospace.name}"
; Actual config
${builtins.readFile ./polybar.ini}
'';
};
xsession = {
enable = true;
initExtra = script;
};
}

View file

@ -0,0 +1,113 @@
[module/battery]
type = internal/battery
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC
format-charging = <animation-charging> <label-charging>
format-discharging = <animation-discharging> <label-discharging>
format-low = <animation-low> <label-low>
; Only applies if <animation-charging> is used
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
; Framerate in milliseconds
animation-charging-framerate = 750
; Only applies if <animation-discharging> is used
animation-discharging-0 =
animation-discharging-1 =
animation-discharging-2 =
animation-discharging-3 =
animation-discharging-4 =
; Framerate in milliseconds
animation-discharging-framerate = 500
; Only applies if <animation-low> is used
; New in version 3.6.0
animation-low-0 = !
animation-low-1 =
animation-low-framerate = 200
[module/cpu]
type = internal/cpu
[module/date]
type = internal/date
date = %d-%m-%Y%
time = %H:%M
label =  %date%  %time%
[module/wireless-network]
type = internal/network
interface = wlp0s20f3
format-connected = <label-connected>
format-packetloss = <animation-packetloss> <label-connected>
format-disconnected = <label-disconnected>
label-connected =  %essid%  %downspeed%  %upspeed%
label-disconnected =
label-packetloss = %essid%
animation-packetloss-0 =
animation-packetloss-0-foreground = ${colors.base08}
animation-packetloss-1 = 📶
animation-packetloss-1-foreground = ${colors.base00}
animation-packetloss-framerate = 500
[module/ewmh]
type = internal/xworkspaces
icon-0 = 1:dev;
icon-1 = 2:browser;
icon-2 = 3:chat;ﭮ
icon-3 = 4:terminal;
icon-4 = 5:reading;
icon-5 = 6:music;
icon-6 = 7:gaming;
icon-default =
format = <label-state>
label-active = %icon%
label-active-background = ${colors.base05}
label-active-foreground = ${colors.base00}
label-active-padding = 2
label-urgent = %icon%
label-urgent-background = ${colors.base09}
label-urgent-foreground = ${colors.base00}
label-urgent-padding = 2
label-occupied = %icon%
label-occupied-padding = 2
label-empty =
[bar/main]
font-0 = ${fonts.monospace}
modules-left = date battery
modules-center = ewmh
modules-right = wireless-network
padding-right = 2
padding-left = 2
padding-top = 4
module-margin = 2
height=4%
border-top-size = 1
border-top-color= ${colors.base05}
background = ${colors.base00}
foreground = ${colors.base05}
bottom = true

View file

@ -0,0 +1,17 @@
[colors]
base00 = {{base00-hex}}
base01 = {{base01-hex}}
base02 = {{base02-hex}}
base03 = {{base03-hex}}
base04 = {{base04-hex}}
base05 = {{base05-hex}}
base06 = {{base06-hex}}
base07 = {{base07-hex}}
base08 = {{base08-hex}}
base09 = {{base09-hex}}
base0A = {{base0A-hex}}
base0B = {{base0B-hex}}
base0C = {{base0C-hex}}
base0D = {{base0D-hex}}
base0E = {{base0E-hex}}
base0F = {{base0F-hex}}

View file

@ -0,0 +1,21 @@
configuration {
location: 0;
cycle: true;
modi: "run,drun,window";
icon-theme: "Oranchelo";
show-icons: true;
terminal: "alacritty";
drun-display-format: "{icon} {name}";
disable-history: false;
hide-scrollbar: true;
display-drun: "  Apps ";
display-run: "  Run ";
display-window: " 﩯 Window";
display-Network: " 󰤨 Network";
}
window {
border: 3px;
height: 50%;
width: 50%;
}

View file

@ -0,0 +1,28 @@
{ pkgs, config, ... }:
let
base16-rofi = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-rofi";
sha256 = "03y4ydnd6sijscrrp4qdvckrckscd39r8gyhpzffs60a1w4n76j5";
rev = "3f64a9f8d8cb7db796557b516682b255172c4ab4";
};
};
in
{
home.packages = with pkgs; [ rofi ];
xdg.configFile."rofi/base16.rasi".source = base16-rofi;
xdg.configFile."rofi/config.rasi".text = ''
// Manual config
${builtins.readFile ./config.rasi}
// Inject font
configuration {
font: "${config.stylix.fonts.monospace.name}";
}
// Theme
@import "base16"
'';
}

View file

@ -0,0 +1,9 @@
{ pkgs, ... }: {
imports = [
./default.nix
../desktop/alacritty.nix # Default xmonad terminal
];
# Command required to get the xdg stuff to work. Suggested by @lily on discord.
xsession.initExtra = "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all";
}