Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
feat(linux): add wayland system configs
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli committed Nov 25, 2023
1 parent 563bb4b commit 0c73b8e
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
# All nixos/nix-darwin configurations are kept here.
nixosModules = {
# Common nixos/nix-darwin configuration shared between Linux and macOS.
common = { pkgs, ... }: {
common = { pkgs, user, ... }: {
specialArgs = { inherit user; };
imports = [
# Custom inputs
inputs.agenix.nixosModules.default
Expand All @@ -147,7 +148,8 @@
nix.settings.trusted-users = [ "root" "${user}" ];
};
# NixOS specific configuration
linux = { pkgs, ... }: {
linux = { pkgs, user, ... }: {
specialArgs = { inherit user; };
imports = [
# Custom inputs
inputs.nur.nixosModules.nur
Expand All @@ -166,7 +168,8 @@
system.stateVersion = "${stateVersion}";
};
# nix-darwin specific configuration
darwin = { pkgs, ... }: {
darwin = { pkgs, user, ... }: {
specialArgs = { inherit user; };
imports = [
(import ./darwin)
];
Expand Down
1 change: 1 addition & 0 deletions linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
./amd.nix
# ./intel.nix
./fonts.nix
./wayland.nix
];
}
103 changes: 103 additions & 0 deletions linux/wayland.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{ pkgs, user, ... }:

{
environment.systemPackages = with pkgs; [
# linux specific packages
libnotify
wl-clipboard
wlr-randr
wayland
wayland-scanner
wayland-utils
egl-wayland
wayland-protocols
xorg.xeyes
glfw-wayland
xwayland
qt6.qtwayland
cinnamon.nemo
networkmanagerapplet
wev
wf-recorder
alsa-lib
alsa-utils
flac
pulsemixer
linux-firmware
polkit_gnome
sshpass
lxappearance
imagemagick
sway-contrib.grimshot
grim
brightnessctl
];

services.xserver = {
layout = "us";
xkbVariant = "colemak";
xkbOptions = "caps:escape";
autoRepeatDelay = 200;
autoRepeatInterval = 30;
};
console.useXkbConfig = true;

services = {
dbus.packages = [ pkgs.gcr ];
getty.autologinUser = "${user}";
gvfs.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
tor.client.enable = true;
keyd = {
enable = true;
keyboards = {
default = {
ids = [ "*" ];
settings = {
main = {
# Maps capslock to escape when pressed and control when held
capslock = "overload(control, esc)";
};
};
};
};
};
};

security.rtkit.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};

security.polkit.enable = true;
security.sudo = {
enable = false;
extraConfig = ''
${user} ALL=(ALL) NOPASSWD:ALL
'';
};
security.doas = {
enable = true;
extraConfig = ''
permit nopass :wheel
'';
};
}

0 comments on commit 0c73b8e

Please sign in to comment.