profiles/desktop: Migrate from configuration
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
./common-nix
|
||||
./common-webserver
|
||||
./cybercluster-vm
|
||||
./desktop
|
||||
./dn42-router
|
||||
./fem-net
|
||||
./firefox
|
||||
|
31
profiles/desktop/audio.nix
Normal file
31
profiles/desktop/audio.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
services.pulseaudio.enable = false;
|
||||
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
pulse = {
|
||||
enable = true;
|
||||
};
|
||||
configPackages = [
|
||||
pkgs.pipewire-all-bluetooth
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
helvum # pipewire routing gui
|
||||
];
|
||||
|
||||
};
|
||||
}
|
30
profiles/desktop/default.nix
Normal file
30
profiles/desktop/default.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
options.profiles.clerie.desktop = {
|
||||
enable = mkEnableOption "clerie Desktop Config";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./audio.nix
|
||||
./firmware.nix
|
||||
./fonts.nix
|
||||
./gnome.nix
|
||||
./inputs.nix
|
||||
./networking.nix
|
||||
./polkit.nix
|
||||
./power.nix
|
||||
./printing.nix
|
||||
./ssh.nix
|
||||
./xserver.nix
|
||||
];
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
security.sudo.wheelNeedsPassword = true;
|
||||
|
||||
};
|
||||
}
|
13
profiles/desktop/firmware.nix
Normal file
13
profiles/desktop/firmware.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
services.fwupd.enable = true;
|
||||
|
||||
};
|
||||
|
||||
}
|
20
profiles/desktop/fonts.nix
Normal file
20
profiles/desktop/fonts.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
fonts.enableDefaultPackages = true;
|
||||
fonts.packages = with pkgs; [
|
||||
roboto
|
||||
roboto-mono
|
||||
noto-fonts
|
||||
noto-fonts-emoji
|
||||
comfortaa
|
||||
] ++ (if pkgs ? "noto-fonts-cjk-sans" then [ pkgs.noto-fonts-cjk-sans ] else [ pkgs.noto-fonts-cjk ]);
|
||||
|
||||
};
|
||||
|
||||
}
|
69
profiles/desktop/gnome.nix
Normal file
69
profiles/desktop/gnome.nix
Normal file
@@ -0,0 +1,69 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
services.gnome = {
|
||||
localsearch.enable = false;
|
||||
tinysparql.enable = false;
|
||||
};
|
||||
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
baobab
|
||||
epiphany
|
||||
gnome-calendar
|
||||
gnome-clocks
|
||||
gnome-console
|
||||
gnome-contacts
|
||||
gnome-logs
|
||||
gnome-maps
|
||||
gnome-music
|
||||
gnome-tour
|
||||
gnome-photos
|
||||
gnome-weather
|
||||
gnome-connections
|
||||
simple-scan
|
||||
yelp
|
||||
geary
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
evolution
|
||||
gnome-terminal
|
||||
gnome-tweaks
|
||||
];
|
||||
|
||||
services.gnome.evolution-data-server.enable = true;
|
||||
|
||||
programs.dconf.profiles = {
|
||||
user.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/desktop/calendar" = {
|
||||
show-weekdate = true;
|
||||
};
|
||||
"org/gnome/desktop/interface" = {
|
||||
enable-hot-corners = false;
|
||||
show-battery-percentage = true;
|
||||
};
|
||||
"org/gnome/desktop/notifications" = {
|
||||
show-in-lock-screen = false;
|
||||
};
|
||||
"org/gnome/desktop/sound" = {
|
||||
event-sounds = false;
|
||||
};
|
||||
"org/gnome/gnome-system-monitor" = {
|
||||
network-in-bits = true;
|
||||
network-total-in-bits = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
51
profiles/desktop/inputs.nix
Normal file
51
profiles/desktop/inputs.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
programs.dconf.profiles = {
|
||||
user.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/desktop/peripherals/touchpad" = {
|
||||
disable-while-typing = false;
|
||||
edge-scrolling-enabled = false;
|
||||
natural-scroll = true;
|
||||
tap-to-click = true;
|
||||
two-finger-scrolling-enabled = true;
|
||||
};
|
||||
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||
custom-keybindings = [
|
||||
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"
|
||||
];
|
||||
mic-mute = [ "<Control>Print" ];
|
||||
};
|
||||
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" = {
|
||||
name = "Terminal";
|
||||
binding = "<Primary><Alt>t";
|
||||
command = "gnome-terminal";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
gdm.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/desktop/peripherals/touchpad" = {
|
||||
disable-while-typing = false;
|
||||
edge-scrolling-enabled = false;
|
||||
natural-scroll = true;
|
||||
tap-to-click = true;
|
||||
two-finger-scrolling-enabled = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
20
profiles/desktop/networking.nix
Normal file
20
profiles/desktop/networking.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
networking.networkmanager.settings = {
|
||||
connectivity = {
|
||||
uri = "http://ping.clerie.de/nm-check.txt";
|
||||
};
|
||||
global-dns = {
|
||||
searches = "net.clerie.de";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
13
profiles/desktop/polkit.nix
Normal file
13
profiles/desktop/polkit.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
security.polkit.enable = true;
|
||||
|
||||
};
|
||||
|
||||
}
|
50
profiles/desktop/power.nix
Normal file
50
profiles/desktop/power.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
boot.resumeDevice = lib.optionalString ((lib.length config.swapDevices) > 0) (lib.head config.swapDevices).device;
|
||||
services.logind = {
|
||||
lidSwitch = "suspend-then-hibernate";
|
||||
};
|
||||
systemd.sleep.extraConfig = ''
|
||||
HibernateDelaySec=30m
|
||||
'';
|
||||
|
||||
services.upower = {
|
||||
percentageLow = 20;
|
||||
percentageCritical = 10;
|
||||
percentageAction = 8;
|
||||
};
|
||||
|
||||
programs.dconf.profiles = {
|
||||
user.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/settings-daemon/plugins/power" = {
|
||||
power-button-action = "hibernate";
|
||||
power-saver-profile-on-low-battery = false;
|
||||
sleep-inactive-ac-type = "nothing";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
gdm.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/settings-daemon/plugins/power" = {
|
||||
power-button-action = "hibernate";
|
||||
power-saver-profile-on-low-battery = false;
|
||||
sleep-inactive-ac-type = "nothing";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
14
profiles/desktop/printing.nix
Normal file
14
profiles/desktop/printing.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
services.printing.enable = true;
|
||||
services.avahi.enable = true;
|
||||
services.avahi.nssmdns4 = true;
|
||||
|
||||
};
|
||||
}
|
39
profiles/desktop/ssh.nix
Normal file
39
profiles/desktop/ssh.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
profiles.clerie.gpg-ssh.enable = true;
|
||||
|
||||
programs.gnupg.agent = {
|
||||
pinentryPackage = pkgs.pinentry-gtk2;
|
||||
};
|
||||
|
||||
# Do not disable ssh-agent of gnome-keyring, because
|
||||
# gnupg ssh-agent can't handle normal SSH keys properly
|
||||
/*
|
||||
# Disable ssh-agent of gnome-keyring
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
gnome = prev.gnome // {
|
||||
gnome-keyring = prev.runCommand "gnome-keyring-ssh-disabled-autostart" {} ''
|
||||
mkdir -p $out
|
||||
|
||||
# Symlink all gnome-keyring binaries
|
||||
${final.xorg.lndir}/bin/lndir -silent ${prev.gnome.gnome-keyring} $out
|
||||
|
||||
# Disable autostart for ssh
|
||||
rm $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
||||
cat ${prev.gnome.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop > $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
||||
echo "Hidden=true" >> $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
*/
|
||||
|
||||
};
|
||||
}
|
18
profiles/desktop/xserver.nix
Normal file
18
profiles/desktop/xserver.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
|
||||
services.xserver.excludePackages = with pkgs; [
|
||||
xterm
|
||||
];
|
||||
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user