configured gnome

This commit is contained in:
Kristian Krsnik 2023-07-31 20:08:25 +02:00
parent 564554551c
commit 85a24bf62c
26 changed files with 210 additions and 378 deletions

View File

@ -1,5 +0,0 @@
{enable}: {
inherit enable;
settings.font.size = 14.0;
settings.window.opacity = 0.8;
}

34
flake.lock generated
View File

@ -110,6 +110,38 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-master": {
"locked": {
"lastModified": 1690803489,
"narHash": "sha256-TqdStgF+EA+kJ8PzVjOxa8HdM684CmZZz2ohlKq9j4A=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0d117d7ad5d590991d23ccc7bd88c4e627cccf17",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1690640159,
"narHash": "sha256-5DZUYnkeMOsVb/eqPYb9zns5YsnQXRJRC8Xx/nPMcno=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e6ab46982debeab9831236869539a507f670a129",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1689956312, "lastModified": 1689956312,
@ -162,6 +194,8 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur", "nur": "nur",
"zig": "zig" "zig": "zig"
} }

View File

@ -2,25 +2,29 @@
description = "Home Manager configuration of kristian"; description = "Home Manager configuration of kristian";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixpkgs.url = github:nixos/nixpkgs/nixos-23.05;
nixpkgs-unstable.url = github:nixos/nixpkgs/nixos-unstable;
nixpkgs-master.url = github:nixos/nixpkgs/master;
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-23.05"; url = github:nix-community/home-manager/release-23.05;
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Hyprland Window Manager # Hyprland Window Manager
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = github:hyprwm/Hyprland;
# Nix User Repository # Nix User Repository
nur.url = "github:nix-community/NUR"; nur.url = github:nix-community/NUR;
# Zig # Zig
zig.url = "github:mitchellh/zig-overlay"; zig.url = github:mitchellh/zig-overlay;
}; };
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
nixpkgs-unstable,
nixpkgs-master,
home-manager, home-manager,
hyprland, hyprland,
nur, nur,
@ -30,23 +34,39 @@
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in {
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
homeConfigurations = { homeConfigurations = {
kristian = home-manager.lib.homeManagerConfiguration { kristian = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home.nix ./home
{
nixpkgs.overlays = [
hyprland.overlays.default # Adds waybar-hyprland
zig.overlays.default
];
}
hyprland.homeManagerModules.default hyprland.homeManagerModules.default
nur.nixosModules.nur nur.nixosModules.nur
{
nixpkgs.overlays = [
hyprland.overlays.default # Adds waybar-hyprland
zig.overlays.default # Adds zig
( # https://github.com/nix-community/home-manager/issues/1538#issuecomment-706627100
final: prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config = {allowUnfreePredicate = _: true;};
};
#master = import inputs.nixpkgs-master {
# system = final.system;
# config = {allowUnfreePredicate = (_: true);};
#};
}
)
( # Overrides davinci-resolve with the unstable version because of https://github.com/NixOS/nixpkgs/pull/246074
final: prev: {davinci-resolve = final.unstable.davinci-resolve;}
)
];
}
]; ];
}; };
}; };

109
home.nix
View File

