From 14ba7f2d51cdaa286211aedd3b4b32fcd3c869ad Mon Sep 17 00:00:00 2001 From: Reboot-Codes Date: Thu, 24 Oct 2024 11:47:16 -0700 Subject: [PATCH] Add generic linux config. --- .gitignore | 1 + common/home.nix | 386 ++++++++++------------ flake.lock | 22 +- flake.nix | 26 +- hosts/generic-amd64-linux-gui/default.nix | 17 + hosts/ressd-loki-nixos/configuration.nix | 6 + hosts/ressd-loki-nixos/default.nix | 2 + hosts/ressd-loki-nixos/home.nix | 21 +- 8 files changed, 246 insertions(+), 235 deletions(-) create mode 100644 .gitignore create mode 100644 hosts/generic-amd64-linux-gui/default.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/common/home.nix b/common/home.nix index a2cd609..1da02c7 100644 --- a/common/home.nix +++ b/common/home.nix @@ -1,229 +1,209 @@ # This file has general setting configs to make sure that our experiences are consistent. -{ config, pkgs, pkgs-stable, ...}: { - home-manager.users."reboot" = { - nixpkgs.overlays = [ - (final: prev: { - spotify = prev.spotify // { - installPhase = - builtins.replaceStrings [ - "runHook postInstall" - '' - bash <(curl -sSL https://spotx-official.github.io/run.sh) -P "$out/share/spotify" - runHook postInstall - '' - ] - prev.spotify.installPhase; - }; - }) - ]; - - programs = { - home-manager.enable = true; - - # TODO: Translate alacritty config. +{ config, pkgs, pkgs-stable, home-manager, ...}: { + programs = { + home-manager.enable = true; - zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - autocd = true; + # TODO: Translate alacritty config. - # TODO: Translate oh-my-zsh plugins. + zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + autocd = true; - envExtra = '' - PATH=$PATH":/home/reboot/dev/bin:/home/reboot/bin" - - export CARGO_MOMMYS_PRONOUNS="his/their" - export CARGO_MOMMYS_LITTLE="boy/pup/puppy" - export CARGO_MOMMYS_ROLES="daddy/master/owner/handler" - export CARGO_MOMMYS_MOODS="chill/ominous/thirsty/yikes" - export CARGO_MOMMYS_PARTS="milk/dick/ass/paws/pits/pecs/muscles/musk/piss/balls" - export CARGO_MOMMYS_FUCKING="slut/toy/pet/pervert/whore/pup/cocksleeve/puppy" + # TODO: Translate oh-my-zsh plugins. - source ~/dev/scripts/remind.sh - - if [ "$SSH_CLIENT" ]; then - export PINENTRY_USER_DATA=pinentry-curses + envExtra = '' + PATH=$PATH":/home/reboot/dev/bin:/home/reboot/bin" + + export CARGO_MOMMYS_PRONOUNS="his/their" + export CARGO_MOMMYS_LITTLE="boy/pup/puppy" + export CARGO_MOMMYS_ROLES="daddy/master/owner/handler" + export CARGO_MOMMYS_MOODS="chill/ominous/thirsty/yikes" + export CARGO_MOMMYS_PARTS="milk/dick/ass/paws/pits/pecs/muscles/musk/piss/balls" + export CARGO_MOMMYS_FUCKING="slut/toy/pet/pervert/whore/pup/cocksleeve/puppy" + + source ~/dev/scripts/remind.sh + + if [ "$SSH_CLIENT" ]; then + export PINENTRY_USER_DATA=pinentry-curses + fi + + unset SSH_AGENT_PID + if [ "''\${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + fi + export GPG_TTY=$(tty) + gpg-connect-agent updatestartuptty /bye >/dev/null + + # Created by `pipx` on 2024-03-24 18:26:33 + export PATH="$PATH:/home/reboot/.local/bin" + + alias sclear="clear; fastfetch && fortune | lolcat" + alias cargo-daddy="cargo-mommy" + alias wayback-download="wget --recursive --no-clobber --page-requisites --convert-links --domains web.archive.org --no-parent" + + # Check if this session is interactive (fix `scp` lmao) + if [[ $- == *i* ]]; then + # Runs tmux on ssh conn, see: https://stackoverflow.com/a/40192494 + if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then + tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux fi - unset SSH_AGENT_PID - if [ "''\${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - fi - export GPG_TTY=$(tty) - gpg-connect-agent updatestartuptty /bye >/dev/null - - # Created by `pipx` on 2024-03-24 18:26:33 - export PATH="$PATH:/home/reboot/.local/bin" - - alias sclear="clear; fastfetch && fortune | lolcat" - alias cargo-daddy="cargo-mommy" - alias wayback-download="wget --recursive --no-clobber --page-requisites --convert-links --domains web.archive.org --no-parent" - - # Check if this session is interactive (fix `scp` lmao) - if [[ $- == *i* ]]; then - # Runs tmux on ssh conn, see: https://stackoverflow.com/a/40192494 - if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then - tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux - fi - - fastfetch - fortune | lolcat - fi - ''; - }; + fastfetch + fortune | lolcat + fi + ''; + }; - git = { - userName = "Reboot-Codes"; - userEmail = "git@reboot-codes.com"; + git = { + userName = "Reboot-Codes"; + userEmail = "git@reboot-codes.com"; - signing = { - key = "F4DB81CBA107C76D0F7A75B18A0D03A6C3DCBA53"; - signByDefault = true; - }; + signing = { + key = "F4DB81CBA107C76D0F7A75B18A0D03A6C3DCBA53"; + signByDefault = true; }; + }; - neovim = { - enable = true; - defaultEditor = true; - vimAlias = true; - viAlias = true; + neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + viAlias = true; - plugins = with pkgs; [ - vimPlugins.lightline-vim - ]; + plugins = with pkgs; [ + vimPlugins.lightline-vim + ]; - # TODO: Configure lightline. - }; + # TODO: Configure lightline. + }; - starship = { - enable = true; + starship = { + enable = true; + + settings = { + format = "$username$hostname$directory$all$line_break$character"; - settings = { - format = "$username$hostname$directory$all$line_break$character"; - - directory = { - read_only = " "; - repo_root_style = "underline bold cyan"; - }; - - character = { - success_symbol = "[➜](bold green) "; - error_symbol = "[➜](bold red) "; - }; - - username.show_always = true; - aws.symbol = " "; - buf.symbol = " "; - c.symbol = " "; - conda.symbol = " "; - dart.symbol = " "; - docker_context.symbol = " "; - elixir.symbol = " "; - elm.symbol = " "; - git_branch.symbol = " "; - golang.symbol = " "; - haskell.symbol = " "; - hg_branch.symbol = " "; - java.symbol = " "; - julia.symbol = " "; - memory_usage.symbol = " "; - nim.symbol = " "; - nix_shell.symbol = " "; - nodejs.symbol = " "; - package.symbol = " "; - python.symbol = " "; - spack.symbol = "🅢 "; - rust.symbol = " "; + directory = { + read_only = " "; + repo_root_style = "underline bold cyan"; + }; + + character = { + success_symbol = "[➜](bold green) "; + error_symbol = "[➜](bold red) "; }; - }; - tmux = { - enable = true; - mouse = true; - shortcut = "a"; - historyLimit = 500000; - - extraConfig = '' - # Use CRTL+A, | to split horizontally - bind | split-window -h - # Use CRTL+A, - to split vertically - bind - split-window -v - # Remove old splitting keybinds - unbind '"' - unbind % - - # Use CRTL+A, R to reload the config. - bind r source-file ~/.config/tmux/tmux.conf - - # Use CRTL+A, q to close a pane (window) - bind q killp - - # Use ALT+[ARROW] to switch between panes. - bind -n M-Left select-pane -L - bind -n M-Right select-pane -R - bind -n M-Up select-pane -U - bind -n M-Down select-pane -D - - # Enable mouse mode by default. - set -g mouse on - - # DESIGN TWEAKS, see: https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ - # don't do anything when a 'bell' rings - set -g visual-activity off - set -g visual-bell off - set -g visual-silence off - setw -g monitor-activity off - set -g bell-action none - - # clock mode - setw -g clock-mode-colour colour1 - - # copy mode - setw -g mode-style 'fg=colour1 bg=colour18 bold' - - # pane borders - set -g pane-border-style 'fg=colour6' - set -g pane-active-border-style 'fg=colour3' - - # statusbar - set -g status-position bottom - set -g status-justify left - set -g status-style 'fg=colour6' - set -g status-left "" - set -g status-right '%Y-%m-%d %H:%M ' - set -g status-right-length 50 - set -g status-left-length 10 - - setw -g window-status-current-style 'fg=colour0 bg=colour6 bold' - setw -g window-status-current-format ' #I #W #F ' - - setw -g window-status-style 'fg=colour7 dim' - setw -g window-status-format ' #I #[fg=colour7]#W #[fg=colour1]#F ' - - setw -g window-status-bell-style 'fg=colour2 bg=colour1 bold' - - # messages - set -g message-style 'fg=colour2 bg=colour0 bold' - ''; + username.show_always = true; + aws.symbol = " "; + buf.symbol = " "; + c.symbol = " "; + conda.symbol = " "; + dart.symbol = " "; + docker_context.symbol = " "; + elixir.symbol = " "; + elm.symbol = " "; + git_branch.symbol = " "; + golang.symbol = " "; + haskell.symbol = " "; + hg_branch.symbol = " "; + java.symbol = " "; + julia.symbol = " "; + memory_usage.symbol = " "; + nim.symbol = " "; + nix_shell.symbol = " "; + nodejs.symbol = " "; + package.symbol = " "; + python.symbol = " "; + spack.symbol = "🅢 "; + rust.symbol = " "; }; + }; - # TODO: Configure KDE with `qt.kde.settings` + tmux = { + enable = true; + mouse = true; + shortcut = "a"; + historyLimit = 500000; + + extraConfig = '' + # Use CRTL+A, | to split horizontally + bind | split-window -h + # Use CRTL+A, - to split vertically + bind - split-window -v + # Remove old splitting keybinds + unbind '"' + unbind % + + # Use CRTL+A, R to reload the config. + bind r source-file ~/.config/tmux/tmux.conf + + # Use CRTL+A, q to close a pane (window) + bind q killp + + # Use ALT+[ARROW] to switch between panes. + bind -n M-Left select-pane -L + bind -n M-Right select-pane -R + bind -n M-Up select-pane -U + bind -n M-Down select-pane -D + + # Enable mouse mode by default. + set -g mouse on + + # DESIGN TWEAKS, see: https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ + # don't do anything when a 'bell' rings + set -g visual-activity off + set -g visual-bell off + set -g visual-silence off + setw -g monitor-activity off + set -g bell-action none + + # clock mode + setw -g clock-mode-colour colour1 + + # copy mode + setw -g mode-style 'fg=colour1 bg=colour18 bold' + + # pane borders + set -g pane-border-style 'fg=colour6' + set -g pane-active-border-style 'fg=colour3' + + # statusbar + set -g status-position bottom + set -g status-justify left + set -g status-style 'fg=colour6' + set -g status-left "" + set -g status-right '%Y-%m-%d %H:%M ' + set -g status-right-length 50 + set -g status-left-length 10 + + setw -g window-status-current-style 'fg=colour0 bg=colour6 bold' + setw -g window-status-current-format ' #I #W #F ' + + setw -g window-status-style 'fg=colour7 dim' + setw -g window-status-format ' #I #[fg=colour7]#W #[fg=colour1]#F ' + + setw -g window-status-bell-style 'fg=colour2 bg=colour1 bold' + + # messages + set -g message-style 'fg=colour2 bg=colour0 bold' + ''; }; - services = { - gpg-agent = { - enable = true; - enableExtraSocket = true; - enableSshSupport = true; - sshKeys = [ "F4DB81CBA107C76D0F7A75B18A0D03A6C3DCBA53" ]; - }; + # TODO: Configure KDE with `qt.kde.settings` + }; - # TODO: Configure syncthing + services = { + gpg-agent = { + enable = true; + enableExtraSocket = true; + enableSshSupport = true; + sshKeys = [ "F4DB81CBA107C76D0F7A75B18A0D03A6C3DCBA53" ]; }; - - # TODO: Translate alt DE configs (hyprland, hyprpapr, dunst, waybar) }; + + # TODO: Translate alt DE configs (hyprland, hyprpapr, dunst, waybar) } diff --git a/flake.lock b/flake.lock index 73d0450..e89b1a0 100644 --- a/flake.lock +++ b/flake.lock @@ -98,7 +98,9 @@ }, "flatpaks": { "inputs": { - "nixpkgs": "nixpkgs_2", + "nixpkgs": [ + "nixpkgs" + ], "utils": "utils" }, "locked": { @@ -235,22 +237,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1727907660, - "narHash": "sha256-QftbyPoieM5M50WKUMzQmWtBWib/ZJbHo7mhj5riQec=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5966581aa04be7eff830b9e1457d56dc70a0b798", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1728492678, "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", @@ -287,7 +273,7 @@ "chaotic": "chaotic", "flatpaks": "flatpaks", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable", "nur": "nur", "rust-overlay": "rust-overlay" diff --git a/flake.nix b/flake.nix index 83dd145..2be3f37 100755 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,10 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - flatpaks.url = "github:GermanBread/declarative-flatpak/stable-v3"; + flatpaks = { + url = "github:GermanBread/declarative-flatpak/stable-v3"; + inputs.nixpkgs.follows = "nixpkgs"; + }; rust-overlay = { url = "github:oxalica/rust-overlay"; @@ -71,22 +74,19 @@ { imports = [ aagl.nixosModules.default ]; nix.settings = aagl.nixConfig; # Set up Cachix - - programs = { - anime-game-launcher.enable = true; # Adds launcher and /etc/hosts rules - anime-games-launcher.enable = true; - honkers-railway-launcher.enable = true; - honkers-launcher.enable = true; - wavey-launcher.enable = true; - sleepy-launcher.enable = true; - }; } - # My configurations. - ./hosts/ressd-loki-nixos/default.nix # System specific system-level and user-level configurations. - ./common/home.nix # Global homedir config + ./hosts/ressd-loki-nixos/default.nix # Our Configs ]; }; }; + + # For *nix systems that are not NixOS or macOS + homeConfigurations = { + "reboot" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + modules = [ ./hosts/generic-amd64-linux-gui/default.nix ]; + }; + }; }; } diff --git a/hosts/generic-amd64-linux-gui/default.nix b/hosts/generic-amd64-linux-gui/default.nix new file mode 100644 index 0000000..e459a66 --- /dev/null +++ b/hosts/generic-amd64-linux-gui/default.nix @@ -0,0 +1,17 @@ +{ config, pkgs, pkgs-stable, home-manager, ...}: { + imports = [ ../../common/home.nix ]; + + home = { + stateVersion = "24.11"; + username = "reboot"; + homeDirectory = "/home/reboot"; + + packages = with pkgs; [ + pinentry.qt + ]; + }; + + services.gpg-agent = { + pinentryPackage = pkgs.pinentry.qt; + }; +} diff --git a/hosts/ressd-loki-nixos/configuration.nix b/hosts/ressd-loki-nixos/configuration.nix index f649dad..3aceecb 100644 --- a/hosts/ressd-loki-nixos/configuration.nix +++ b/hosts/ressd-loki-nixos/configuration.nix @@ -276,6 +276,12 @@ programs = { nix-ld.enable = true; appimage.binfmt = true; + anime-game-launcher.enable = true; # Adds launcher and /etc/hosts rules + anime-games-launcher.enable = true; + honkers-railway-launcher.enable = true; + honkers-launcher.enable = true; + wavey-launcher.enable = true; + sleepy-launcher.enable = true; zsh = { enable = true; diff --git a/hosts/ressd-loki-nixos/default.nix b/hosts/ressd-loki-nixos/default.nix index 114f596..300718b 100644 --- a/hosts/ressd-loki-nixos/default.nix +++ b/hosts/ressd-loki-nixos/default.nix @@ -1,3 +1,5 @@ { imports = [ ./configuration.nix ./home.nix ]; + + home-manager.users."reboot" = ../../common/home.nix; } \ No newline at end of file diff --git a/hosts/ressd-loki-nixos/home.nix b/hosts/ressd-loki-nixos/home.nix index 5a1febb..d1d226b 100644 --- a/hosts/ressd-loki-nixos/home.nix +++ b/hosts/ressd-loki-nixos/home.nix @@ -1,16 +1,35 @@ # Home-Manager Module by Reboot-Codes on 2024-08-02 { config, pkgs, pkgs-stable, ...}: { home-manager = { + backupFileExtension = "hm-bak"; + useGlobalPkgs = true; useUserPackages = true; - backupFileExtension = "hm-bak"; users."reboot" = { + nixpkgs.overlays = [ + (final: prev: { + spotify = prev.spotify // { + installPhase = + builtins.replaceStrings [ + "runHook postInstall" + '' + bash <(curl -sSL https://spotx-official.github.io/run.sh) -P "$out/share/spotify" + runHook postInstall + '' + ] + prev.spotify.installPhase; + }; + }) + ]; + xdg.desktopEntries."renpy" = { name = "RenPy"; exec = "${pkgs.renpy}/bin/renpy"; }; + # TODO: Configure syncthing + home = { stateVersion = "23.11"; username = "reboot"; -- 2.51.2