diff --git a/features/aliases.nix b/features/aliases.nix new file mode 100644 index 0000000..2010ac9 --- /dev/null +++ b/features/aliases.nix @@ -0,0 +1,33 @@ +{ pkgs }: +let + ff = + if pkgs.stdenv.hostPlatform.isDarwin then "clear;fastfetch" else "clear;fastfetch --logo nixos2"; + + ffw = + if pkgs.stdenv.hostPlatform.isDarwin then + "clear;fastfetch;printf '\n';weather kmco" + else + "clear;fastfetch --logo nixos2;printf '\n';weather kmco"; + + linuxAliases = + if pkgs.stdenv.hostPlatform.isLinux then + { + nb = "nix-build"; + nix-rebuild = "sudo nixos-rebuild switch"; + } + else + { }; +in +{ + l = "ls -alh"; + ll = "ls -l"; + ls = "ls --color=tty"; + gs = "git status"; + ga = "git add"; + gc = "git commit -m"; + gpll = "git pull"; + gpsh = "git push"; + wget = "wget --hsts-file=$XDG_DATA_HOME/wget-hsts"; + inherit ff ffw; +} +// linuxAliases diff --git a/home/frank.nix b/home/frank.nix index dc37e6e..79bf11a 100644 --- a/home/frank.nix +++ b/home/frank.nix @@ -1,27 +1,13 @@ { inputs, pkgs, ... }: +let + sshSigningKey = builtins.readFile ./ssh-signing-key.pub; +in { imports = [ inputs.lazyvim.homeManagerModules.default ]; - home.shellAliases = { - l = "ls -alh"; - ll = "ls -l"; - ls = "ls --color=tty"; - gs = "git status"; - ga = "git add"; - gc = "git commit -m"; - gpll = "git pull"; - gpsh = "git push"; - wget = "wget --hsts-file=$XDG_DATA_HOME/wget-hsts"; - ff = - if pkgs.stdenv.hostPlatform.isDarwin then "clear;fastfetch" else "clear;fastfetch --logo nixos2"; - ffw = - if pkgs.stdenv.hostPlatform.isDarwin then - "clear;fastfetch;printf '\n';weather kmco" - else - "clear;fastfetch --logo nixos2;printf '\n';weather kmco"; - }; + home.shellAliases = import ../features/aliases.nix { inherit pkgs; }; xdg = if pkgs.stdenv.hostPlatform.isDarwin then @@ -184,7 +170,7 @@ lfs.enable = true; signing = { - key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ5+RJOhvamBpEptCRv90E+8bVWKn6Mep61wDpPYgKP3 floturcocantsee@daguerro.net"; + key = sshSigningKey; signByDefault = true; }; diff --git a/home/ssh-signing-key.pub b/home/ssh-signing-key.pub new file mode 100644 index 0000000..1f67a5c --- /dev/null +++ b/home/ssh-signing-key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ5+RJOhvamBpEptCRv90E+8bVWKn6Mep61wDpPYgKP3 floturcocantsee@daguerro.net \ No newline at end of file diff --git a/hosts/shared/darwin.nix b/hosts/shared/darwin.nix index 8927f44..54b0729 100644 --- a/hosts/shared/darwin.nix +++ b/hosts/shared/darwin.nix @@ -57,19 +57,7 @@ XDG_STATE_HOME = "$HOME/.local/state"; }; - shellAliases = { - l = "ls -alh"; - ll = "ls -l"; - ls = "ls --color=tty"; - gs = "git status"; - ga = "git add"; - gc = "git commit -m"; - gpll = "git pull"; - gpsh = "git push"; - ff = "clear;fastfetch --logo nixos2"; - ffw = "clear;fastfetch --logo nixos2;printf '\n';weather kmco"; - wget = "wget --hsts-file=$XDG_DATA_HOME/wget-hsts"; - }; + shellAliases = import ../../features/aliases.nix { inherit pkgs; }; systemPackages = with pkgs; [ wget diff --git a/hosts/shared/nixos-pc.nix b/hosts/shared/nixos-pc.nix index cfa713b..862bf1a 100644 --- a/hosts/shared/nixos-pc.nix +++ b/hosts/shared/nixos-pc.nix @@ -427,20 +427,7 @@ (callPackage ../../packages/looking-glass-client/package.nix { }) ]; - shellAliases = { - l = "ls -alh"; - ll = "ls -l"; - ls = "ls --color=tty"; - gs = "git status"; - ga = "git add"; - gc = "git commit -m"; - gpll = "git pull"; - gpsh = "git push"; - ff = "clear;fastfetch --logo nixos2"; - ffw = "clear;fastfetch --logo nixos2;printf '\n';weather kmco"; - wget = "wget --hsts-file=$XDG_DATA_HOME/wget-hsts"; - nix-rebuild = "sudo nixos-rebuild switch"; - }; + shellAliases = import ../../features/aliases.nix { inherit pkgs; }; sessionVariables = rec { XDG_CACHE_HOME = "$HOME/.cache"; diff --git a/hosts/shared/nixos-server.nix b/hosts/shared/nixos-server.nix index df5d6cf..33d1f54 100644 --- a/hosts/shared/nixos-server.nix +++ b/hosts/shared/nixos-server.nix @@ -192,16 +192,7 @@ )) ]; - shellAliases = { - l = "ls -alh"; - ll = "ls -l"; - ls = "ls --color=tty"; - ff = "clear;fastfetch --logo nixos2"; - ffw = "clear;fastfetch --logo nixos2;printf '\n';weather kmco"; - wget = "wget --hsts-file=$XDG_DATA_HOME/wget-hsts"; - nb = "nix-build"; - nix-rebuild = "sudo nixos-rebuild switch"; - }; + shellAliases = import ../../features/aliases.nix { inherit pkgs; }; sessionVariables = rec { XDG_CACHE_HOME = "$HOME/.cache";