mirror of
https://github.com/librephoenix/nixos-config
synced 2025-04-20 09:14:34 +05:30
Moved git and shell config into separate modules
This commit is contained in:
parent
1eee403e6c
commit
227070ac48
11
flake.nix
11
flake.nix
|
@ -12,6 +12,9 @@
|
||||||
outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, ... }:
|
outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
name = "emmet";
|
||||||
|
email = "librephoenix@protonmail.com";
|
||||||
|
dotfilesDir = ./.;
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
@ -29,6 +32,14 @@
|
||||||
nix-doom-emacs.hmModule
|
nix-doom-emacs.hmModule
|
||||||
stylix.homeManagerModules.stylix
|
stylix.homeManagerModules.stylix
|
||||||
];
|
];
|
||||||
|
extraSpecialArgs = {
|
||||||
|
myName = name;
|
||||||
|
myHomeDir = /. + "home/"+name;
|
||||||
|
myEmail = email;
|
||||||
|
myDotfilesDir = dotfilesDir;
|
||||||
|
myNixConfigurationFilePath = dotfilesDir+"/system/configuration.nix";
|
||||||
|
myHomeManagerFilePath = dotfilesDir+"/user/home.nix";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|
10
user/app/git/git.nix
Normal file
10
user/app/git/git.nix
Normal file
|
@ -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";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,24 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, myName, myEmail, myHomeDir, myDotfilesDir, ... }:
|
||||||
|
|
||||||
let
|
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
|
# This sets up my "phoenix" script with my configuration paths
|
||||||
|
# =phoenix= is just my wrapper script for easier access to nix/nixos commands
|
||||||
myPhoenixScript = ''
|
myPhoenixScript = ''
|
||||||
if [ "$1" = "sync" ]; then
|
if [ "$1" = "sync" ]; then
|
||||||
if [ "$2" != "user" ]; then
|
if [ "$2" != "user" ]; then
|
||||||
|
@ -39,27 +23,21 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
home.username = myName;
|
home.username = myName;
|
||||||
home.homeDirectory = "/home/emmet";
|
home.homeDirectory = myHomeDir;
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./wm/xmonad/xmonad.nix
|
./wm/xmonad/xmonad.nix # My xmonad config
|
||||||
./style/stylix.nix
|
./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.stateVersion = "22.11"; # Please read the comment before changing.
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
@ -291,39 +269,8 @@ in
|
||||||
|
|
||||||
# Filesystems
|
# Filesystems
|
||||||
dosfstools
|
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 = {
|
programs.doom-emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
doomPrivateDir = ./app/doom-emacs;
|
doomPrivateDir = ./app/doom-emacs;
|
||||||
|
|
32
user/shell/sh.nix
Normal file
32
user/shell/sh.nix
Normal file
|
@ -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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue