Skip to content

Commit

Permalink
Split home into more modules
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Jan 9, 2024
1 parent 3f6a8c0 commit c6beecd
Show file tree
Hide file tree
Showing 17 changed files with 219 additions and 262 deletions.
21 changes: 20 additions & 1 deletion home-modules/common.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{pkgs, ...}: {
{
pkgs,
user,
...
}: {
home.stateVersion = "23.11";
dconf.enable = true;
systemd.user.startServices = "sd-switch";
Expand All @@ -9,4 +13,19 @@
config.allowUnfree = true;
overlays = import ../overlays {inherit pkgs;};
};

xdg = {
enable = true;
userDirs = {
enable = true;
desktop = "/home/${user}";
templates = "/home/${user}";
publicShare = "/home/${user}";
documents = "/home/${user}/documents";
download = "/home/${user}/downloads";
music = "/home/${user}/music";
pictures = "/home/${user}/pictures";
videos = "/home/${user}/videos";
};
};
}
6 changes: 6 additions & 0 deletions home-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
hidpi = import ./hidpi.nix;
rofi = import ./rofi.nix;
discord = import ./discord.nix;
redshift = import ./redshift.nix;
flameshot = import ./flameshot.nix;
starship = import ./starship.nix;
imv = import ./imv.nix;
yazi = import ./yazi.nix;
gtk = import ./gtk.nix;
}
14 changes: 14 additions & 0 deletions home-modules/flameshot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{user, ...}: {
services = {
flameshot = {
enable = true;
settings = {
General = {
disabledTrayIcon = true;
showStartupLaunchMessage = false;
savePath = "/home/${user}/pictures/screenshots";
};
};
};
};
}
22 changes: 22 additions & 0 deletions home-modules/gtk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{pkgs, ...}: {
home = {
packages = with pkgs; [
qogir-icon-theme
dracula-theme
];

pointerCursor = {
package = pkgs.qogir-icon-theme;
name = "Qogir";
size = 24;
x11.enable = true;
gtk.enable = true;
};
};

gtk = {
enable = true;
theme.name = "Dracula";
iconTheme.name = "Qogir";
};
}
16 changes: 16 additions & 0 deletions home-modules/imv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
programs.imv = {
enable = true;
settings = {
options = {
overlay_font = "monospace:10";
overlay = true;
overlay_position_bottom = true;
};
binds = {
"w" = "exec setbg $imv_current_file";
"<comma>" = "prev_frame";
};
};
};
}
12 changes: 12 additions & 0 deletions home-modules/redshift.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
services.redshift = {
enable = true;
tray = true;
dawnTime = "6:00-8:00";
duskTime = "22:00-23:30";
temperature = {
day = 6500;
night = 3300;
};
};
}
11 changes: 11 additions & 0 deletions home-modules/starship.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
programs.starship = {
enable = true;
settings = {
add_newline = true;
battery.disabled = true;
git_metrics.disabled = false;
directory.repo_root_style = "bold underline italic blue";
};
};
}
6 changes: 6 additions & 0 deletions home-modules/yazi.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
programs.yazi = {
enable = true;
enableZshIntegration = true;
};
}
7 changes: 0 additions & 7 deletions hosts/buutti/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ in {

networking = {
hostName = "buutti";
# zfs requires hostId to be set.
hostId = "4d0256d9";
};

Expand All @@ -57,12 +56,6 @@ in {

services.tailscale.enable = true;

# allow old electron for obsidian version <= 1.4.16"
# https://github.com/NixOS/nixpkgs/issues/273611
nixpkgs.config.permittedInsecurePackages = [
"electron-25.9.0"
];

environment.systemPackages = lib.flatten [
(
with pkgs; [
Expand Down
108 changes: 8 additions & 100 deletions hosts/buutti/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
pkgs,
user,
...
}: let
homeDir = "/home/${user}";
in {
}: {
imports = [
inputs.home-manager.nixosModules.home-manager
];

home-manager.users."${user}" = {
imports = pkgs.lib.flatten [
(with outputs.homeManagerModules; [
common
(common {inherit pkgs user;})
xresources
(neovim {inherit pkgs user;})
zsh
Expand All @@ -28,105 +26,15 @@ in {
hidpi
rofi
discord
redshift
(flameshot {inherit user;})
starship
imv
yazi
gtk
])
inputs.nixvim.homeManagerModules.nixvim
inputs.nix-index-database.hmModules.nix-index
];

home = {
packages = with pkgs; [
qogir-icon-theme
dracula-theme
xsecurelock
];

pointerCursor = {
package = pkgs.qogir-icon-theme;
name = "Qogir";
x11.enable = true;
gtk.enable = true;
};
};

xdg = {
enable = true;
userDirs = {
enable = true;
desktop = homeDir;
templates = homeDir;
publicShare = homeDir;
documents = "${homeDir}/documents";
download = "${homeDir}/downloads";
music = "${homeDir}/music";
pictures = "${homeDir}/pictures";
videos = "${homeDir}/videos";
};
};

gtk = {
enable = true;
theme.name = "Dracula";
iconTheme.name = "Qogir";
};

services = {
flameshot = {
enable = true;
settings = {
General = {
disabledTrayIcon = true;
showStartupLaunchMessage = false;
savePath = "${homeDir}/pictures/screenshots";
};
};
};

redshift = {
enable = true;
tray = true;
dawnTime = "6:00-8:00";
duskTime = "22:00-23:30";
temperature = {
day = 6500;
night = 3300;
};
};

easyeffects.enable = true;
batsignal.enable = true;
udiskie.enable = true;
};

programs = {
starship = {
enable = true;
settings = {
add_newline = true;
battery.disabled = true;
git_metrics.disabled = false;
directory.repo_root_style = "bold underline italic blue";
};
};

imv = {
enable = true;
settings = {
options = {
overlay_font = "monospace:10";
overlay = true;
overlay_position_bottom = true;
};
binds = {
"w" = "exec setbg $imv_current_file";
"<comma>" = "prev_frame";
};
};
};

yazi = {
enable = true;
enableZshIntegration = true;
};
};
};
}
41 changes: 16 additions & 25 deletions hosts/x1/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,19 @@ in {
bluetooth
gui
work-vpn
keyd
])
(with inputs.nixos-hardware.nixosModules; [
lenovo-thinkpad-x1-11th-gen
])
# (with inputs.nixos-hardware.nixosModules; [
# common-cpu-amd
# common-cpu-amd-pstate
# common-pc-ssd
# common-gpu-amd
# ])
(import ./home.nix {inherit inputs outputs pkgs user;})
./hardware-configuration.nix
];

boot = {
# zfs requires this
# kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
# force S3 sleep mode
# kernelParams = ["mem_sleep_default=deep"];

loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
Expand All @@ -41,26 +38,21 @@ in {

networking = {
hostName = "x1";
# zfs requires hostId to be set.
hostId = "c08d7d71";
};

services.syncthing = {
settings.folders = {
"code".enable = true;
"notes".enable = true;
"pictures".enable = true;
"work".enable = true;
services = {
syncthing = {
settings.folders = {
"code".enable = true;
"notes".enable = true;
"pictures".enable = true;
"work".enable = true;
};
};
};

# services.tailscale.enable = true;

# allow old electron for obsidian version <= 1.4.16"
# https://github.com/NixOS/nixpkgs/issues/273611
nixpkgs.config.permittedInsecurePackages = [
"electron-25.9.0"
];
tailscale.enable = true;
};

environment.systemPackages = lib.flatten [
(
Expand All @@ -84,12 +76,11 @@ in {
gimp
firefox
chromium
keyd

# cli tools
ffmpeg-full
slop
acpi
feh
fastfetch
wget
mons
Expand Down
Loading

0 comments on commit c6beecd

Please sign in to comment.