@ -1,109 +0,0 @@
{
config,
pkgs,
lib,
options,
specialArgs,
modulesPath,
}: {
nixpkgs.config.allowUnfreePredicate = _: true;
home.stateVersion = "23.05";
home.username = "kristian";
home.homeDirectory = "/home/kristian";
# For cursor not showing in hyprland with nvidia
home.sessionVariables.WLR_NO_HARDWARE_CURSORS = "1";
# Symlinks
home.file = {
".wallpaper".source = ./wallpaper; # Wallpaper
#"Media".source = config.lib.file.mkOutOfStoreSymlink "/mnt/Media";
#"Documents".source = config.lib.file.mkOutOfStoreSymlink "/mnt/Documents";
};
# TODO: Change for Laptop
targets.genericLinux.enable = false; # Enable on non-nixos ditros
# Keyboard Layout
home.keyboard.layout = "at"; # NOTE: Set by Hyprland config
# Programs (additional programs)
home.packages = import ./packages.nix {inherit pkgs;};
## Services
services.copyq.enable = true;
services.playerctld.enable = true; # for mpris waybar module
# Programs
programs = {
home-manager.enable = true; # Allow home-manager to manage itself
wofi.enable = true;
mpv.enable = true;
obs-studio.enable = true;
zathura.enable = true;
yt-dlp.enable = true;
lf.enable = true;
vscode.enable = true;
bashmount.enable = true;
bash = import ./bash.nix {enable = true;};
alacritty = import ./alacritty.nix {enable = true;};
neovim = import ./nvim {
enable = true;
pkgs = pkgs;
};
firefox = import ./firefox.nix {
enable = true;
nur = config.nur;
};
waybar = import ./waybar.nix {
enable = true;
pkgs = pkgs;
};
git = import ./git.nix {enable = true;};
thunderbird = import ./thunderbird.nix {enable = true;};
};
xdg.mimeApps = {
enable = true;
defaultApplications = {"video/*" = ["mpv.desktop"];};
};
systemd.user.mounts = let
home = "home-kristian";
in {
"${home}-Documents" = {
Unit = {
Description = "Mount Documents";
After = ["graphical.target "];
Wants = ["graphical.target"];
};
Install = {WantedBy = ["default.target"];};
Mount = {
What = "kristian@krsnik.at:/mnt/TITAN/Documents";
Where = "/home/kristian/Documents";
Type = "fuse.sshfs";
Options = "_netdev,reconnect,ServerAliveInterval=30,ServerAliveCountMax=5,x-systemd.automount";
TimeoutSec = 60;
};
};
"${home}-Media" = {
Unit = {
Description = "Mount Media";
After = ["graphical.target "];
Wants = ["graphical.target"];
};
Install = {WantedBy = ["default.target"];};
Mount = {
What = "kristian@krsnik.at:/mnt/TITAN/Media";
Where = "/home/kristian/Media";
Type = "fuse.sshfs";
Options = "_netdev,reconnect,ServerAliveInterval=30,ServerAliveCountMax=5,x-systemd.automount";
TimeoutSec = 60;
};
};
};
wayland.windowManager.hyprland = import ./hyprland.nix {enable = true;};
}

69
home/default.nix Normal file
View File

@ -0,0 +1,69 @@
{
config,
pkgs,
lib,
options,
specialArgs,
modulesPath,
}: {
nixpkgs.config.allowUnfreePredicate = _: true;
home.stateVersion = "23.05";
home.username = "kristian";
home.homeDirectory = "/home/kristian";
home.sessionVariables = {
# Electron programms won't render correctly under wayland without this
NIXOS_OZONE_WL = 1;
};
# Symlinks
home.file = {
".wallpaper".source = ./wallpaper;
};
# TODO: Change for Laptop
targets.genericLinux.enable = false; # Enable on non-nixos ditros
# Keyboard Layout
home.keyboard.layout = "at"; # NOTE: Set by Hyprland config
# Programs (additional programs)
home.packages = import ./packages.nix {inherit pkgs;};
# Services
services = {
copyq.enable = true;
};
# Programs
programs = {
home-manager.enable = true; # Allow home-manager to manage itself
mpv.enable = true;
obs-studio.enable = true;
yt-dlp.enable = true;
bash = import ./bash.nix {enable = true;};
vscode = import ./vscode.nix {enable = true;};
git = import ./git.nix {enable = true;};
thunderbird = import ./thunderbird.nix {enable = true;};
neovim = import ./nvim {
enable = true;
inherit pkgs;
};
firefox = import ./firefox.nix {
enable = true;
nur = config.nur;
};
};
xdg.mimeApps = {
enable = true;
defaultApplications = {"video/*" = ["mpv.desktop"];};
};
# Gnome settings
dconf.settings = import ./gnome.nix {inherit lib;};
}

