desktop.nix (2937B)
1 { config, lib, pkgs, ... }: 2 3 with lib; 4 let 5 cfg = config.profiles.desktop; 6 in 7 { 8 options = { 9 profiles.desktop = { 10 enable = mkEnableOption "Enable desktop profile"; 11 avahi = mkOption { 12 default = true; 13 description = "Enable avahi with the desktop profile"; 14 type = types.bool; 15 }; 16 pulseaudio = mkOption { 17 default = true; 18 description = "Enable pulseaudio with the desktop profile"; 19 type = types.bool; 20 }; 21 syncthing = mkOption { 22 default = true; 23 description = "Enable syncthing with the desktop profile"; 24 type = types.bool; 25 }; 26 scanning = mkOption { 27 default = true; 28 description = "Enable scanning with the desktop profile"; 29 type = types.bool; 30 }; 31 printing = mkOption { 32 default = true; 33 description = "Enable printing with the desktop profile"; 34 type = types.bool; 35 }; 36 networkmanager = mkOption { 37 default = true; 38 description = "Enable networkmanager with the desktop profile"; 39 type = types.bool; 40 }; 41 }; 42 }; 43 config = mkIf cfg.enable { 44 profiles.avahi.enable = cfg.avahi; 45 profiles.printing.enable = cfg.printing; 46 profiles.pulseaudio.enable = cfg.pulseaudio; 47 profiles.scanning.enable = cfg.scanning; 48 profiles.syncthing.enable = cfg.syncthing; 49 50 hardware.bluetooth.enable = true; 51 52 networking.networkmanager = { 53 enable = cfg.networkmanager; 54 unmanaged = [ 55 "interface-name:br-*" 56 "interface-name:ve-*" 57 "interface-name:veth*" 58 "interface-name:wg0" 59 "interface-name:docker0" 60 "interface-name:virbr*" 61 ]; # FIXME: add unmanaged depending on profiles (wg0, docker0, …) 62 packages = with pkgs; [ networkmanager-openvpn ]; 63 }; 64 65 services = { 66 xserver = { 67 enable = true; 68 enableTCP = false; 69 libinput.enable = true; 70 synaptics.enable = false; 71 layout = "fr"; 72 xkbVariant = "bepo"; 73 xkbOptions = "grp:menu_toggle,grp_led:caps,compose:caps"; 74 }; 75 }; 76 fonts = { 77 fontDir.enable = true; 78 enableGhostscriptFonts = true; 79 fonts = with pkgs; [ 80 liberation_ttf 81 corefonts 82 dejavu_fonts 83 emojione 84 feh 85 fira 86 fira-code 87 fira-code-symbols 88 fira-mono 89 hasklig 90 inconsolata 91 iosevka 92 noto-fonts 93 noto-fonts-cjk 94 noto-fonts-emoji 95 noto-fonts-extra 96 overpass 97 symbola 98 source-code-pro 99 twemoji-color-font 100 ubuntu_font_family 101 unifont 102 ]; 103 }; 104 105 environment.systemPackages = with pkgs; [ 106 cryptsetup 107 xlibs.xmodmap 108 # xorg.xbacklight 109 xorg.xdpyinfo 110 xorg.xhost 111 xorg.xinit 112 xss-lock 113 xorg.xmessage 114 unzip 115 gnupg 116 pinentry 117 inxi 118 ]; 119 }; 120 }