modularity

This commit is contained in:
catvayor 2024-03-13 11:11:16 +01:00
parent cbf62dabcc
commit b8c0d1a4fb
12 changed files with 111 additions and 96 deletions

View file

@ -1,16 +1,22 @@
{ let
mods = import ./modules;
users = import ./users;
in {
meta.nixpkgs = <nixpkgs>; meta.nixpkgs = <nixpkgs>;
meta.specialArgs = {
inherit mods users;
};
defaults = { pkgs, ... }: { defaults = { pkgs, ... }: {
imports = [ imports = [
(import <home-manager/nixos>) (import <home-manager/nixos>)
./modules
]; ];
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
}; };
kat-probook = { name, nodes, ... }: { kat-probook = { name, nodes, ... }: {
imports = [ imports = [
./machines/kat-probook/configuration.nix ./machines/kat-probook/configuration.nix
./users/home_manager.nix users.root
users.catvayor
]; ];
deployment.allowLocalDeployment = true; deployment.allowLocalDeployment = true;
networking.hostName = name; networking.hostName = name;

View file

@ -27,25 +27,6 @@
# security.polkit.enable = true; # security.polkit.enable = true;
# programs.light.enable = true; # programs.light.enable = true;
nixpkgs.config.pulseaudio = true;
programs.wshowkeys.enable = true;
programs.sway.enable = true;
services.dbus.packages = with pkgs; [ dconf ];
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
services.gvfs.enable = true;
programs.thunar.enable = true;
programs.thunar.plugins = with pkgs.xfce; [
thunar-volman
thunar-archive-plugin
thunar-media-tags-plugin
];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -72,16 +53,6 @@
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
programs.zsh.enable = true; programs.zsh.enable = true;
users.users.catvayor = {
shell = pkgs.zsh;
isNormalUser = true;
extraGroups = [ "wheel" "usb" "networkmanager" "video" "audio" ];
packages = with pkgs; [
firefox
tree
];
};
users.users.root.shell = pkgs.zsh;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget wget
@ -91,6 +62,7 @@
btop btop
ranger ranger
colmena colmena
tree
]; ];
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
fira-code-nerdfont fira-code-nerdfont
@ -105,20 +77,6 @@
enableSSHSupport = true; enableSSHSupport = true;
}; };
# programs.neovim = {
# enable = true;
# vimAlias = true;
# viAlias = true;
# defaultEditor = true;
# configure = {
# customRC = builtins.readFile ./nvim/cfg.vim;
# };
# };
home-manager.users.root = {
home.stateVersion = "23.11";
imports = [ "${mods}/neovim" "${mods}/zsh.nix" ];
};
services.syncthing = { services.syncthing = {
enable = true; enable = true;
systemService = true; systemService = true;

View file

@ -1,3 +1,5 @@
{ ... }: { {
config._module.args = { mods = ./.; }; desktop-sway = import ./desktop/sway.nix;
neovim = ./neovim;
zsh = ./zsh.nix;
} }

View file

@ -1,13 +1,19 @@
{ config, pkgs, lib, mods, ... }:
{ {
imports = [ global = { config, pkgs, lib, mods, ... }:
(import <home-manager/nixos>) {
programs.wshowkeys.enable = true;
programs.sway.enable = true;
services.dbus.packages = with pkgs; [ dconf ];
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
]; ];
home-manager.users.catvayor = { };
home.stateVersion = "23.11"; };
home = { config, pkgs, lib, mods, ... }:
imports = [ "${mods}/neovim" "${mods}/zsh.nix" ]; {
xdg.configFile."sway/config".onChange = lib.mkForce ""; xdg.configFile."sway/config".onChange = lib.mkForce "";
home.sessionVariables = { home.sessionVariables = {
@ -21,46 +27,13 @@
XDG_CURRENT_DESKTOP = "sway"; XDG_CURRENT_DESKTOP = "sway";
}; };
home.packages = with pkgs; [
wl-clipboard
firefox
pavucontrol
libnotify
zathura
discord
signal-desktop
mattermost-desktop
keepassxc
];
programs.thunderbird.enable = true;
programs.thunderbird.profiles = {};
programs.waybar.enable = true; programs.waybar.enable = true;
home.file.".config/waybar" = { source = "${mods}/waybar"; recursive = true; }; home.file.".config/waybar" = { source = ./waybar; recursive = true; };
programs.alacritty = { enable = true; settings = lib.importTOML "${mods}/alacritty.toml"; };
services.mako = {
enable = true;
width = 400;
height = 200;
maxVisible = 5;
backgroundColor = "#8C3586";
textColor = "#F4F40E";
borderColor = "#F4F40E";
defaultTimeout = 5000;
};
gtk = {
enable = true;
theme = { package = pkgs.arc-theme; name = "Arc-Dark"; };
iconTheme = { package = pkgs.arc-icon-theme; name = "Arc"; };
cursorTheme = { package = pkgs.breeze-hacked-cursor-theme; name = "Breeze_Hacked"; };
};
home.pointerCursor = { package = pkgs.breeze-hacked-cursor-theme; name = "Breeze_Hacked"; };
xdg.enable = true;
services.swayidle = services.swayidle =
let lockwall = pkgs.runCommand "lock_wall.jpg" {} ''${pkgs.ffmpeg}/bin/ffmpeg -i ${"${mods}/wall.jpg"} -filter_complex 'gblur=sigma=3' $out -y''; let lockwall = pkgs.runCommand "lock_wall.jpg" {} ''
${pkgs.ffmpeg}/bin/ffmpeg -i ${./wall.jpg} -filter_complex 'gblur=sigma=3' $out -y
'';
in { in {
enable = true; enable = true;
timeouts = [ timeouts = [
@ -75,6 +48,7 @@
{ event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -f -i ${lockwall}"; } { event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -f -i ${lockwall}"; }
]; ];
}; };
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
xwayland = true; xwayland = true;
@ -87,7 +61,7 @@
let menuCmd = "${pkgs.wofi}/bin/wofi --show drun -i | xargs swaymsg exec --"; let menuCmd = "${pkgs.wofi}/bin/wofi --show drun -i | xargs swaymsg exec --";
exitMd = ''Exit Mode:| (l)Log out | (r)Reboot | (p)Poweroff''; exitMd = ''Exit Mode:| (l)Log out | (r)Reboot | (p)Poweroff'';
weechatCmd = pkgs.writeShellScript "weechat.sh" '' weechatCmd = pkgs.writeShellScript "weechat.sh" ''
nix-shell -p python3 python311Packages.dbus-python python311Packages.notify2 --run 'python ${"${mods}/weenotify.py"} -s' > /dev/null & nix-shell -p python3 python311Packages.dbus-python python311Packages.notify2 --run 'python ${./weenotify.py} -s' > /dev/null &
while true; do while true; do
ssh -R 5431:localhost:5431 weecat@watcher.kat -t screen -xaA -S weechat ssh -R 5431:localhost:5431 weecat@watcher.kat -t screen -xaA -S weechat
sleep 1 sleep 1
@ -123,7 +97,7 @@
command = "waybar"; command = "waybar";
mode = "hide"; mode = "hide";
}]; }];
output."*".bg = "${"${mods}/wall.jpg"} fill"; output."*".bg = "${./wall.jpg} fill";
seat."*"."hide_cursor" = "5000"; seat."*"."hide_cursor" = "5000";
focus.wrapping = "yes"; focus.wrapping = "yes";
window.titlebar = false; window.titlebar = false;

