Home-manager!

This commit is contained in:
Chris Dombroski 2024-09-21 20:07:40 -04:00
parent 5dca90bf64
commit b32cce9ca8
12 changed files with 205 additions and 9 deletions

View file

@ -64,6 +64,20 @@
globalArgs = { globalArgs = {
inherit inputs; inherit inputs;
}; };
home.users.cdombroski.passInOsConfig = true;
home.users.root.importDefault = false;
nixos.hosts.smolboi.userHomeModules = [
"root"
"cdombroski"
];
nixos.hosts.zeus.userHomeModules = [
"root"
"cdombroski"
];
nixos.hosts.orangepihole.userHomeModules = [
"root"
"cdombroski"
];
}; };
flake = { flake = {
deploy = { deploy = {

View file

@ -0,0 +1,12 @@
{
home = {
username = "cdombroski";
stateVersion = "23.11";
homeDirectory = "/home/cdombroski";
};
programs.git = {
userName = "Chris Dombroski";
userEmail = "cdombroski@gmail.com";
};
}

View file

@ -0,0 +1,16 @@
{ ezModules, osConfig, ... }:
{
imports = [
ezModules.bash
ezModules.xdg
];
programs.ssh.enable = true;
home = {
username = "root";
stateVersion = "23.11";
homeDirectory = osConfig.users.users.root.home;
};
}

8
home-modules/bash.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, ... }:
{
programs.bash = {
enable = true;
enableCompletion = true;
historyFile = "${config.xdg.stateHome}/bash/history";
};
}

12
home-modules/default.nix Normal file
View file

@ -0,0 +1,12 @@
{ lib, ... }:
{
imports = builtins.map (n: ./${n}) (
builtins.attrNames (
lib.filterAttrs (k: v: v == "regular" && lib.hasSuffix ".nix" k && k != "default.nix") (
builtins.readDir ./.
)
)
);
programs.home-manager.enable = true;
}

6
home-modules/direnv.nix Normal file
View file

@ -0,0 +1,6 @@
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

7
home-modules/gpg.nix Normal file
View file

@ -0,0 +1,7 @@
{ config, ... }:
{
programs.gpg = {
enable = true;
homedir = "${config.xdg.dataHome}/gnupg";
};
}

View file

@ -0,0 +1,18 @@
{ osConfig, lib, ... }:
{
services.syncthing = lib.mkIf (osConfig.nixpkgs.hostPlatform.system == "x86_64-linux") {
enable = true;
tray.enable = osConfig.services.displayManager.enable;
};
systemd.user = lib.mkIf osConfig.services.displayManager.enable {
targets.tray = {
Unit = {
Description = "System Tray";
Requires = [ "graphical-session.target" ];
};
};
};
}

19
home-modules/vim.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
programs.vim = {
enable = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
vim-sensible
vim-fugitive
vim-eunuch
vim-endwise
vim-lsp
vim-lsp-settings
nerdtree
nerdtree-git-plugin
vim-devicons
editorconfig-vim
];
};
}

13
home-modules/vscode.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
programs.vscode = {
enable = true;
package = pkgs.vscodium-fhs;
extensions = with pkgs.vscode-extensions; [
mkhl.direnv
eamodio.gitlens
jnoortheen.nix-ide
redhat.java
];
};
}

29
home-modules/xdg.nix Normal file
View file

@ -0,0 +1,29 @@
{
config,
lib,
osConfig,
...
}:
{
home.preferXdgDirectories = true;
xdg.enable = true;
home.sessionVariables = {
ANDROID_USER_HOME = "${config.xdg.dataHome}/android";
CARGO_HOME = "${config.xdg.dataHome}/cargo";
DOTNET_CLI_HOME = "${config.xdg.dataHome}/dotnet";
DVDCSS_CACHE = "${config.xdg.dataHome}/dvdcss";
GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle";
JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java";
NODE_REPL_HISTORY = "${config.xdg.stateHome}/node_repl_history";
NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc";
PYTHON_HISTORY = "${config.xdg.stateHome}/python_history";
RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
XCOMPOSE_CACHE = "${config.xdg.cacheHome}/X11/xcompose";
};
home.shellAliases = {
adb = ''HOME="${config.xdg.dataHome}/android" adb'';
mvn = "mvn -gs ${config.xdg.configHome}/maven/settings.xml";
wget = "wget --hsts-file=${config.xdg.dataHome}/wget-hsts";
};
gtk.gtk2.configLocation = lib.mkIf osConfig.displayManager.enable "${config.xdg.configHome}/gtk-2.0/gtkrc";
}

View file

@ -1,5 +1,4 @@
{ {
config,
pkgs, pkgs,
ezModules, ezModules,
inputs, inputs,
@ -13,6 +12,7 @@ let
in in
{ {
imports = [ imports = [
"${modulesPath}/installer/scan/not-detected.nix"
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
inputs.nixos-hardware.nixosModules.common-cpu-amd inputs.nixos-hardware.nixosModules.common-cpu-amd
@ -22,14 +22,14 @@ in
inputs.nixos-hardware.nixosModules.common-pc inputs.nixos-hardware.nixosModules.common-pc
inputs.nixos-hardware.nixosModules.common-pc-ssd inputs.nixos-hardware.nixosModules.common-pc-ssd
inputs.nixos-hardware.nixosModules.gigabyte-b550 inputs.nixos-hardware.nixosModules.gigabyte-b550
inputs.home-manager.nixosModules.home-manager # inputs.home-manager.nixosModules.home-manager
{ # {
home-manager.extraSpecialArgs = { # home-manager.extraSpecialArgs = {
inherit pkgs-unstable; # inherit pkgs-unstable;
}; # };
home-manager.useGlobalPkgs = true; # home-manager.useGlobalPkgs = true;
home-manager.users.cdombroski = import ../configs/home.nix; # home-manager.users.cdombroski = import ../configs/home.nix;
} # }
ezModules.aarch64-emu ezModules.aarch64-emu
ezModules.smartd ezModules.smartd
ezModules.plymouth ezModules.plymouth
@ -143,6 +143,48 @@ in
p7zip p7zip
rar rar
piper piper
element-desktop
discord
openrgb-with-all-plugins
keepassxc
heroic
r2modman
mangohud
hack-font
htop
jellyfin-media-player
konversation
nixd
yakuake
mgba
vlc
pkgs-unstable.jetbrains.idea-community
dolphin-emu-primehack
steamtinkerlaunch
mangohud
lutris
knossosnet
lilypond
musescore
protontricks
protonup-qt
(retroarch.override {
cores = with libretro; [
beetle-psx-hw
pcsx2
mesen
bsnes
parallel-n64
dolphin
sameboy
citra
gpsp
desmume
fbneo
nxengine
mgba
];
})
]; ];
persistence."/persist" = { persistence."/persist" = {
hideMounts = true; hideMounts = true;