diff --git a/flake.nix b/flake.nix index b95da72..97dd741 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,9 @@ outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, ... }: let system = "x86_64-linux"; + name = "emmet"; + email = "librephoenix@protonmail.com"; + dotfilesDir = ./.; pkgs = import nixpkgs { inherit system; @@ -29,6 +32,14 @@ nix-doom-emacs.hmModule stylix.homeManagerModules.stylix ]; + extraSpecialArgs = { + myName = name; + myHomeDir = /. + "home/"+name; + myEmail = email; + myDotfilesDir = dotfilesDir; + myNixConfigurationFilePath = dotfilesDir+"/system/configuration.nix"; + myHomeManagerFilePath = dotfilesDir+"/user/home.nix"; + }; }; }; nixosConfigurations = { diff --git a/user/app/git/git.nix b/user/app/git/git.nix new file mode 100644 index 0000000..45becf6 --- /dev/null +++ b/user/app/git/git.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, myName, myEmail, ... }: + +{ + programs.git.enable = true; + programs.git.userName = myName; + programs.git.userEmail = myEmail; + programs.git.extraConfig = { + init.defaultBranch = "main"; + }; +} diff --git a/user/home.nix b/user/home.nix index d6e373b..0848eb0 100644 --- a/user/home.nix +++ b/user/home.nix @@ -1,24 +1,8 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, myName, myEmail, myHomeDir, myDotfilesDir, ... }: let - myName = "emmet"; - - myDotfilesDir = "~/dotfiles/"; - - # My shell aliases - myAliases = { - ls = "exa --icons -l -T -L=1"; - cat = "bat"; - htop = "btm"; - fd = "fd -Lu"; - w3m = "w3m -no-cookie -v"; - }; - - # Variables for my nix configuration paths - myNixConfigurationFilePath = "$HOME/dotfiles/system/configuration.nix"; - myHomeManagerFilePath = "$HOME/dotfiles/user/home.nix"; - # This sets up my "phoenix" script with my configuration paths + # =phoenix= is just my wrapper script for easier access to nix/nixos commands myPhoenixScript = '' if [ "$1" = "sync" ]; then if [ "$2" != "user" ]; then @@ -39,27 +23,21 @@ let ''; in - { # Home Manager needs a bit of information about you and the paths it should # manage. home.username = myName; - home.homeDirectory = "/home/emmet"; + home.homeDirectory = myHomeDir; programs.home-manager.enable = true; imports = [ - ./wm/xmonad/xmonad.nix - ./style/stylix.nix + ./wm/xmonad/xmonad.nix # My xmonad config + ./shell/sh.nix # My zsh and bash config + ./app/git/git.nix # My git config + ./style/stylix.nix # Styling and themes for my apps ]; - programs.git.enable = true; - programs.git.userName = myName; - programs.git.userEmail = "librephoenix@protonmail.com"; - programs.git.extraConfig = { - init.defaultBranch = "main"; - }; - home.stateVersion = "22.11"; # Please read the comment before changing. home.packages = with pkgs; [ @@ -291,39 +269,8 @@ in # Filesystems dosfstools - - # # overrides. You can do that directly here, just don't forget the - # # parentheses. Maybe you want to install Nerd Fonts with a limited number of - # # fonts? - # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) - - # # You can also create simple shell scripts directly inside your - # # configuration. For example, this adds a command 'my-hello' to your - # # environment: - # (pkgs.writeShellScriptBin "my-hello" '' - # echo "Hello, ${config.home.username}!" - # '') ]; - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - shellAliases = myAliases; - oh-my-zsh = { - enable = true; - plugins = [ "git" ]; - theme = "agnoster"; - }; - }; - - programs.bash = { - enable = true; - enableCompletion = true; - shellAliases = myAliases; - }; - programs.doom-emacs = { enable = true; doomPrivateDir = ./app/doom-emacs; diff --git a/user/shell/sh.nix b/user/shell/sh.nix new file mode 100644 index 0000000..a73e181 --- /dev/null +++ b/user/shell/sh.nix @@ -0,0 +1,32 @@ +{ config, pkgs, ... }: +let + + # My shell aliases + myAliases = { + ls = "exa --icons -l -T -L=1"; + cat = "bat"; + htop = "btm"; + fd = "fd -Lu"; + w3m = "w3m -no-cookie -v"; + }; +in +{ + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + shellAliases = myAliases; + oh-my-zsh = { + enable = true; + plugins = [ "git" ]; + theme = "agnoster"; + }; + }; + + programs.bash = { + enable = true; + enableCompletion = true; + shellAliases = myAliases; + }; +}