36
home/gnome.nix Normal file
View File

@ -0,0 +1,36 @@
{lib}: {
# Use `dconf watch /` to track stateful changes you are doing, then set them here.
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
"org/gnome/desktop/background" = {
picture-uri = "file:///home/kristian/.wallpaper";
picture-uri-dark = "file:///home/kristian/.wallpaper";
};
"org/gnome/desktop/wm/keybindings" = {
switch-to-workspace-left = ["<Alt>1"];
switch-to-workspace-right = ["<Alt>2"];
move-to-workspace-left = ["<Shift><Alt>1"];
move-to-workspace-right = ["<Shift><Alt>2"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Shift><Alt>a";
command = "kgx";
name = "Console";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
binding = "<Shift><Alt>f";
command = "nautilus";
name = "File Manager";
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
];
};
"org/gnome/mutter" = {
edge-tiling = true;
dynamic-workspaces = true;
};
}

27
home/packages.nix Normal file
View File

@ -0,0 +1,27 @@
{pkgs}:
with pkgs; [
# Basic utils
unzip
magic-wormhole
# Important graphical applications
keepassxc
logseq
xournalpp
onlyoffice-bin
# Communication
discord
telegram-desktop
signal-desktop
element-desktop
# Video Editor
davinci-resolve
# LaTeX Editor
setzer
# Misc
nerdfonts # Font with glyphs for status bar
]

11
home/vscode.nix Normal file
View File

@ -0,0 +1,11 @@
{enable}: {
inherit enable;
enableUpdateCheck = false;
keybindings = [
{
key = "alt+a";
command = "editor.action.commentLine";
when = "editorTextFocus && !editorReadonly";
}
];
}

BIN
home/wallpaper Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

View File

@ -1,90 +0,0 @@
{enable}: {
inherit enable;
xwayland.enable = true;
extraConfig = ''
# Waybar
exec-once = waybar
# Notifications Daemon
exec-once = dunst &
# Wallpaper
exec-once = swww init
exec-once = swww img ~/.wallpaper --transition-step 255
# Clipboard
exec-once = copyq --start-server
# Window Rules
windowrulev2 = float,title:(CopyQ)$
windowrulev2 = float,title:^(Volume Control)$
# Keybinds
$Mod = Alt
$altMod = SUPER
bind = $Mod, D, exec, wofi --show drun
bind = $Mod, Return, exec, alacritty
bind = $Mod, V, exec, copyq
bind = $Mod, S, exec, grim -g "$(slurp)"
bind = $Mod SHIFT, C, exec, copyq show
bind = $Mod, C, killactive,
bind = $Mod CONTROL SHIFT, K, exit,
bind = $Mod, M, togglefloating
bind = $Mod, F, fullscreen, 1 # maximize
bind = $Mod SHIFT, F, fullscreen, 0 # fullscreen
bind = $Mod, P, pseudo
# Move focus with mainMod + arrow keys
bind = $Mod, h, movefocus, l
bind = $Mod, j, movefocus, d
bind = $Mod, k, movefocus, u
bind = $Mod, l, movefocus, r
bind = $Mod SHIFT, h, swapwindow, l
bind = $Mod SHIFT, j, swapwindow, d
bind = $Mod SHIFT, k, swapwindow, u
bind = $Mod SHIFT, l, swapwindow, r
bind = $Mod , Tab, cyclenext, prev
bind = $Mod SHIFT, Tab, cyclenext,
# Layouting
bind = $Mod , Space, togglegroup,
bind = $altMod , Tab , changegroupactive, forward
bind = $altMod SHIFT, Tab , changegroupactive, back
bind = $altMod, h, moveintogroup, l
bind = $altMod, j, moveintogroup, d
bind = $altMod, k, moveintogroup, u
bind = $altMod, l, moveintogroup, r
bind = $altMod SHIFT, h, moveoutofgroup, l
bind = $altMod SHIFT, j, moveoutofgroup, d
bind = $altMod SHIFT, k, moveoutofgroup, u
bind = $altMod SHIFT, l, moveoutofgroup, r
# Switch workspaces
bind = $Mod, 1, workspace, -1
bind = $Mod, 2, workspace, +1
# Move active window to a workspace
bind = $Mod SHIFT, 1, movetoworkspace, -1
bind = $Mod SHIFT, 2, movetoworkspace, +1
# Scroll through existing workspaces
bind = $Mod, mouse_up, workspace, -1
bind = $Mod, mouse_down, workspace, +1
# Move/resize windows
bindm = $Mod, mouse:272, movewindow
bindm = $Mod, mouse:273, resizewindow
# TODO: renameworkspace with dmenu or rofi prompt
input {
kb_layout = at
}
'';
}

