refactor: change structure of nix files
This commit is contained in:
parent
5652480f01
commit
534d7db975
7 changed files with 147 additions and 141 deletions
|
@ -36,4 +36,9 @@
|
|||
hardware.sensor.iio.enable = true;
|
||||
hardware.opengl.enable = true;
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
virtualisation = {
|
||||
waydroid.enable = true;
|
||||
lxd.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
10
nixos/cfg/main.nix
Normal file
10
nixos/cfg/main.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./extra-hardware.nix
|
||||
./security.nix
|
||||
./packages.nix
|
||||
];
|
||||
}
|
|
@ -1,6 +1,83 @@
|
|||
{config, pkgs, ...}:
|
||||
|
||||
{
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
layout = "ca";
|
||||
displayManager = {
|
||||
gdm = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
};
|
||||
sessionPackages = [
|
||||
pkgs.gnome.gnome-session.sessions # gnome session needed to fix bugs
|
||||
(builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default
|
||||
];
|
||||
defaultSession = "hyprland";
|
||||
#autoLogin = { # logs out after a minute
|
||||
# enable = true;
|
||||
# user = "matt";
|
||||
#};
|
||||
};
|
||||
libinput.enable = true;
|
||||
};
|
||||
dbus.enable = true;
|
||||
flatpak.enable = true;
|
||||
tlp.enable = true;
|
||||
|
||||
locate = {
|
||||
enable = true;
|
||||
interval = "hourly";
|
||||
prunePaths = [
|
||||
"/tmp"
|
||||
"/var/tmp"
|
||||
"/var/cache"
|
||||
"/var/lock"
|
||||
"/var/run"
|
||||
"/var/spool"
|
||||
"/nix/var/log/nix"
|
||||
"/proc"
|
||||
"/run/user/1000"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal.enable = true;
|
||||
|
||||
programs = {
|
||||
|
||||
tmux = {
|
||||
enable = true;
|
||||
keyMode = "vi";
|
||||
terminal = "screen-256color";
|
||||
newSession = true;
|
||||
historyLimit = 30000;
|
||||
extraConfig = ''
|
||||
bind-key -n Home send Escape "OH"
|
||||
bind-key -n End send Escape "OF"
|
||||
set -g mouse on
|
||||
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
|
||||
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
|
||||
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
|
||||
'';
|
||||
};
|
||||
|
||||
git = { # TODO: make better config
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
};
|
||||
|
||||
htop = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
fzf = {
|
||||
fuzzyCompletion = true;
|
||||
keybindings = true;
|
||||
};
|
||||
};
|
||||
|
||||
# List packages in root user PATH
|
||||
environment.systemPackages = with pkgs; [
|
||||
wl-clipboard
|
||||
|
@ -28,6 +105,7 @@
|
|||
serif = [ "MesloLGS Nerd Font" ];
|
||||
};*/
|
||||
};
|
||||
|
||||
fonts = with pkgs; [
|
||||
(nerdfonts.override { fonts = [ "JetBrainsMono" "Go-Mono" "Iosevka" "NerdFontsSymbolsOnly" "SpaceMono" "Ubuntu" ]; })
|
||||
noto-fonts
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
layout = "ca";
|
||||
displayManager = {
|
||||
gdm = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
}; # gnome session needed to fix bugs
|
||||
sessionPackages = [ pkgs.gnome.gnome-session.sessions ];
|
||||
# See ./cfg/home-manager.nix
|
||||
#defaultSession = "hyprland";
|
||||
#autoLogin = { # logs out after a minute
|
||||
# enable = true;
|
||||
# user = "matt";
|
||||
#};
|
||||
};
|
||||
libinput.enable = true;
|
||||
};
|
||||
|
||||
xdg.portal.enable = true;
|
||||
|
||||
virtualisation = {
|
||||
waydroid.enable = true;
|
||||
lxd.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
dbus.enable = true;
|
||||
flatpak.enable = true;
|
||||
tlp.enable = true;
|
||||
|
||||
locate = {
|
||||
enable = true;
|
||||
interval = "hourly";
|
||||
prunePaths = [
|
||||
"/tmp"
|
||||
"/var/tmp"
|
||||
"/var/cache"
|
||||
"/var/lock"
|
||||
"/var/run"
|
||||
"/var/spool"
|
||||
"/nix/var/log/nix"
|
||||
"/proc"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
|
||||
waybar = {
|
||||
enable = true;
|
||||
package = pkgs.waybar.overrideAttrs (oldAttrs: {
|
||||
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
|
||||
});
|
||||
};
|
||||
|
||||
tmux = {
|
||||
enable = true;
|
||||
keyMode = "vi";
|
||||
terminal = "screen-256color";
|
||||
newSession = true;
|
||||
historyLimit = 30000;
|
||||
extraConfig = ''
|
||||
bind-key -n Home send Escape "OH"
|
||||
bind-key -n End send Escape "OF"
|
||||
set -g mouse on
|
||||
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
|
||||
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
|
||||
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
|
||||
'';
|
||||
};
|
||||
|
||||
git = { # TODO: make better config
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
};
|
||||
|
||||
htop = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
fzf = {
|
||||
fuzzyCompletion = true;
|
||||
keybindings = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,12 +5,8 @@
|
|||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./overlays/list.nix
|
||||
./cfg/boot.nix
|
||||
./cfg/security.nix
|
||||
./cfg/extra-hardware.nix
|
||||
./cfg/services.nix
|
||||
./cfg/packages.nix
|
||||
./cfg/home-manager.nix
|
||||
./cfg/main.nix
|
||||
./home/main.nix
|
||||
];
|
||||
|
||||
networking.hostName = "wim";
|
||||
|
|
39
nixos/home/hyprland.nix
Normal file
39
nixos/home/hyprland.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ pkgs, ... }: let
|
||||
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
|
||||
|
||||
hyprland = (import flake-compat {
|
||||
# I use release version for plugin support
|
||||
src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz";
|
||||
}).defaultNix;
|
||||
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
(builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default
|
||||
(builtins.getFlake "path:/home/matt/git/hyprland-touch-gestures").packages.x86_64-linux.default
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:\$XDG_DATA_DIRS";
|
||||
};
|
||||
|
||||
imports = [
|
||||
hyprland.homeManagerModules.default
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = (builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default; # to be able to get the right ver from hyprctl version
|
||||
|
||||
plugins = [
|
||||
"${(builtins.getFlake "path:/home/matt/git/hyprland-touch-gestures").packages.x86_64-linux.default}/lib/libtouch-gestures.so"
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
exec-once = ${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1
|
||||
source = ~/.config/hypr/main.conf
|
||||
env = XDG_DATA_DIRS, ${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:$XDG_DATA_DIRS
|
||||
env = SUDO_ASKPASS, ${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,13 +1,8 @@
|
|||
{ config, ... }: let
|
||||
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
hyprland = (import flake-compat {
|
||||
# I use release version for plugin support
|
||||
src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz";
|
||||
}).defaultNix;
|
||||
|
||||
in
|
||||
{
|
||||
## Global config to add home-manager module
|
||||
#############################################################################
|
||||
imports =
|
||||
[
|
||||
<home-manager/nixos>
|
||||
|
@ -19,10 +14,17 @@ in
|
|||
extraGroups = [ "wheel" "input" "adm" "mlocate" "video" ];
|
||||
};
|
||||
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.useGlobalPkgs = true;
|
||||
programs.dconf.enable = true;
|
||||
#############################################################################
|
||||
|
||||
home-manager.users.matt = {
|
||||
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
];
|
||||
|
||||
home-manager.users.matt = { config, pkgs, lib, ... }: {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
package = pkgs.waybar.overrideAttrs (oldAttrs: {
|
||||
|
@ -62,8 +64,6 @@ in
|
|||
|
||||
]) ++
|
||||
[
|
||||
(builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default
|
||||
(builtins.getFlake "path:/home/matt/git/hyprland-touch-gestures").packages.x86_64-linux.default
|
||||
swayosd
|
||||
qt5.qtwayland
|
||||
qt6.qtwayland
|
||||
|
@ -80,7 +80,7 @@ in
|
|||
xdg-utils
|
||||
pavucontrol # TODO: open on left click
|
||||
gimp-with-plugins
|
||||
jdk8_headless
|
||||
jdk19_headless
|
||||
bluez-tools
|
||||
spotify
|
||||
#spotifywm # fails to build
|
||||
|
@ -121,7 +121,6 @@ in
|
|||
lxappearance
|
||||
imagemagick
|
||||
usbutils
|
||||
catppuccin-plymouth
|
||||
evtest
|
||||
squeekboard
|
||||
glib
|
||||
|
@ -139,6 +138,7 @@ in
|
|||
done
|
||||
) &
|
||||
|
||||
SUDO_ASKPASS = "${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname}";
|
||||
exec sudo -k -EA '${gparted}/bin/${gparted.pname}' "$@"
|
||||
'')
|
||||
];
|
||||
|
@ -159,38 +159,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:\$XDG_DATA_DIRS";
|
||||
SUDO_ASKPASS = "${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname}";
|
||||
};
|
||||
|
||||
imports = [
|
||||
hyprland.homeManagerModules.default
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = (builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default; # to be able to get the right ver from hyprctl version
|
||||
|
||||
plugins = with pkgs; [
|
||||
"${(builtins.getFlake "path:/home/matt/git/hyprland-touch-gestures").packages.x86_64-linux.default}/lib/libtouch-gestures.so"
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
exec-once = ${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1
|
||||
source = ~/.config/hypr/main.conf
|
||||
env = XDG_DATA_DIRS, ${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:$XDG_DATA_DIRS
|
||||
env = SUDO_ASKPASS, ${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname}
|
||||
'';
|
||||
};
|
||||
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
services.xserver.displayManager = {
|
||||
sessionPackages = [
|
||||
(builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default
|
||||
];
|
||||
defaultSession = "hyprland";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue