home: add git config and common module for headless systems

This commit is contained in:
Yuri Tatishchev 2025-06-05 18:47:15 -07:00
parent 64e7aa87ab
commit 062d80750c
Signed by: CaZzzer
SSH Key Fingerprint: SHA256:sqXB3fe0LMpfH+IeM/vlmxKdso52kssrIJBlwKXVe1U
7 changed files with 127 additions and 87 deletions

View File

@ -27,6 +27,8 @@
outputs = { self, nixpkgs, home-manager, plasma-manager, nixos-generators, secrix }: outputs = { self, nixpkgs, home-manager, plasma-manager, nixos-generators, secrix }:
let let
hmModule = file: { hmModule = file: {
imports = [ home-manager.nixosModules.home-manager ];
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
@ -49,7 +51,6 @@
./hosts/Yura-PC ./hosts/Yura-PC
./users/cazzzer ./users/cazzzer
# https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module # https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module
home-manager.nixosModules.home-manager
(hmModule ./home/cazzzer-pc.nix) (hmModule ./home/cazzzer-pc.nix)
]; ];
}; };
@ -62,7 +63,6 @@
./hosts/Yura-TPX13 ./hosts/Yura-TPX13
./users/cazzzer ./users/cazzzer
# https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module # https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module
home-manager.nixosModules.home-manager
(hmModule ./home/cazzzer-laptop.nix) (hmModule ./home/cazzzer-laptop.nix)
]; ];
}; };
@ -74,6 +74,7 @@
./hosts/hw-vm.nix ./hosts/hw-vm.nix
./hosts/vm ./hosts/vm
./users/cazzzer ./users/cazzzer
(hmModule ./home/cazzzer-pc.nix)
]; ];
}; };
router = nixpkgs.lib.nixosSystem { router = nixpkgs.lib.nixosSystem {
@ -84,6 +85,7 @@
./hosts/common.nix ./hosts/common.nix
./hosts/router ./hosts/router
./users/cazzzer ./users/cazzzer
(hmModule ./home/common.nix)
]; ];
}; };
}; };
@ -97,6 +99,7 @@
./hosts/hw-proxmox.nix ./hosts/hw-proxmox.nix
./hosts/vm ./hosts/vm
./users/cazzzer ./users/cazzzer
(hmModule ./home/cazzzer-pc.nix)
]; ];
format = "proxmox"; format = "proxmox";
}; };
@ -109,6 +112,7 @@
./hosts/hw-proxmox.nix ./hosts/hw-proxmox.nix
./hosts/vm ./hosts/vm
./users/cazzzer ./users/cazzzer
(hmModule ./home/cazzzer-pc.nix)
]; ];
}; };
in in

View File

@ -2,7 +2,8 @@
{ {
imports = [ imports = [
./modules ./common.nix
./common-desktop.nix
]; ];
programs.plasma = { programs.plasma = {

View File

@ -2,7 +2,8 @@
{ {
imports = [ imports = [
./modules ./common.nix
./common-desktop.nix
]; ];
programs.plasma.kwin.virtualDesktops.number = 2; programs.plasma.kwin.virtualDesktops.number = 2;

21
home/common-desktop.nix Normal file
View File

@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
{
imports = [
./modules/starship.nix
./modules/plasma.nix
];
services.darkman = {
enable = true;
settings = {
lat = 37.3387;
lng = -121.8853;
};
lightModeScripts = {
plasma-color = "plasma-apply-colorscheme BreezeLight";
};
darkModeScripts = {
plasma-color = "plasma-apply-colorscheme BreezeDark";
};
};
}

32
home/common.nix Normal file
View File

@ -0,0 +1,32 @@
{ config, lib, pkgs, ... }:
let
username = "cazzzer";
in
{
imports = [
./modules/fish.nix
./modules/git.nix
];
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = username;
home.homeDirectory = "/home/${username}";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.sessionVariables = {
EDITOR = "micro";
SHELL = "fish";
};
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.11"; # Please read the comment before changing.
}

View File

@ -1,83 +0,0 @@
{ config, lib, pkgs, ... }:
let
username = "cazzzer";
in
{
imports = [
./fish.nix
./starship.nix
./plasma.nix
];
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = username;
home.homeDirectory = "/home/${username}";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.sessionVariables = {
EDITOR = "micro";
SHELL = "fish";
};
services.darkman = {
enable = true;
settings = {
lat = 37.3387;
lng = -121.8853;
};
lightModeScripts = {
plasma-color = "plasma-apply-colorscheme BreezeLight";
};
darkModeScripts = {
plasma-color = "plasma-apply-colorscheme BreezeDark";
};
};
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
# home.packages = [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # 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}!"
# '')
# ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
# home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
# };
}

64
home/modules/git.nix Normal file
View File

@ -0,0 +1,64 @@
{ config, lib, pkgs, ... }:
let
name = "Yuri Tatishchev";
email = "itatishch@gmail.com";
signingKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE02AhJIZtrtZ+5sZhna39LUUCEojQzmz2BDWguT9ZHG";
in
{
programs.git = {
enable = true;
userName = name;
userEmail = email;
signing = {
key = signingKey;
signByDefault = true;
format = "ssh";
};
aliases = {
co = "checkout";
s = "switch";
};
extraConfig = {
url = {
"https://gitea.cazzzer.com/" = {
insteadOf = "caztea:";
};
"https://github.com/" = {
insteadOf = "github:";
};
};
core = {
autocrlf = "input";
editor = "micro";
};
color = {
ui = true;
};
pull = {
ff = "only";
};
filter.lfs = {
clean = "git-lfs clean -- %f";
smudge = "git-lfs smudge -- %f";
process = "git-lfs filter-process";
required = true;
};
credential = {
helper = "libsecret";
};
merge = {
conflictStyle = "zdiff3";
};
};
};
}