nixpkgs-fmt

This commit is contained in:
LordGrimmauld 2024-04-10 16:51:28 +02:00
parent e8abbd0c1f
commit 36252de722
28 changed files with 502 additions and 438 deletions

View file

@ -1,47 +1,66 @@
{pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
config = with cfg; lib.mkIf (enable && cloudSync.enable) (let {
cloud_cmd = ''${pkgs.nextcloud-client}/bin/nextcloudcmd -u ${config.grimmShared.cloudSync.username} -p "$(cat ${config.grimmShared.cloudSync.passwordFile})" -h -n --path''; config = with cfg; lib.mkIf (enable && cloudSync.enable) (
sync_server = "https://${config.grimmShared.cloudSync.server}"; let
in { cloud_cmd = ''${pkgs.nextcloud-client}/bin/nextcloudcmd -u ${config.grimmShared.cloudSync.username} -p "$(cat ${config.grimmShared.cloudSync.passwordFile})" -h -n --path'';
environment.systemPackages = with pkgs; [ sync_server = "https://${config.grimmShared.cloudSync.server}";
(writeShellScriptBin "cloudsync-cmd" (cloud_cmd + " $@ " + sync_server)) in
nextcloud-client {
]; environment.systemPackages = with pkgs; [
(writeShellScriptBin "cloudsync-cmd" (cloud_cmd + " $@ " + sync_server))
nextcloud-client
];
systemd.services = lib.mkMerge (lib.mapAttrsToList (local_user: user_conf: let systemd.services = lib.mkMerge (lib.mapAttrsToList
paths = user_conf.syncPaths; (local_user: user_conf:
sync_script = lib.strings.concatLines (map ({local, remote}: let let
remote_clean = lib.strings.concatStrings (builtins.match "/*(.+)" remote); paths = user_conf.syncPaths;
in "${cloud_cmd} /${remote_clean} ${local} ${sync_server}" ) paths); sync_script = lib.strings.concatLines (map
in { # user-specific sync jobs ({ local, remote }:
"nextcloud-autosync-${local_user}" = lib.mkIf ( paths != [] ) { let
description = "Auto sync Nextcloud"; remote_clean = lib.strings.concatStrings (builtins.match "/*(.+)" remote);
after = [ "network-online.target" ]; in
wants = [ "network-online.target" ]; "${cloud_cmd} /${remote_clean} ${local} ${sync_server}")
serviceConfig.Type = "simple"; paths);
serviceConfig.User = local_user; in
serviceConfig.Group= "users"; {
script= sync_script; # user-specific sync jobs
# TimeoutStopSec = "180"; "nextcloud-autosync-${local_user}" = lib.mkIf (paths != [ ]) {
# KillMode = "process"; description = "Auto sync Nextcloud";
# KillSignal = "SIGINT"; after = [ "network-online.target" ];
wantedBy = ["multi-user.target"]; wants = [ "network-online.target" ];
enable=true; serviceConfig.Type = "simple";
}; serviceConfig.User = local_user;
}) config.users.users ); serviceConfig.Group = "users";
script = sync_script;
# TimeoutStopSec = "180";
# KillMode = "process";
# KillSignal = "SIGINT";
wantedBy = [ "multi-user.target" ];
enable = true;
};
})
config.users.users);
systemd.timers = lib.mkMerge (lib.mapAttrsToList (local_user: user_conf: let systemd.timers = lib.mkMerge (lib.mapAttrsToList
paths = user_conf.syncPaths; (local_user: user_conf:
in { # user-specific sync jobs let
"nextcloud-autosync-${local_user}" = lib.mkIf ( paths != [] ) { paths = user_conf.syncPaths;
description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 60 minutes"; in
timerConfig.OnBootSec = "5min"; {
timerConfig.OnUnitActiveSec = "60min"; # user-specific sync jobs
wantedBy = ["multi-user.target" "timers.target"]; "nextcloud-autosync-${local_user}" = lib.mkIf (paths != [ ]) {
enable = true; description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 60 minutes";
}; timerConfig.OnBootSec = "5min";
}) config.users.users ); timerConfig.OnUnitActiveSec = "60min";
}); wantedBy = [ "multi-user.target" "timers.target" ];
enable = true;
};
})
config.users.users);
}
);
} }

View file