View file

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

63
users/catvayor.nix Normal file
View file

@ -0,0 +1,63 @@
{ config, pkgs, lib, mods, ... }:
{
imports = [ mods.desktop-sway.global ];
users.users.catvayor = {
shell = pkgs.zsh;
isNormalUser = true;
extraGroups = [ "wheel" "usb" "networkmanager" "video" "audio" ];
packages = with pkgs; [
tree
];
};
nixpkgs.config.pulseaudio = true;
services.gvfs.enable = true;
programs.thunar.enable = true;
programs.thunar.plugins = with pkgs.xfce; [
thunar-volman
thunar-archive-plugin
thunar-media-tags-plugin
];
home-manager.users.catvayor = {
home.stateVersion = "23.11";
imports = [ mods.neovim mods.zsh mods.desktop-sway.home ];
home.packages = with pkgs; [
wl-clipboard
firefox
pavucontrol
libnotify
zathura
discord
signal-desktop
mattermost-desktop
keepassxc
];
programs.alacritty = { enable = true; settings = lib.importTOML ./cat-alacritty.toml; };
programs.thunderbird.enable = true;
programs.thunderbird.profiles = {};
services.mako = {
enable = true;
width = 400;
height = 200;
maxVisible = 5;
backgroundColor = "#8C3586";
textColor = "#F4F40E";
borderColor = "#F4F40E";
defaultTimeout = 5000;
};
gtk = {
enable = true;
theme = { package = pkgs.arc-theme; name = "Arc-Dark"; };
iconTheme = { package = pkgs.arc-icon-theme; name = "Arc"; };
cursorTheme = { package = pkgs.breeze-hacked-cursor-theme; name = "Breeze_Hacked"; };
};
home.pointerCursor = { package = pkgs.breeze-hacked-cursor-theme; name = "Breeze_Hacked"; };
xdg.enable = true;
};
}

4
users/default.nix Normal file
View file

@ -0,0 +1,4 @@
{
catvayor = ./catvayor.nix;
root = ./root.nix;
}

8
users/root.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, lib, pkgs, mods, ... }:
{
users.users.root.shell = pkgs.zsh;
home-manager.users.root = {
home.stateVersion = "23.11";
imports = [ mods.neovim mods.zsh ];
};
}