mirror of
https://github.com/szymon-jozef/amazing-dotfiles.git
synced 2026-09-07 20:20:43 +02:00
refactor
This commit is contained in:
88
flake.nix
88
flake.nix
@@ -39,98 +39,88 @@
|
|||||||
}@inputs:
|
}@inputs:
|
||||||
|
|
||||||
let
|
let
|
||||||
baseUserConfig = {
|
defaultUserConfig = {
|
||||||
username = "szymon";
|
username = "szymon";
|
||||||
# for git
|
|
||||||
email = "szymon_jozef@proton.me";
|
email = "szymon_jozef@proton.me";
|
||||||
fullName = "Szymon P";
|
fullName = "Szymon P";
|
||||||
# your public ssh key
|
|
||||||
signingKey = "~/.ssh/github.pub";
|
signingKey = "~/.ssh/github.pub";
|
||||||
|
|
||||||
mainMonitor = "DP-1"; # only for some applications: you still need to set hyprland monitors yourself!
|
mainMonitor = "DP-1";
|
||||||
statusBar = "ashell"; # available: ashell|waybar
|
statusBar = "ashell"; # available: ashell | waybar
|
||||||
|
|
||||||
pathConfig = {
|
pathConfig = {
|
||||||
wallpaper = "Obrazy/tapety/catppuccin";
|
wallpaper = "Obrazy/tapety/catppuccin";
|
||||||
screenshot = "Obrazy/zrzuty/";
|
screenshot = "Obrazy/zrzuty/";
|
||||||
obsidian = "Dokumenty/obsidian";
|
obsidian = "Dokumenty/obsidian";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
isNixOS = true;
|
||||||
|
hostName = "default";
|
||||||
};
|
};
|
||||||
|
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
general_import = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
general_module_import = [
|
mkHome =
|
||||||
./home.nix
|
customConfig:
|
||||||
catppuccin.homeModules.catppuccin
|
let
|
||||||
nixvim.homeModules.nixvim
|
userConfig = defaultUserConfig // customConfig;
|
||||||
inputs.hyprcursor-phinger.homeManagerModules.hyprcursor-phinger
|
in
|
||||||
(
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
home.packages = [
|
|
||||||
zut-calendar.packages.${pkgs.system}.default
|
|
||||||
zutui.packages.${pkgs.system}.default
|
|
||||||
];
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
mkHomeConfig =
|
|
||||||
{
|
|
||||||
isNixOS,
|
|
||||||
overrides ? { },
|
|
||||||
hostName,
|
|
||||||
}:
|
|
||||||
home-manager.lib.homeManagerConfiguration {
|
home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = general_import;
|
inherit pkgs;
|
||||||
|
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs isNixOS hostName;
|
inherit inputs userConfig;
|
||||||
userConfig = baseUserConfig // overrides;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = general_module_import;
|
modules = [
|
||||||
|
./home.nix
|
||||||
|
catppuccin.homeModules.catppuccin
|
||||||
|
nixvim.homeModules.nixvim
|
||||||
|
inputs.hyprcursor-phinger.homeManagerModules.hyprcursor-phinger
|
||||||
|
(
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
zut-calendar.packages.${pkgs.system}.default
|
||||||
|
zutui.packages.${pkgs.system}.default
|
||||||
|
];
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]
|
||||||
|
++ (customConfig.extraModules or [ ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"arch" = mkHomeConfig {
|
# You can overwrite default configuration here
|
||||||
|
|
||||||
|
"arch" = mkHome {
|
||||||
isNixOS = false;
|
isNixOS = false;
|
||||||
hostName = "arch";
|
hostName = "arch";
|
||||||
};
|
};
|
||||||
|
|
||||||
"nixos" = mkHomeConfig {
|
"nixos" = mkHome {
|
||||||
isNixOS = true;
|
isNixOS = true;
|
||||||
hostName = "nixos";
|
hostName = "nixos";
|
||||||
};
|
};
|
||||||
|
|
||||||
"${baseUserConfig.username}@pitagoras" = mkHomeConfig {
|
"${defaultUserConfig.username}@pitagoras" = mkHome {
|
||||||
isNixOS = true;
|
|
||||||
overrides = {
|
|
||||||
mainMonitor = "eDP-1";
|
|
||||||
};
|
|
||||||
hostName = "pitagoras";
|
hostName = "pitagoras";
|
||||||
|
mainMonitor = "eDP-1";
|
||||||
};
|
};
|
||||||
|
|
||||||
"${baseUserConfig.username}@pilecki" = mkHomeConfig {
|
"${defaultUserConfig.username}@pilecki" = mkHome {
|
||||||
isNixOS = true;
|
|
||||||
overrides = {
|
|
||||||
mainMonitor = "LVDS-1";
|
|
||||||
};
|
|
||||||
hostName = "pilecki";
|
hostName = "pilecki";
|
||||||
|
mainMonitor = "LVDS-1";
|
||||||
};
|
};
|
||||||
|
|
||||||
"${baseUserConfig.username}@paderewski" = mkHomeConfig {
|
"${defaultUserConfig.username}@paderewski" = mkHome {
|
||||||
isNixOS = true;
|
|
||||||
overrides = {
|
|
||||||
mainMonitor = "DP-1";
|
|
||||||
};
|
|
||||||
hostName = "paderewski";
|
hostName = "paderewski";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
isNixOS,
|
|
||||||
userConfig,
|
userConfig,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
@@ -9,7 +8,7 @@
|
|||||||
{
|
{
|
||||||
programs.ashell = {
|
programs.ashell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
settings = {
|
settings = {
|
||||||
outputs = {
|
outputs = {
|
||||||
Targets = [ userConfig.mainMonitor ];
|
Targets = [ userConfig.mainMonitor ];
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
isNixOS,
|
|
||||||
userConfig,
|
userConfig,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@@ -9,7 +8,7 @@
|
|||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package =
|
||||||
if isNixOS then pkgs.waybar else (pkgs.writeShellScriptBin "waybar" "exec /usr/bin/waybar \"$@\"");
|
if userConfig.isNixOS then pkgs.waybar else (pkgs.writeShellScriptBin "waybar" "exec /usr/bin/waybar \"$@\"");
|
||||||
settings = {
|
settings = {
|
||||||
mainBar = {
|
mainBar = {
|
||||||
layer = "top";
|
layer = "top";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ isNixOS, hostName, ... }:
|
{ userConfig, hostName, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
update = {
|
update = {
|
||||||
body =
|
body =
|
||||||
if isNixOS then
|
if userConfig.isNixOS then
|
||||||
# fish
|
# fish
|
||||||
''
|
''
|
||||||
echo "=== System packages update ==="
|
echo "=== System packages update ==="
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{ isNixOS, lib, ... }:
|
{ userConfig, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.chromium = {
|
programs.chromium = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ lib, isNixOS, ... }:
|
{ lib, userConfig, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
settings = {
|
settings = {
|
||||||
confirm_os_window_close = 0;
|
confirm_os_window_close = 0;
|
||||||
dynamic_background_opacity = true;
|
dynamic_background_opacity = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ isNixOS, pkgs, ... }:
|
{ userConfig, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.mako = {
|
services.mako = {
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
progress-color = "over #313244";
|
progress-color = "over #313244";
|
||||||
output = "DP-1";
|
output = "DP-1";
|
||||||
on-notify =
|
on-notify =
|
||||||
if isNixOS then
|
if userConfig.isNixOS then
|
||||||
"exec ${pkgs.pulseaudio}/bin/paplay ${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/dialog-information.oga"
|
"exec ${pkgs.pulseaudio}/bin/paplay ${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/dialog-information.oga"
|
||||||
else
|
else
|
||||||
"exec paplay /usr/share/sounds/freedesktop/stereo/dialog-information.oga";
|
"exec paplay /usr/share/sounds/freedesktop/stereo/dialog-information.oga";
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
[urgency=critical]
|
[urgency=critical]
|
||||||
on-notify=${
|
on-notify=${
|
||||||
if isNixOS then
|
if userConfig.isNixOS then
|
||||||
"exec ${pkgs.pulseaudio}/bin/paplay ${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/dialog-information.oga"
|
"exec ${pkgs.pulseaudio}/bin/paplay ${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/dialog-information.oga"
|
||||||
else
|
else
|
||||||
"exec paplay /usr/share/sounds/freedesktop/stereo/dialog-information.oga"
|
"exec paplay /usr/share/sounds/freedesktop/stereo/dialog-information.oga"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
isNixOS,
|
userConfig,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
programs.mangohud = {
|
programs.mangohud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = if isNixOS then pkgs.mangohud else (pkgs.runCommand "dummy-mangohud" { } "mkdir $out");
|
package = if userConfig.isNixOS then pkgs.mangohud else (pkgs.runCommand "dummy-mangohud" { } "mkdir $out");
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."MangoHud/MangoHud.conf".text = ''
|
xdg.configFile."MangoHud/MangoHud.conf".text = ''
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
|
|||||||
owner = "catppuccin";
|
owner = "catppuccin";
|
||||||
repo = "obsidian";
|
repo = "obsidian";
|
||||||
rev = "main";
|
rev = "main";
|
||||||
hash = "sha256-IGkP0z8gJj1dbNclpMebZXZvaRby1F8zGNEDPtitfqo=";
|
hash = "sha256-uB0a2nSZkHHf65xBYXyNh50vaAiqdEpKQVf3eXnCVlE=";
|
||||||
};
|
};
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
isNixOS,
|
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
userConfig,
|
userConfig,
|
||||||
@@ -9,7 +8,7 @@
|
|||||||
{
|
{
|
||||||
programs.obsidian = {
|
programs.obsidian = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
|
|
||||||
defaultSettings = {
|
defaultSettings = {
|
||||||
app = {
|
app = {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
isNixOS,
|
|
||||||
userConfig,
|
userConfig,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@@ -8,7 +7,7 @@
|
|||||||
{
|
{
|
||||||
programs.satty = {
|
programs.satty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
settings = {
|
settings = {
|
||||||
general = {
|
general = {
|
||||||
fullscreen = true;
|
fullscreen = true;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ isNixOS, lib, ... }:
|
{ userConfig, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.hypridle = {
|
services.hypridle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
general = {
|
general = {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
isNixOS,
|
|
||||||
lib,
|
lib,
|
||||||
userConfig,
|
userConfig,
|
||||||
pkgs,
|
pkgs,
|
||||||
@@ -7,7 +6,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
exe = pkg: bin: if isNixOS then "${pkg}/bin/${bin}" else "/usr/bin/${bin}";
|
exe = pkg: bin: if userConfig.isNixOS then "${pkg}/bin/${bin}" else "/usr/bin/${bin}";
|
||||||
|
|
||||||
jq = exe pkgs.jq "jq";
|
jq = exe pkgs.jq "jq";
|
||||||
grim = exe pkgs.grim "grim";
|
grim = exe pkgs.grim "grim";
|
||||||
@@ -15,7 +14,7 @@ let
|
|||||||
wl_copy = exe pkgs.wl-clipboard "wl-copy";
|
wl_copy = exe pkgs.wl-clipboard "wl-copy";
|
||||||
notify_send = exe pkgs.libnotify "notify-send";
|
notify_send = exe pkgs.libnotify "notify-send";
|
||||||
xdg-desktop-portal-hyprland =
|
xdg-desktop-portal-hyprland =
|
||||||
if isNixOS then
|
if userConfig.isNixOS then
|
||||||
"${pkgs.xdg-desktop-portal-hyprland}/libexec/xdg-desktop-portal-hyprland"
|
"${pkgs.xdg-desktop-portal-hyprland}/libexec/xdg-desktop-portal-hyprland"
|
||||||
else
|
else
|
||||||
"/usr/lib/xdg-desktop-portal-hyprland";
|
"/usr/lib/xdg-desktop-portal-hyprland";
|
||||||
@@ -26,9 +25,9 @@ in
|
|||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package =
|
||||||
if isNixOS then inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland else null;
|
if userConfig.isNixOS then inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland else null;
|
||||||
portalPackage = lib.mkIf (
|
portalPackage = lib.mkIf (
|
||||||
isNixOS
|
userConfig.isNixOS
|
||||||
) inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
) inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
|
|
||||||
@@ -36,9 +35,9 @@ in
|
|||||||
"$mainMod" = "SUPER";
|
"$mainMod" = "SUPER";
|
||||||
"$terminal" = "uwsm app -- kitty";
|
"$terminal" = "uwsm app -- kitty";
|
||||||
"$menu" = "hyprlauncher";
|
"$menu" = "hyprlauncher";
|
||||||
"$music_player" = if isNixOS then "spotify" else "flatpak run com.spotify.Client";
|
"$music_player" = if userConfig.isNixOS then "spotify" else "flatpak run com.spotify.Client";
|
||||||
"$notes" = "obsidian";
|
"$notes" = "obsidian";
|
||||||
"$browser" = if isNixOS then "zen-beta" else "zen-browser"; # beta on nixos
|
"$browser" = if userConfig.isNixOS then "zen-beta" else "zen-browser"; # beta on nixos
|
||||||
"$openrgb_color" = "09ce30";
|
"$openrgb_color" = "09ce30";
|
||||||
|
|
||||||
env = [
|
env = [
|
||||||
@@ -60,7 +59,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
animations = {
|
animations = {
|
||||||
enabled = true;
|
enabled = false;
|
||||||
bezier = [
|
bezier = [
|
||||||
"easeOutQuint,0.23,1,0.32,1"
|
"easeOutQuint,0.23,1,0.32,1"
|
||||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||||
@@ -142,6 +141,11 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
device = {
|
||||||
|
name = "msft0001:01-06cb:7f28-touchpad";
|
||||||
|
sensitivity = 0;
|
||||||
|
};
|
||||||
|
|
||||||
cursor = {
|
cursor = {
|
||||||
no_hardware_cursors = true;
|
no_hardware_cursors = true;
|
||||||
inactive_timeout = 5;
|
inactive_timeout = 5;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ isNixOS, lib, ... }:
|
{ userConfig, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.hyprlauncher = {
|
services.hyprlauncher = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
cache.enabled = true;
|
cache.enabled = true;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ isNixOS, lib, ... }:
|
{ userConfig, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.hyprlock = {
|
programs.hyprlock = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (!isNixOS) null;
|
package = lib.mkIf (!userConfig.isNixOS) null;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
"$font" = "Monospace";
|
"$font" = "Monospace";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
isNixOS,
|
userConfig,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
services.hyprsunset = {
|
services.hyprsunset = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package =
|
||||||
if isNixOS then
|
if userConfig.isNixOS then
|
||||||
pkgs.hyprsunset
|
pkgs.hyprsunset
|
||||||
else
|
else
|
||||||
(pkgs.writeShellScriptBin "hyprsunset" "exec /usr/bin/hyprsunset \"$@\"");
|
(pkgs.writeShellScriptBin "hyprsunset" "exec /usr/bin/hyprsunset \"$@\"");
|
||||||
|
|||||||
Reference in New Issue
Block a user