@ -1,26 +1,32 @@
{ inputs, pkgs, config, lib, ... }: let { inputs, pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && firefox.enable) { config = with cfg; lib.mkIf (enable && firefox.enable) {
environment.systemPackages = [] environment.systemPackages = [ ]
++ lib.optionals config.services.desktopManager.plasma6.enable [ pkgs.plasma-browser-integration ]; ++ lib.optionals config.services.desktopManager.plasma6.enable [ pkgs.plasma-browser-integration ];
programs.firefox = { programs.firefox = {
package = pkgs.firefox-beta; package = pkgs.firefox-beta;
enable = true; enable = true;
nativeMessagingHosts.packages = [] nativeMessagingHosts.packages = [ ]
++ lib.optionals (cfg.tooling.enable && cfg.tooling.pass) [ pkgs.passff-host ]; ++ lib.optionals (cfg.tooling.enable && cfg.tooling.pass) [ pkgs.passff-host ];
languagePacks = [ "de" "en-US" ]; languagePacks = [ "de" "en-US" ];
policies = { policies = {
ExtensionSettings = lib.mkMerge [ ExtensionSettings = lib.mkMerge [
(lib.mkIf cfg.firefox.disableUserPlugins { (lib.mkIf cfg.firefox.disableUserPlugins {
"*".installation_mode = "blocked"; "*".installation_mode = "blocked";
} ) })
(lib.mapAttrs (guid: shortId: { # explicit plugins by config (lib.mapAttrs
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; (guid: shortId: {
installation_mode = "force_installed"; # explicit plugins by config
} ) cfg.firefox.plugins ) install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
(lib.mkIf (cfg.tooling.enable && cfg.tooling.pass) { # password-store support installation_mode = "force_installed";
})
cfg.firefox.plugins)
(lib.mkIf (cfg.tooling.enable && cfg.tooling.pass) {
# password-store support
"passff@invicem.pro" = { "passff@invicem.pro" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/passff/latest.xpi"; install_url = "https://addons.mozilla.org/firefox/downloads/latest/passff/latest.xpi";
installation_mode = "force_installed"; installation_mode = "force_installed";
@ -42,8 +48,8 @@ in {
OverrideFirstRunPage = ""; OverrideFirstRunPage = "";
OverridePostUpdatePage = ""; OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true; DontCheckDefaultBrowser = true;
Preferences = lib.mkMerge ([] Preferences = lib.mkMerge ([ ]
++ lib.optionals cfg.sway.enable [ {"browser.tabs.inTitlebar" = 0; } ]); ++ lib.optionals cfg.sway.enable [{ "browser.tabs.inTitlebar" = 0; }]);
}; };
}; };
}; };

View file

@ -1,11 +1,13 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && gaming) { config = with cfg; lib.mkIf (enable && gaming) {
programs.steam = { programs.steam = {
enable = true; enable = true;
gamescopeSession.enable = true; gamescopeSession.enable = true;
gamescopeSession.env = { gamescopeSession.env = {
DRI_PRIME = "1"; DRI_PRIME = "1";
}; };
}; };
@ -14,7 +16,7 @@ in {
enable = true; enable = true;
settings = { settings = {
general = { general = {
inhibit_screensaver=0; inhibit_screensaver = 0;
renice = 10; renice = 10;
}; };
custom = { custom = {
@ -27,7 +29,7 @@ in {
services.udev.packages = [ pkgs.wooting-udev-rules ]; services.udev.packages = [ pkgs.wooting-udev-rules ];
environment.sessionVariables = { environment.sessionVariables = {
GAMEMODERUNEXEC="env DRI_PRIME=1"; GAMEMODERUNEXEC = "env DRI_PRIME=1";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -1,12 +1,14 @@
{ config, lib, ... }: let { config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && locale) { config = with cfg; lib.mkIf (enable && locale) {
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8"; LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8";

View file

@ -1,6 +1,8 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = lib.mkMerge [ config = lib.mkMerge [
(with cfg; lib.mkIf (enable && network) { (with cfg; lib.mkIf (enable && network) {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
@ -8,7 +10,7 @@ in {
networking.firewall.enable = true; networking.firewall.enable = true;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wireguard-tools wireguard-tools
bluetuith bluetuith

View file

@ -1,25 +1,27 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && graphical) { config = with cfg; lib.mkIf (enable && graphical) {
# Enable OpenGL # Enable OpenGL
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
extraPackages = with pkgs; []; extraPackages = with pkgs; [ ];
}; };
boot.kernelParams = [ "nouveau.config=NvGspRm=1" ]; boot.kernelParams = [ "nouveau.config=NvGspRm=1" ];
environment.sessionVariables = { environment.sessionVariables = {
__GL_LOG_MAX_ANISO = "0"; __GL_LOG_MAX_ANISO = "0";
__GL_SHADER_DISK_CACHE = "1"; __GL_SHADER_DISK_CACHE = "1";
__GL_SYNC_TO_VBLANK = "0"; __GL_SYNC_TO_VBLANK = "0";
__GL_THREADED_OPTIMIZATIONS = "1"; __GL_THREADED_OPTIMIZATIONS = "1";
__GL_VRR_ALLOWED = "1"; __GL_VRR_ALLOWED = "1";
# MESA_LOADER_DRIVER_OVERRIDE="zink"; # MESA_LOADER_DRIVER_OVERRIDE="zink";
# FLATPAK_GL_DRIVERS="mesa-git"; # FLATPAK_GL_DRIVERS="mesa-git";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -1,6 +1,8 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && tooling.enable && tooling.pass) { config = with cfg; lib.mkIf (enable && tooling.enable && tooling.pass) {
security.polkit.enable = true; security.polkit.enable = true;
@ -16,9 +18,9 @@ in {
]; ];
services.passSecretService.enable = true; services.passSecretService.enable = true;
programs.gnupg.agent = { programs.gnupg.agent = {
settings = { settings = {
# default-cache-ttl = 6000; # default-cache-ttl = 6000;
}; };
pinentryPackage = lib.mkForce pkgs.pinentry; pinentryPackage = lib.mkForce pkgs.pinentry;
enable = true; enable = true;

View file

@ -1,6 +1,8 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && portals) { config = with cfg; lib.mkIf (enable && portals) {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
@ -14,7 +16,7 @@ in {
environment.sessionVariables = { environment.sessionVariables = {
XDG_CONFIG_HOME = "$HOME/.config"; XDG_CONFIG_HOME = "$HOME/.config";
FREETYPE_PROPERTIES="cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"; FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0";
}; };
fonts.fontDir.enable = true; fonts.fontDir.enable = true;

View file

@ -1,6 +1,8 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && printing) { config = with cfg; lib.mkIf (enable && printing) {
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;

View file

@ -1,6 +1,8 @@
{ grimm-shared-inputs, pkgs, config, lib, ... }: let { grimm-shared-inputs, pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && sound) { config = with cfg; lib.mkIf (enable && sound) {
sound.enable = true; sound.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;

View file

@ -1,106 +1,112 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
config = let {
waybar_full = pkgs.writeShellScriptBin "waybar-full" ( config =
"${config.programs.waybar.package}/bin/waybar" let
waybar_full = pkgs.writeShellScriptBin "waybar-full" (
"${config.programs.waybar.package}/bin/waybar"
+ (if isNull cfg.sway.bar.config then "" else " -c ${cfg.sway.bar.config}") + (if isNull cfg.sway.bar.config then "" else " -c ${cfg.sway.bar.config}")
+ (if isNull cfg.sway.bar.style then "" else " -s ${cfg.sway.bar.style}") + (if isNull cfg.sway.bar.style then "" else " -s ${cfg.sway.bar.style}")
); );
bar_config = '' bar_config = ''
bar { bar {
swaybar_command ${waybar_full}/bin/waybar-full swaybar_command ${waybar_full}/bin/waybar-full
} }
'';
build_conf = sway_conf : let
build_definition_lines = lib.mapAttrsToList (name: value: "set \$${name} ${value}");
build_keybind_lines = lib.mapAttrsToList (key: value: "bindsym ${key} ${value}");
build_exec_lines = map (item: "exec " + item);
build_mode_lines = lib.mapAttrsToList (name: value: ''
mode "${name}" {
${lib.strings.concatLines (map (item: " " + item ) (build_conf value))}}'');
in ([]
++ (build_definition_lines sway_conf.definitions)
++ (build_keybind_lines sway_conf.keybinds)
++ (build_exec_lines sway_conf.autolaunch)
++ (build_mode_lines sway_conf.modes)
++ lib.optional (sway_conf.extraConfig != "") sway_conf.extraConfig
);
text = lib.strings.concatLines (
(build_conf cfg.sway.config)
++ lib.optional cfg.sway.bar.enable bar_config
);
sway_conf = pkgs.writeText "sway.conf" text;
in with cfg; lib.mkIf (enable && sway.enable) {
environment.etc."sway.conf" = {
source = sway_conf;
};
environment.systemPackages = [
waybar_full
] ++ (with pkgs; [
procps
slurp
libnotify
]);
systemd.services.reload-sway = {
description = "Reload all running sway instances";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
script =''
for pid in $(${pkgs.procps}/bin/pgrep sway -x)
do
uid=$(id -u $(${pkgs.procps}/bin/ps -o user= -p $pid))
export SWAYSOCK="/run/user/$uid/sway-ipc.$uid.$pid.sock"
if [[ -e "$SWAYSOCK" ]] ; then
echo "sock is $SWAYSOCK"
${config.programs.sway.package}/bin/swaymsg reload
fi
done
'';
reloadTriggers = [ text ];
};
programs.waybar.enable = true;
programs.sway = {
enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
extraPackages = with pkgs; [
swaylock
swayidle
wl-clipboard
wf-recorder
dmenu
wmenu
waybar-mpris
];
extraOptions = [
"--unsupported-gpu"
"--config"
"/etc/sway.conf"
];
extraSessionCommands = ''
export XDG_CURRENT_DESKTOP=sway
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export _JAVA_AWT_WM_NONREPARENTING=1
export MOZ_ENABLE_WAYLAND=1
# export WLR_RENDERER=vulkan
# export DRI_PRIME=1
# export MESA_LOADER_DRIVER_OVERRIDE="zink"
''; '';
build_conf = sway_conf:
let
build_definition_lines = lib.mapAttrsToList (name: value: "set \$${name} ${value}");
build_keybind_lines = lib.mapAttrsToList (key: value: "bindsym ${key} ${value}");
build_exec_lines = map (item: "exec " + item);
build_mode_lines = lib.mapAttrsToList (name: value: ''
mode "${name}" {
${lib.strings.concatLines (map (item: " " + item ) (build_conf value))}}'');
in
([ ]
++ (build_definition_lines sway_conf.definitions)
++ (build_keybind_lines sway_conf.keybinds)
++ (build_exec_lines sway_conf.autolaunch)
++ (build_mode_lines sway_conf.modes)
++ lib.optional (sway_conf.extraConfig != "") sway_conf.extraConfig
);
text = lib.strings.concatLines (
(build_conf cfg.sway.config)
++ lib.optional cfg.sway.bar.enable bar_config
);
sway_conf = pkgs.writeText "sway.conf" text;
in
with cfg; lib.mkIf (enable && sway.enable) {
environment.etc."sway.conf" = {
source = sway_conf;
};
environment.systemPackages = [
waybar_full
] ++ (with pkgs; [
procps
slurp
libnotify
]);
systemd.services.reload-sway = {
description = "Reload all running sway instances";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
script = ''
for pid in $(${pkgs.procps}/bin/pgrep sway -x)
do
uid=$(id -u $(${pkgs.procps}/bin/ps -o user= -p $pid))
export SWAYSOCK="/run/user/$uid/sway-ipc.$uid.$pid.sock"
if [[ -e "$SWAYSOCK" ]] ; then
echo "sock is $SWAYSOCK"
${config.programs.sway.package}/bin/swaymsg reload
fi
done
'';
reloadTriggers = [ text ];
};
programs.waybar.enable = true;
programs.sway = {
enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
extraPackages = with pkgs; [
swaylock
swayidle
wl-clipboard
wf-recorder
dmenu
wmenu
waybar-mpris
];
extraOptions = [
"--unsupported-gpu"
"--config"
"/etc/sway.conf"
];
extraSessionCommands = ''
export XDG_CURRENT_DESKTOP=sway
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export _JAVA_AWT_WM_NONREPARENTING=1
export MOZ_ENABLE_WAYLAND=1
# export WLR_RENDERER=vulkan
# export DRI_PRIME=1
# export MESA_LOADER_DRIVER_OVERRIDE="zink"
'';
};
}; };
};
} }

View file

@ -1,16 +1,19 @@
{ pkgs, config, lib, ... }: let { pkgs, config, lib, ... }:
let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in
{
config = with cfg; lib.mkIf (enable && tooling.enable) { config = with cfg; lib.mkIf (enable && tooling.enable) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@") (writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@")
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@") (writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
(writeShellScriptBin "nix-referrers" "nix-store --query --referrers $@") (writeShellScriptBin "nix-referrers" "nix-store --query --referrers $@")
nixpkgs-fmt
gcc gcc
jdk17 jdk17
python3 python3
pkg-config pkg-config
tea tea
acpi acpi
@ -29,7 +32,7 @@ in {
lm_sensors lm_sensors
imagemagick imagemagick
nmap nmap
hyfetch hyfetch
acpi acpi
lshw lshw
@ -60,39 +63,39 @@ in {
user.email = cfg.tooling.git_email; user.email = cfg.tooling.git_email;
}; };
}; };
programs.tmux = { programs.tmux = {
enable = true; enable = true;
historyLimit = 42000; historyLimit = 42000;
#keyMode = "vi"; #keyMode = "vi";
}; };
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
programs.neovim = { programs.neovim = {
enable = true; enable = true;
viAlias = true; viAlias = true;
defaultEditor = true; defaultEditor = true;
configure = { configure = {
customRC = '' customRC = ''
set number set number
set hidden set hidden
set fileencodings=utf-8 set fileencodings=utf-8
set nocompatible set nocompatible
set clipboard+=unnamedplus set clipboard+=unnamedplus
if filereadable($HOME . "/.vimrc") if filereadable($HOME . "/.vimrc")
source ~/.vimrc source ~/.vimrc
endif endif
''; '';
packages.myVimPackage = with pkgs.vimPlugins; { packages.myVimPackage = with pkgs.vimPlugins; {
# loaded on launch # loaded on launch
start = [ start = [
vim-nix vim-nix
vim-scala vim-scala
fugitive fugitive
]; ];
# manually loadable by calling `:packadd $plugin-name` # manually loadable by calling `:packadd $plugin-name`
opt = [ ]; opt = [ ];
}; };
@ -102,7 +105,7 @@ in {
programs.xonsh = { programs.xonsh = {
enable = true; enable = true;
package = pkgs.xonsh.override { package = pkgs.xonsh.override {
extraPackages = ps: with ps; [ extraPackages = ps: with ps; [
requests requests
matplotlib matplotlib
numpy numpy

View file

@ -5,7 +5,8 @@
{ config, fetchpatch, pkgs, ... }: { config, fetchpatch, pkgs, ... }:
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./modules/fonts.nix ./modules/fonts.nix
./modules/tabletdriver.nix ./modules/tabletdriver.nix
./sway/sway-conf.nix ./sway/sway-conf.nix
@ -71,10 +72,10 @@
}; };
environment.sessionVariables = { environment.sessionVariables = {
NIXPKGS_ALLOW_UNFREE="1"; NIXPKGS_ALLOW_UNFREE = "1";
MOZ_ENABLE_WAYLAND="1"; MOZ_ENABLE_WAYLAND = "1";
# QT_QPA_PLATFORM="wayland-egl"; # QT_QPA_PLATFORM="wayland-egl";
OCI_CLI_RC_FILE="/home/grimmauld/.oci/config"; OCI_CLI_RC_FILE = "/home/grimmauld/.oci/config";
}; };
# Allow unfree packages # Allow unfree packages
@ -83,7 +84,7 @@
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
# nix.package = pkgs.nixVersions.unstable; # nix.package = pkgs.nixVersions.unstable;
programs.dconf.enable = true; programs.dconf.enable = true;
} }

View file

@ -19,32 +19,32 @@
}; };
}; };
outputs = inputs @ { self, nix-gaming, agenix, nixpkgs, chaotic, ... }: let outputs = inputs @ { self, nix-gaming, agenix, nixpkgs, chaotic, ... }:
system = "x86_64-linux"; let
in { system = "x86_64-linux";
nixosConfigurations = { in
grimmauld-nixos = nixpkgs.lib.nixosSystem { {
inherit system; nixosConfigurations = {
specialArgs = { inherit inputs system; }; grimmauld-nixos = nixpkgs.lib.nixosSystem {
modules = [ inherit system;
agenix.nixosModules.default specialArgs = { inherit inputs system; };
chaotic.nixosModules.default modules = [
nix-gaming.nixosModules.pipewireLowLatency agenix.nixosModules.default
./load_common.nix chaotic.nixosModules.default
./specific/grimm-nixos-laptop/configuration.nix nix-gaming.nixosModules.pipewireLowLatency
./load_common.nix
./specific/grimm-nixos-laptop/configuration.nix
./configuration.nix ./configuration.nix
./modules/users.nix ./modules/users.nix
# ./modules/tlp.nix # ./modules/tlp.nix
./modules/spotify-tui.nix ./modules/spotify-tui.nix
./modules/xserver.nix ./modules/xserver.nix
./modules/system-packages.nix ./modules/system-packages.nix
./modules/kvm.nix ./modules/kvm.nix
{ environment.systemPackages = [ agenix.packages.${system}.default ]; } { environment.systemPackages = [ agenix.packages.${system}.default ]; }
]; ];
};
}; };
}; };
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
} }

View file

@ -2,13 +2,13 @@
with lib; with lib;
let let
cfg = config.grimmShared; cfg = config.grimmShared;
sync_mod = types.submodule ({config, ...} : { sync_mod = types.submodule ({ config, ... }: {
options = { options = {
remote = mkOption { remote = mkOption {
type = types.nonEmptyStr; type = types.nonEmptyStr;
description = "path on the cloud server"; description = "path on the cloud server";
}; };
local = mkOption { local = mkOption {
type = types.nonEmptyStr; type = types.nonEmptyStr;
default = "$HOME/" + (lib.strings.concatStrings (builtins.match "/*(.+)" config.remote)); default = "$HOME/" + (lib.strings.concatStrings (builtins.match "/*(.+)" config.remote));
@ -17,17 +17,17 @@ let
}; };
}); });
sway_conf = types.submodule ({config, ...} : rec { sway_conf = types.submodule ({ config, ... }: rec {
options = { options = {
keybinds = mkOption { keybinds = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; default = { };
description = "set of keybinds assigning key combo to action"; description = "set of keybinds assigning key combo to action";
}; };
autolaunch = mkOption { autolaunch = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = []; default = [ ];
description = "set of commands to be run at sway startup"; description = "set of commands to be run at sway startup";
}; };
@ -39,21 +39,22 @@ let
definitions = mkOption { definitions = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; default = { };
description = "set of definitions assigning variable to value"; description = "set of definitions assigning variable to value";
}; };
modes = mkOption { modes = mkOption {
type = types.attrsOf sway_conf; type = types.attrsOf sway_conf;
default = {}; default = { };
description = "possible modes to switch to, e.g. resize"; description = "possible modes to switch to, e.g. resize";
}; };
}; };
}); });
in { in
{
options.grimmShared = { options.grimmShared = {
enable = mkEnableOption "grimm-shared-common"; enable = mkEnableOption "grimm-shared-common";
locale = mkOption { locale = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -80,7 +81,7 @@ in {
tooling = { tooling = {
enable = mkEnableOption "grimm-tooling"; enable = mkEnableOption "grimm-tooling";
pass = mkOption { pass = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -123,7 +124,7 @@ in {
plugins = mkOption { plugins = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; default = { };
description = "set of plugins to install. Format: guid = short-id"; description = "set of plugins to install. Format: guid = short-id";
}; };
@ -139,7 +140,7 @@ in {
bar = { bar = {
enable = mkEnableOption "grimm-sway-bar"; enable = mkEnableOption "grimm-sway-bar";
style = mkOption { style = mkOption {
type = types.nullOr types.path; type = types.nullOr types.path;
default = null; default = null;
@ -184,7 +185,7 @@ in {
options = { options = {
syncPaths = mkOption { syncPaths = mkOption {
type = types.listOf sync_mod; type = types.listOf sync_mod;
default = []; default = [ ];
description = "paths to sync via nextcloud"; description = "paths to sync via nextcloud";
}; };
}; };

View file

@ -1,4 +1,4 @@
{pkgs, fonts, ...}: { pkgs, fonts, ... }:
{ {
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
noto-fonts noto-fonts

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: let { pkgs, ... }:
let
loadvfio = pkgs.writeShellScriptBin "loadvfio" '' loadvfio = pkgs.writeShellScriptBin "loadvfio" ''
udevadm trigger --verbose --type=devices --action=remove --subsystem-match=drm --property-match="MINOR=1" udevadm trigger --verbose --type=devices --action=remove --subsystem-match=drm --property-match="MINOR=1"
sleep 2 sleep 2
@ -48,7 +49,8 @@
fi fi
''; '';
in { in
{
environment.systemPackages = [ loadnvidia loadvfio ]; environment.systemPackages = [ loadnvidia loadvfio ];
security.sudo.extraConfig = "grimmauld ALL=(ALL) NOPASSWD:/run/current-system/sw/bin/loadnvidia, /run/current-system/sw/bin/loadvfio"; security.sudo.extraConfig = "grimmauld ALL=(ALL) NOPASSWD:/run/current-system/sw/bin/loadnvidia, /run/current-system/sw/bin/loadvfio";
virtualisation.libvirtd = { virtualisation.libvirtd = {
@ -58,7 +60,7 @@ in {
ovmf = { ovmf = {
enable = true; enable = true;
packages = [ packages = [
# pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd # AAVMF # pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd # AAVMF
pkgs.OVMF.fd pkgs.OVMF.fd
]; ];
}; };

View file

@ -1,30 +1,34 @@
{config, pkgs, ...}: { config, pkgs, ... }:
let let
spotifyd_cache_dir = "/tmp/spotifyd"; spotifyd_cache_dir = "/tmp/spotifyd";
in { in
nixpkgs.overlays = [ (final: prev: { spotifyd = prev.spotifyd.overrideAttrs (old: { {
postInstall = '' nixpkgs.overlays = [
mkdir -p $out/share/dbus-1/system.d/ (final: prev: {
tee $out/share/dbus-1/system.d/org.mpris.MediaPlayer2.spotifyd.conf <<END spotifyd = prev.spotifyd.overrideAttrs (old: {
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- --> postInstall = ''
mkdir -p $out/share/dbus-1/system.d/
tee $out/share/dbus-1/system.d/org.mpris.MediaPlayer2.spotifyd.conf <<END
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
<!DOCTYPE busconfig PUBLIC <!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig> <busconfig>
<policy user="spotifyd"> <policy user="spotifyd">
<allow own_prefix="org.mpris.MediaPlayer2.spotifyd"/> <allow own_prefix="org.mpris.MediaPlayer2.spotifyd"/>
<allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/> <allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/>
<allow receive_sender="org.mpris.MediaPlayer2"/> <allow receive_sender="org.mpris.MediaPlayer2"/>
</policy> </policy>
<policy context="default"> <policy context="default">
<allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/> <allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/>
<allow receive_sender="org.mpris.MediaPlayer2"/> <allow receive_sender="org.mpris.MediaPlayer2"/>
</policy> </policy>
</busconfig> </busconfig>
END END
''; '';
});}) });
})
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -43,15 +47,15 @@ END
mode = "700"; mode = "700";
}; };
systemd.services.init-spotifyd-cache-dir = { systemd.services.init-spotifyd-cache-dir = {
description = "Create the spotifyd cache dir"; description = "Create the spotifyd cache dir";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script ='' script = ''
mkdir -p ${spotifyd_cache_dir} mkdir -p ${spotifyd_cache_dir}
chown spotifyd:spotifyd -R ${spotifyd_cache_dir} chown spotifyd:spotifyd -R ${spotifyd_cache_dir}
''; '';
}; };
# spotifyd config # spotifyd config
@ -67,7 +71,7 @@ END
device = "default"; device = "default";
control = "default"; control = "default";
volume_controller = "softvol"; volume_controller = "softvol";
# no_audio_cache = true; # no_audio_cache = true;
spotifyd_cache_dir = spotifyd_cache_dir; spotifyd_cache_dir = spotifyd_cache_dir;
max_cache_size = 10000000000; max_cache_size = 10000000000;
initial_volume = "90"; initial_volume = "90";
@ -88,5 +92,5 @@ END
}; };
# spotifyd is also a group # spotifyd is also a group
users.groups = { spotifyd = {}; }; users.groups = { spotifyd = { }; };
} }

View file

@ -1,15 +1,15 @@
{pkgs, ...}: { { pkgs, ... }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
spice-gtk spice-gtk
kate kate
oci-cli oci-cli
xcb-util-cursor xcb-util-cursor
krfb krfb
kdePackages.audiocd-kio kdePackages.audiocd-kio
(writeShellScriptBin "rebuild" '' (writeShellScriptBin "rebuild" ''
pkexec nixos-rebuild switch --flake /home/grimmauld/grimm-nixos-laptop pkexec nixos-rebuild switch --flake /home/grimmauld/grimm-nixos-laptop
'') '')
]; ];
} }

View file

@ -1,4 +1,4 @@
{pkgs, ...}: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
opentabletdriver opentabletdriver

View file

@ -1,23 +1,23 @@
{pkgs, ...}: { pkgs, ... }:
{ {
services.power-profiles-daemon.enable = false; services.power-profiles-daemon.enable = false;
services.tlp = { services.tlp = {
enable = true; enable = true;
settings = { settings = {
USB_AUTOSUSPEND=1; USB_AUTOSUSPEND = 1;
USB_EXCLUDE_BTUSB=1; USB_EXCLUDE_BTUSB = 1;
USB_EXCLUDE_PHONE=1; USB_EXCLUDE_PHONE = 1;
SOUND_POWER_SAVE_ON_AC=0; SOUND_POWER_SAVE_ON_AC = 0;
SOUND_POWER_SAVE_ON_BAT=1; SOUND_POWER_SAVE_ON_BAT = 1;
SATA_LINKPWR_ON_AC="max_performance"; SATA_LINKPWR_ON_AC = "max_performance";
SATA_LINKPWR_ON_BAT="min_power"; SATA_LINKPWR_ON_BAT = "min_power";
MAX_LOST_WORK_SECS_ON_BAT=15; MAX_LOST_WORK_SECS_ON_BAT = 15;
CPU_ENERGY_PERF_POLICY_ON_AC="performance"; CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT="power"; CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_BOOST_ON_AC=1; CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT=0; CPU_BOOST_ON_BAT = 0;
RUNTIME_PM_ON_AC="on"; RUNTIME_PM_ON_AC = "on";
RUNTIME_PM_ON_BAT="auto"; RUNTIME_PM_ON_BAT = "auto";
}; };
}; };
} }

View file

@ -1,4 +1,4 @@
{lib, config, pkgs, ...}: { { lib, config, pkgs, ... }: {
users.users.grimmauld = { users.users.grimmauld = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.xonsh; shell = pkgs.xonsh;

View file

@ -3,9 +3,9 @@
services.xserver = { services.xserver = {
enable = true; enable = true;
videoDrivers = [ "nouveau" "fbdev" "modesetting" ]; videoDrivers = [ "nouveau" "fbdev" "modesetting" ];
# videoDrivers = [ "nouveau" ]; # videoDrivers = [ "nouveau" ];
displayManager = { displayManager = {
# lightdm.enable = true; # lightdm.enable = true;
sddm = { sddm = {
enable = true; enable = true;
wayland.enable = true; wayland.enable = true;
@ -13,13 +13,13 @@
defaultSession = "sway"; defaultSession = "sway";
}; };
desktopManager = { desktopManager = {
# xfce.enable = true; # xfce.enable = true;
}; };
}; };
services.desktopManager = { services.desktopManager = {
plasma6.enable = true; plasma6.enable = true;
# xfce.enable = true; # xfce.enable = true;
}; };
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).

View file

@ -1,6 +1,7 @@
let let
laptop_pub = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy7X5ByG4/9y2XkQSnXcpMGnV5WPGUd+B6FaYCDNmPQ7xIZEteS+kCpu9oiMP6C/H/FT+i9DZvCflkzgdFAyujYLKRYaZbZ3K6F60qN0rkJ0z/ZO5c6rqwIwR6BEoB7dq5inkyH9fZ8/SI+PXxELmeWF9ehT7kkQC+o9Ujpcjd7ZuZllbAz4UQZFRbbpwdVJCEDenu9/63yuYbvMupgGk0edaTiFT0Q9MSzs/3pNP8xlAxmmZ3HzSjeF7gUzBF7CaIroTeguiUjSVybUEx48P8fy878t7dUZf4anEno9MS0B3aqfZvCKuuPdAUdeBfCbFHRqN7GuCylFIXGPe95Mxl grimmauld@grimmauld-nixos"; laptop_pub = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy7X5ByG4/9y2XkQSnXcpMGnV5WPGUd+B6FaYCDNmPQ7xIZEteS+kCpu9oiMP6C/H/FT+i9DZvCflkzgdFAyujYLKRYaZbZ3K6F60qN0rkJ0z/ZO5c6rqwIwR6BEoB7dq5inkyH9fZ8/SI+PXxELmeWF9ehT7kkQC+o9Ujpcjd7ZuZllbAz4UQZFRbbpwdVJCEDenu9/63yuYbvMupgGk0edaTiFT0Q9MSzs/3pNP8xlAxmmZ3HzSjeF7gUzBF7CaIroTeguiUjSVybUEx48P8fy878t7dUZf4anEno9MS0B3aqfZvCKuuPdAUdeBfCbFHRqN7GuCylFIXGPe95Mxl grimmauld@grimmauld-nixos";
in { in
{
"spotify_pass.age".publicKeys = [ laptop_pub ]; "spotify_pass.age".publicKeys = [ laptop_pub ];
"nextcloud_pass.age".publicKeys = [ laptop_pub ]; "nextcloud_pass.age".publicKeys = [ laptop_pub ];
} }

View file

@ -1,11 +1,12 @@
{ pkgs, ... }: { { pkgs, ... }: {
imports = [ # Include the results of the hardware scan. imports = [
./hardware-configuration.nix # Include the results of the hardware scan.
./screenshare-select.nix ./hardware-configuration.nix
]; ./screenshare-select.nix
];
age.identityPaths = [ "/home/grimmauld/.ssh/id_rsa" ]; age.identityPaths = [ "/home/grimmauld/.ssh/id_rsa" ];
networking.hostName = "grimmauld-nixos"; networking.hostName = "grimmauld-nixos";
environment.sessionVariables = { environment.sessionVariables = {

View file

@ -5,9 +5,10 @@
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [
# ./modules/nvidia.nix (modulesPath + "/installer/scan/not-detected.nix")
]; # ./modules/nvidia.nix
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
@ -15,19 +16,21 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/3a4a7076-98e7-4ecd-bb07-7e182a04ceac"; {
device = "/dev/disk/by-uuid/3a4a7076-98e7-4ecd-bb07-7e182a04ceac";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/D20D-B5B0"; {
device = "/dev/disk/by-uuid/D20D-B5B0";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ { swapDevices = [{
device = "/var/lib/swapfile"; device = "/var/lib/swapfile";
size = 48*1024; size = 48 * 1024;
} ]; }];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; powerManagement.cpuFreqGovernor = lib.mkDefault "performance";

View file

@ -1,4 +1,4 @@
{pkgs, ...}: { pkgs, ... }:
{ {
xdg.portal.wlr.settings = { xdg.portal.wlr.settings = {
screencastExternal = { screencastExternal = {

View file

@ -1,25 +1,25 @@
{ inputs, system, pkgs, config, lib, ... }: { { inputs, system, pkgs, config, lib, ... }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
alacritty alacritty
rmenu rmenu
grim grim
slurp slurp
brightnessctl brightnessctl
wl-clipboard wl-clipboard
swaymux swaymux
dunst dunst
]; ];
grimmShared.sway = { grimmShared.sway = {
enable = true;
bar = {
enable = true; enable = true;
config = ./bar/config;
style = ./bar/style.css;
};
bar = { config = {
enable = true;
config = ./bar/config;
style = ./bar/style.css;
};
config = {
definitions = { definitions = {
mod = "Mod4"; mod = "Mod4";
left = "h"; left = "h";
@ -47,79 +47,79 @@
"$mod+Shift+c" = "reload"; "$mod+Shift+c" = "reload";
"$mod+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'"; "$mod+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'";
# Move your focus around # Move your focus around
"$mod+$left" = "focus left"; "$mod+$left" = "focus left";
"$mod+$down" = "focus down"; "$mod+$down" = "focus down";
"$mod+$up" = "focus up"; "$mod+$up" = "focus up";
"$mod+$right" = "focus right"; "$mod+$right" = "focus right";
# Or use $mod+[up|down|left|right] # Or use $mod+[up|down|left|right]
"$mod+Left" = "focus left"; "$mod+Left" = "focus left";
"$mod+Down" = "focus down"; "$mod+Down" = "focus down";
"$mod+Up" = "focus up"; "$mod+Up" = "focus up";
"$mod+Right" = "focus right"; "$mod+Right" = "focus right";
# Move the focused window with the same, but add Shift # Move the focused window with the same, but add Shift
"$mod+Shift+$left" = "move left"; "$mod+Shift+$left" = "move left";
"$mod+Shift+$down" = "move down"; "$mod+Shift+$down" = "move down";
"$mod+Shift+$up" = "move up"; "$mod+Shift+$up" = "move up";
"$mod+Shift+$right" = "move right"; "$mod+Shift+$right" = "move right";
# Ditto, with arrow keys # Ditto, with arrow keys
"$mod+Shift+Left" = "move left"; "$mod+Shift+Left" = "move left";
"$mod+Shift+Down" = "move down"; "$mod+Shift+Down" = "move down";
"$mod+Shift+Up" = "move up"; "$mod+Shift+Up" = "move up";
"$mod+Shift+Right" = "move right"; "$mod+Shift+Right" = "move right";
# #
# Workspaces: # Workspaces:
# #
# Switch to workspace # Switch to workspace
"$mod+1" = "workspace number 1"; "$mod+1" = "workspace number 1";
"$mod+2" = "workspace number 2"; "$mod+2" = "workspace number 2";
"$mod+3" = "workspace number 3"; "$mod+3" = "workspace number 3";
"$mod+4" = "workspace number 4"; "$mod+4" = "workspace number 4";
"$mod+5" = "workspace number 5"; "$mod+5" = "workspace number 5";
"$mod+6" = "workspace number 6"; "$mod+6" = "workspace number 6";
"$mod+7" = "workspace number 7"; "$mod+7" = "workspace number 7";
"$mod+8" = "workspace number 8"; "$mod+8" = "workspace number 8";
"$mod+9" = "workspace number 9"; "$mod+9" = "workspace number 9";
"$mod+0" = "workspace number 10"; "$mod+0" = "workspace number 10";
# Move focused container to workspace # Move focused container to workspace
"$mod+Shift+1" = "move container to workspace number 1"; "$mod+Shift+1" = "move container to workspace number 1";
"$mod+Shift+2" = "move container to workspace number 2"; "$mod+Shift+2" = "move container to workspace number 2";
"$mod+Shift+3" = "move container to workspace number 3"; "$mod+Shift+3" = "move container to workspace number 3";
"$mod+Shift+4" = "move container to workspace number 4"; "$mod+Shift+4" = "move container to workspace number 4";
"$mod+Shift+5" = "move container to workspace number 5"; "$mod+Shift+5" = "move container to workspace number 5";
"$mod+Shift+6" = "move container to workspace number 6"; "$mod+Shift+6" = "move container to workspace number 6";
"$mod+Shift+7" = "move container to workspace number 7"; "$mod+Shift+7" = "move container to workspace number 7";
"$mod+Shift+8" = "move container to workspace number 8"; "$mod+Shift+8" = "move container to workspace number 8";
"$mod+Shift+9" = "move container to workspace number 9"; "$mod+Shift+9" = "move container to workspace number 9";
"$mod+Shift+0" = "move container to workspace number 10"; "$mod+Shift+0" = "move container to workspace number 10";
# Note: workspaces can have any name you want, not just numbers. # Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default. # We just use 1-10 as the default.
# #
# Layout stuff: # Layout stuff:
# #
# You can "split" the current object of your focus with # You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits # $mod+b or $mod+v, for horizontal and vertical splits
# respectively. # respectively.
"$mod+b" = "splith"; "$mod+b" = "splith";
"$mod+v" = "splitv"; "$mod+v" = "splitv";
# Switch the current container between different layout styles # Switch the current container between different layout styles
"$mod+s" = "layout stacking"; "$mod+s" = "layout stacking";
"$mod+w" = "layout tabbed"; "$mod+w" = "layout tabbed";
"$mod+e" = "layout toggle split"; "$mod+e" = "layout toggle split";
# Make the current focus fullscreen # Make the current focus fullscreen
"$mod+f" = "fullscreen"; "$mod+f" = "fullscreen";
# Toggle the current focus between tiling and floating mode # Toggle the current focus between tiling and floating mode
"$mod+Shift+space" = "floating toggle"; "$mod+Shift+space" = "floating toggle";
# Swap focus between the tiling area and the floating area # Swap focus between the tiling area and the floating area
"$mod+space" = "focus mode_toggle"; "$mod+space" = "focus mode_toggle";
# Move focus to the parent container # Move focus to the parent container
"$mod+a" = "focus parent"; "$mod+a" = "focus parent";
"$mod+Shift+minus" = "move scratchpad"; "$mod+Shift+minus" = "move scratchpad";
"$mod+minus" = "scratchpad show"; "$mod+minus" = "scratchpad show";
@ -138,7 +138,8 @@
XF86MonBrightnessUp = "exec brightnessctl s 10+%"; XF86MonBrightnessUp = "exec brightnessctl s 10+%";
XF86MonBrightnessDown = "exec brightnessctl s 10-%"; XF86MonBrightnessDown = "exec brightnessctl s 10-%";
}; };
autolaunch = [ # fixme: absolute paths autolaunch = [
# fixme: absolute paths
"blueman-applet" "blueman-applet"
"lxqt-policykit-agent" "lxqt-policykit-agent"
"otd-daemon" "otd-daemon"
@ -146,47 +147,47 @@
"systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP" "systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP"
]; ];
extraConfig = '' extraConfig = ''
output * bg ${./wallpapers/switzerland.jpg} fill output * bg ${./wallpapers/switzerland.jpg} fill
output HDMI-A-1 mode 1920x1080@60Hz position 0,0 output HDMI-A-1 mode 1920x1080@60Hz position 0,0
for_window [app_id="lxqt-policykit-agent"] floating enable; for_window [app_id="lxqt-policykit-agent"] floating enable;
floating_modifier $mod normal floating_modifier $mod normal
input type:keyboard xkb_numlock enabled input type:keyboard xkb_numlock enabled
include /etc/sway/config.d/* include /etc/sway/config.d/*
# Borders, gaps, titlebars, behavior # Borders, gaps, titlebars, behavior
default_border pixel 3 default_border pixel 3
default_floating_border pixel 3 default_floating_border pixel 3
gaps inner 5 gaps inner 5
titlebar_padding 5 5 titlebar_padding 5 5
#5Smart things #5Smart things
smart_gaps on smart_gaps on
hide_edge_borders --i3 smart hide_edge_borders --i3 smart
input * { input * {
xkb_layout "de" xkb_layout "de"
} }
for_window [app_id="swaymux"] floating enable for_window [app_id="swaymux"] floating enable
for_window [app_id="rmenu"] floating enable for_window [app_id="rmenu"] floating enable
''; '';
modes.resize.keybinds = { modes.resize.keybinds = {
"$left" = "resize shrink width 10px"; "$left" = "resize shrink width 10px";
"$down" = "resize grow height 10px"; "$down" = "resize grow height 10px";
"$up" = "resize shrink height 10px"; "$up" = "resize shrink height 10px";
"$right" = "resize grow width 10px"; "$right" = "resize grow width 10px";
Left = "resize shrink width 10px"; Left = "resize shrink width 10px";
Down = "resize grow height 10px"; Down = "resize grow height 10px";
Up = "resize shrink height 10px"; Up = "resize shrink height 10px";
Right = "resize grow width 10px"; Right = "resize grow width 10px";
Return = "mode \"default\""; Return = "mode \"default\"";
Escape = "mode \"default\""; Escape = "mode \"default\"";
}; };
}; };
}; };
} }