From 20a6996fbeaac40b75fd9e4bc07c6d73efae6e0d Mon Sep 17 00:00:00 2001 From: Riley Apeldoorn Date: Tue, 23 May 2023 17:38:19 +0200 Subject: [PATCH] Fix dev-lt-63 env --- shared/home/bash.nix | 42 ++++++++++++++++++++++++++++++++-- shared/home/default.nix | 6 +++-- shared/home/gui/sway.nix | 16 ++++++++----- shared/home/gui/term.nix | 2 +- shared/home/nix.nix | 19 --------------- shared/home/nix/default.nix | 20 ++++++++++++++++ shared/home/nix/nix-config.nix | 3 +++ shared/home/programs.nix | 6 ++++- shared/overlay.nix | 2 +- system/dev-lt-63/home.nix | 2 ++ 10 files changed, 86 insertions(+), 32 deletions(-) delete mode 100644 shared/home/nix.nix create mode 100644 shared/home/nix/default.nix create mode 100644 shared/home/nix/nix-config.nix diff --git a/shared/home/bash.nix b/shared/home/bash.nix index 58d40b2..204d218 100644 --- a/shared/home/bash.nix +++ b/shared/home/bash.nix @@ -16,11 +16,49 @@ in with lib; { config = { # Configure the shell itself - programs.bash = { + programs.bash = with pkgs; { enable = true; + historyIgnore = [ + "poweroff" + "reboot" + "exit" + "exa" + "fg" + "cd" + "ls" + "z" + ]; + historyControl = [ + "ignorespace" + "ignoredups" + ]; + historySize = 100000; + sessionVariables = { + "EDITOR" = "${helix}/bin/hx"; + }; shellAliases = { + # General aliases ":q" = "exit"; - "t" = "exa -T"; + "t" = "${exa}/bin/exa -T"; + ".." = "cd .."; + + # Git command aliases + "rebase" = "git rebase -i --autosquash --committer-date-is-author-date"; + "uncommit" = "git reset --soft HEAD~"; + + # Git selectors + ".changed" = "git diff --name-only"; + ".conflicted" = "git status --porcelain | rg '^UU' | sd '^.. ' ''"; + ".branches" = "git branch -a | rg -v '\*|HEAD' | sd 'remotes/origin/' '' | sd '^ *' '' | uniq"; + + # File extension selectors + ".hs" = "${fd}/bin/fd -e hs"; + ".nix" = "${fd}/bin/fd -e nix"; + ".py" = "${fd}/bin/fd -e py"; + ".rs" = "${fd}/bin/fd -e rs"; + ".sh" = "${fd}/bin/fd -e sh"; + ".yaml" = "${fd}/bin/fd -e yaml -e yml"; + ".yml" = ".yaml"; } // cfg.extraAliases; }; diff --git a/shared/home/default.nix b/shared/home/default.nix index d940327..6c50e74 100644 --- a/shared/home/default.nix +++ b/shared/home/default.nix @@ -5,11 +5,11 @@ imports = [ ./bash.nix ./git.nix - ./nix.nix ./mpd.nix ./programs.nix ./theme.nix ./gui + ./nix ]; options.isNixos = lib.mkOption { @@ -17,6 +17,8 @@ default = false; }; - config.theme = import ../../themes/lean.nix; + config = { + theme = import ../../themes/lean.nix; + }; } \ No newline at end of file diff --git a/shared/home/gui/sway.nix b/shared/home/gui/sway.nix index 3c6cb85..ad07dc5 100644 --- a/shared/home/gui/sway.nix +++ b/shared/home/gui/sway.nix @@ -31,6 +31,8 @@ in with lib; { config = mkIf (cfg.enable) { home.packages = with pkgs; [ + kitty + swaylock wl-clipboard (writeScriptBin "c" '' ${wl-clipboard}/bin/wl-copy @@ -40,9 +42,9 @@ in with lib; { '') ]; - programs.swaylock.enable = true; + # programs.swaylock.enable = true; + # services.swayidle.enable = true; programs.waybar.enable = true; - services.swayidle.enable = true; wayland.windowManager.sway = { # This is all required to get it to not die. @@ -54,7 +56,7 @@ in with lib; { output."*".bg = "${../../data/wallpaper.jpg} fill"; input."type:keyboard".xkb_options = "caps:escape"; - terminal = "${pkgs.kitty}/bin/kitty"; + terminal = "kitty --single-instance"; # Directional keys modifier = mod; @@ -83,9 +85,11 @@ in with lib; { "${mod}+Alt+a" = "layout toggle stacking splitv"; "${mod}+Alt+s" = "layout toggle tabbed splith"; - "${mod}+Return" = "exec ${terminal}"; - "${mod}+Escape" = "exec ${pkgs.swaylock}/bin/swaylock"; - "${mod}+Tab" = "exec ${pkgs.firefox}/bin/firefox"; + "${mod}+q" = "exec ${pkgs.foot}/bin/foot"; + "${mod}+Return" = "exec ${terminal}"; + "${mod}+Escape" = "exec swaylock"; + "${mod}+Tab" = "exec ${pkgs.firefox}/bin/firefox"; + "${mod}+Alt+Tab" = "exec ${pkgs.google-chrome}/bin/google-chrome-stable"; "${mod}+Backspace" = "mode kill"; } diff --git a/shared/home/gui/term.nix b/shared/home/gui/term.nix index 356a9a3..579dbda 100644 --- a/shared/home/gui/term.nix +++ b/shared/home/gui/term.nix @@ -16,7 +16,7 @@ let theme = config.theme; in { font = { name = "Fira Code"; package = pkgs.fira-code; - size = 8.5; + size = 10.5; }; }; diff --git a/shared/home/nix.nix b/shared/home/nix.nix deleted file mode 100644 index 39f5a27..0000000 --- a/shared/home/nix.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ lib, pkgs, config, ... }: - -(lib.mkIf (!config.isNixos) { - nix.package = pkgs.nix; -}) // { - - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - }; - - nixpkgs.config = { - allowUnfree = true; - }; - - nixpkgs.overlays = [ - (import ../overlay.nix) - ]; - -} \ No newline at end of file diff --git a/shared/home/nix/default.nix b/shared/home/nix/default.nix new file mode 100644 index 0000000..5873009 --- /dev/null +++ b/shared/home/nix/default.nix @@ -0,0 +1,20 @@ +{ lib, pkgs, config, ... }: + +(lib.mkIf (!config.isNixos) { + + nix = { + enable = true; + package = pkgs.nix; + settings = { + experimental-features = [ "nix-command" "flakes" ]; + }; + }; + + nixpkgs.config = import ./nix-config.nix; + nixpkgs.overlays = [ + (import ../../overlay.nix) + ]; + + xdg.configFile."nixpkgs/config.nix".source = ./nix-config.nix; + +}) diff --git a/shared/home/nix/nix-config.nix b/shared/home/nix/nix-config.nix new file mode 100644 index 0000000..7be6bf9 --- /dev/null +++ b/shared/home/nix/nix-config.nix @@ -0,0 +1,3 @@ +{ + allowUnfree = true; +} \ No newline at end of file diff --git a/shared/home/programs.nix b/shared/home/programs.nix index 5feec6b..6f671d8 100644 --- a/shared/home/programs.nix +++ b/shared/home/programs.nix @@ -5,7 +5,11 @@ { pkgs, ... }: { - home.packages = (import ../env.nix pkgs); + home.packages = (with pkgs; [ + eva + hyperfine + du-dust + ]) ++ (import ../env.nix pkgs); # CLI for accessing my passwords programs.rbw = { diff --git a/shared/overlay.nix b/shared/overlay.nix index 28b8ce1..2153fb2 100644 --- a/shared/overlay.nix +++ b/shared/overlay.nix @@ -6,4 +6,4 @@ with (import ./lib.nix final); { github-web = webApp "github" "https://github.com"; bitwarden-web = webApp "bitwarden" "https://vault.steph.tools"; hoogle-web = webApp "hoogle" "https://hoogle.haskell.org"; -} \ No newline at end of file +} diff --git a/system/dev-lt-63/home.nix b/system/dev-lt-63/home.nix index d196e1f..c070a62 100644 --- a/system/dev-lt-63/home.nix +++ b/system/dev-lt-63/home.nix @@ -11,6 +11,8 @@ home-manager.enable = false; }; + custom.gui.sway.enable = true; + xdg.systemDirs.data = [ "/usr/share" "/usr/local/share" ]; fonts.fontconfig.enable = true;