View File

@ -1,48 +0,0 @@
{pkgs}:
with pkgs; [
# Basic utils
unzip
magic-wormhole
wl-clipboard # vim clipboard access
# Audio
pulseaudio
pulsemixer
pavucontrol
# Important graphical applications
keepassxc
logseq
xournalpp
onlyoffice-bin
# Communication
discord
telegram-desktop
signal-desktop
element-desktop
# For Hyprland
libsForQt5.polkit-kde-agent # For permission pop-ups
libsForQt5.qt5.qtwayland
qt6.qtwayland
dunst # Notifications
swww # Wallpaper
grim
slurp # Screenshots
# Video Editor
# davinci-resolve # Currently borken. Fixed in https://github.com/NixOS/nixpkgs/pull/242751
# LaTeX Editor
setzer
gnome.nautilus
steam
# Misc
nerdfonts # Font with glyphs for status bar
zigpkgs.master # latest nightly release of zig
]

BIN
wallpaper

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 MiB

View File

@ -1,113 +0,0 @@
{
pkgs,
enable,
}: {
inherit enable;
package = pkgs.waybar-hyprland;
settings = {
mainBar = {
layer = "top";
height = 30;
modules-left = ["wlr/workspaces"];
modules-center = ["clock"];
modules-right = ["pulseaudio" "memory" "cpu" "tray"];
"hyprland/workspaces" = {
format = "{icon}";
on-click = "activate";
on-scroll-up = "hyprctl dispatch workspace e+1";
on-scroll-down = "hyprctl dispatch workspace e-1";
#format-icons = {
# "1" = "";
# "2" = "";
# "3" = "";
# "4" = "";
# "5" = "";
# urgent = "";
# active = "";
# default = "";
#};
sort-by-number = true;
};
"wlr/window" = {
max-length = 50;
};
mpris = {
format = "DEFAULT: {player_icon} {dynamic}";
format-paused = "DEFAULT: {status_icon} <i>{dynamic}</i>";
player-icons = {
default = "";
mpv = "🎵";
};
status-icons = {
paused = "";
};
};
pulseaudio = {
format = "{volume}% {icon}";
format-bluetooth = " {volume}% {icon}";
format-muted = "";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = ["" ""];
};
scroll-step = 1;
on-click = "pavucontrol";
ignored-sinks = ["Easy Effects Sink"];
};
cpu = {
interval = 10;
format = " {load}% {icon}";
format-icons = ["" "" "" "" "" "" "" ""];
};
memory = {
interval = 30;
format = " {used:0.1f}G / {total:0.1f}G";
};
clock = {
# TODO: Fix that calendar width is too small
format = "{:%H:%M} ";
format-alt = "{:%A, %B %d, %Y (%R)}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
actions = {
on-click-right = "mode";
on-click-forward = "tz_up";
on-click-backward = "tz_down";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
tray = {
"icon-size" = 21;
"spacing" = 10;
};
};
};
}