diff --git a/flake.nix b/flake.nix index 443cb75..9da7a40 100644 --- a/flake.nix +++ b/flake.nix @@ -91,6 +91,14 @@ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) ./machines/aragon/configuration.nix sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users."gunalx" = import ./home/gunalx/full.nix; + home-manager.users."root" = import ./home/root/base.nix; + home-manager.backupFileExtension = "bac"; + home-manager.extraSpecialArgs = {inherit nix-colors inputs;}; + } ]; }; @@ -105,6 +113,17 @@ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) ./machines/galadriel/configuration.nix sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users."gunalx" = import ./home/gunalx/base.nix; + home-manager.users."root" = import ./home/root/base.nix; + home-manager.backupFileExtension = "bac"; + home-manager.extraSpecialArgs = {inherit nix-colors inputs;}; + } + + + ozai.nixosModules.ozai ozai-webui.nixosModules.ozai-webui diff --git a/home/common/atuin.nix b/home/common/atuin.nix new file mode 100644 index 0000000..bd875f6 --- /dev/null +++ b/home/common/atuin.nix @@ -0,0 +1,54 @@ +{ pkgs, ... }: + +{ + programs.atuin = { + enable = true; + settings = { + # Data files + db_path = "~/.history.db"; + + # Filtering + filter_mode = "host"; + filter_mode_shell_up_key_binding = "directory"; + + # UI + max_preview_height = 2; + show_help = true; + prefers_reduced_motion = true; + + # History storage + secrets_filter = true; + enter_accept = true; + + # Sync v2 + sync = { + records = true; + }; + + # Stats + stats = { + common_subcommands = [ + "apt" "cargo" "composer" "dnf" "docker" "git" "go" "ip" + "kubectl" "nix" "nmcli" "npm" "pecl" "pnpm" "podman" + "port" "systemctl" "tmux" "yarn" + ]; + common_prefix = [ "sudo" ]; + }; + + # Keys + keys = { + scroll_exits = true; + }; + + # Theme + theme = { + name = "marine"; + }; + + # Search + search = { + filters = [ "directory" "host" "session" ]; + }; + }; + }; +} diff --git a/home/gunalx/base.nix b/home/gunalx/base.nix index 4b830bd..a3cb2c7 100644 --- a/home/gunalx/base.nix +++ b/home/gunalx/base.nix @@ -3,6 +3,7 @@ imports = [ ../common/sshconfig.nix ../common/unfree.nix + ../common/atuin.nix ]; programs.nix-index = { diff --git a/home/root/base.nix b/home/root/base.nix index 4b830bd..a3cb2c7 100644 --- a/home/root/base.nix +++ b/home/root/base.nix @@ -3,6 +3,7 @@ imports = [ ../common/sshconfig.nix ../common/unfree.nix + ../common/atuin.nix ]; programs.nix-index = { diff --git a/machines/galadriel/configuration.nix b/machines/galadriel/configuration.nix index c682c88..ebc67b6 100644 --- a/machines/galadriel/configuration.nix +++ b/machines/galadriel/configuration.nix @@ -19,7 +19,7 @@ ../../profiles/mediaserver.nix #../../services/smb.nix - ../../services/wordpress.nix + #../../services/wordpress.nix # lets not ../../services/torrent.nix #../../services/ozai.nix #../../services/stableDiffusion.nix diff --git a/machines/galadriel/nvidia.nix b/machines/galadriel/nvidia.nix index cd49aa9..94e9e3e 100644 --- a/machines/galadriel/nvidia.nix +++ b/machines/galadriel/nvidia.nix @@ -42,9 +42,9 @@ cudaPackages.cudatoolkit cudaPackages.cudnn nvtopPackages.nvidia - gcc + #gcc cudaPackages.nccl - cmake + #cmake #llama-cpp #python3Packages.pip #cudaPackages.cuda_cudart diff --git a/profiles/base.nix b/profiles/base.nix index 84b4881..0d347da 100644 --- a/profiles/base.nix +++ b/profiles/base.nix @@ -1,4 +1,7 @@ { config, pkgs, lib, ... }: +let + mkDefault = lib.mkDefault; +in { imports = [ @@ -23,12 +26,14 @@ imports = foot.terminfo tailscale sops + atuin + upower ]; #just allow unfree, im fine with it. nixpkgs.config.allowUnfree = true; - zramSwap = { + zramSwap = mkDefault { enable = true; memoryPercent = 25; }; @@ -41,7 +46,7 @@ imports = i18n.defaultLocale = "en_US.UTF-8"; # Configure console - console = { + console = mkDefault { font = "Lat2-Terminus16"; keyMap = "no"; }; @@ -68,19 +73,57 @@ imports = dc="cd"; la="ls -la"; lls="ls"; - }; + battery="upower -i $(upower -e | grep 'BAT') | grep -E 'state|to full|percentage'"; + cim="vim"; + cbuild="mkdir build && cd build && cmake .. && make"; + untar="tar -xvf"; + }; + + environment.interactiveShellInit = '' - alias gst='git status' - alias gcm='git commit -m' - alias gca='git commit --amend' - alias gsw='git switch' - alias gaa='git add -A' - alias gb='git branch' - alias dc='cd' - alias la='ls -la' - alias lls='ls' + # Colors + RESET='\[\e[0m\]' + BOLD='\[\e[1m\]' + CYAN='\[\e[36m\]' + GREEN='\[\e[32m\]' + BLUE='\[\e[34m\]' + YELLOW='\[\e[33m\]' + MAGENTA='\[\e[35m\]' + RED='\[\e[31m\]' + + if [[ -n "$SSH_CONNECTION" ]]; then + REMOTE_LABEL="\[''${YELLOW}\] (ssh)\[''${RESET}\]" + else + REMOTE_LABEL="" + fi + + # Git branch function + parse_git_branch() { + git branch --show-current 2>/dev/null | awk '{print " (" $1 ")"}' + } + + + # Set prompt + if [[ $EUID -eq 0 ]]; then + PS1="''${BOLD}''${RED}\u''${RESET}:''${BOLD}''${RED}\h''${REMOTE_LABEL}''${RESET}:''${BOLD}''${GREEN}\w''${MAGENTA}\$(parse_git_branch) ''${BLUE}\A''${RESET}\$ " + else + PS1="''${BOLD}''${CYAN}\u''${RESET}:''${BOLD}''${CYAN}\h''${REMOTE_LABEL}''${RESET}:''${BOLD}''${GREEN}\w''${MAGENTA}\$(parse_git_branch) ''${BLUE}\A''${RESET}\$ " + fi ''; + +# environment.interactiveShellInit = '' +# alias gst='git status' +# alias gcm='git commit -m' +# alias gca='git commit --amend' +# alias gsw='git switch' +# alias gaa='git add -A' +# alias gb='git branch' +# alias dc='cd' +# alias la='ls -la' +# alias lls='ls' +# ''; +# ## some insecure packages nixpkgs.config.permittedInsecurePackages = [ @@ -94,9 +137,9 @@ imports = }; #nix stuff - nix.gc.automatic = true; + nix.gc.automatic = mkDefault true; nix = { - extraOptions = '' + extraOptions = mkDefault '' builders-use-substitutes = true experimental-features = nix-command flakes impure-derivations ca-derivations !include ${config.sops.secrets."github/api".path} @@ -139,7 +182,15 @@ imports = # maxJobs = 4; # # i7-6700 # speedFactor = 8088; - # } + # } + { hostName = "localhost"; + system = "x86_64-linux"; + maxJobs = 4; + #speedFactor = 8066; + speedFactor = 8000; + supportedFeatures = [ ]; + mandatoryFeatures = [ ]; + } { hostName = "aragon"; system = "x86_64-linux"; # if the builder supports building for multiple architectures, diff --git a/profiles/mediaserver.nix b/profiles/mediaserver.nix index b39879e..632cde8 100644 --- a/profiles/mediaserver.nix +++ b/profiles/mediaserver.nix @@ -3,7 +3,7 @@ imports = [ ./base.nix - ../services/podgrab.nix + #../services/podgrab.nix # not maintained ../services/jellyfin.nix ];