commit af09e3e7f29b8ccd151a664ba77545f146223159
parent f8500626305d1d07d36f18fb5852d10cc3ffeb58
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 21 Dec 2020 19:06:40 +0100
flake: desktop, i3, …
One goal would be to have as little `*.flake.nix` file as possible.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
5 files changed, 100 insertions(+), 10 deletions(-)
diff --git a/systems/hosts/foo.flake.nix b/systems/hosts/foo.flake.nix
@@ -13,6 +13,7 @@ let
in
{
profiles.laptop.enable = true;
+ profiles.desktop.i3.enable = true;
profiles.home.enable = true;
environment.systemPackages = with pkgs; [ tkn ];
diff --git a/systems/modules/profiles/default.flake.nix b/systems/modules/profiles/default.flake.nix
@@ -6,6 +6,7 @@
./desktop.flake.nix
./development.flake.nix
./home.flake.nix
+ ./i3.nix
./laptop.flake.nix
# FIXME: vpn, server, builder, …
];
diff --git a/systems/modules/profiles/desktop.flake.nix b/systems/modules/profiles/desktop.flake.nix
@@ -16,14 +16,99 @@ in
# Enable Plymouth on desktops
plymouth.enable = true;
};
+
+ # Extra packages to add to the system
+ environment.systemPackages = with pkgs; [
+ xorg.xmessage
+ ];
+
+ # Configure some fonts
+ fonts = {
+ # enableFontDir = true;
+ fontDir.enable = true;
+ enableGhostscriptFonts = true;
+ fonts = with pkgs; [
+ liberation_ttf
+ corefonts
+ dejavu_fonts
+ emojione
+ feh
+ fira
+ fira-code
+ fira-code-symbols
+ fira-mono
+ hasklig
+ inconsolata
+ iosevka
+ noto-fonts
+ noto-fonts-cjk
+ noto-fonts-emoji
+ noto-fonts-extra
+ overpass
+ symbola
+ source-code-pro
+ twemoji-color-font
+ ubuntu_font_family
+ unifont
+ ];
+ };
+
+ # Enable NetkworManager by default
+ networking.networkmanager = {
+ enable = mkDefault true;
+ unmanaged = [
+ "interface-name:br-*"
+ "interface-name:ve-*" # FIXME are those docker's or libvirt's
+ "interface-name:veth-*" # FIXME are those docker's or libvirt's
+ ]
+ # Do not manager wireguard
+ ++ lib.optionals config.networking.wireguard.enable [ "interface-name:wg0" ]
+ # Do not manage docker interfaces
+ ++ lib.optionals config.virtualisation.docker.enable [ "interface-name:docker0" ]
+ # Do not manager libvirt interfaces
+ ++ lib.optionals config.virtualisation.libvirtd.enable [ "interface-name:virbr*" ];
+ };
+
nix = {
# Enable SSH-serving nix packages
sshServe.enable = mkDefault true;
};
- # Make `/run/user/X` larger.
- services.logind.extraConfig = ''
- RuntimeDirectorySize=20%
- '';
+ services = {
+ # Enable avahi with a lot of options
+ avahi = {
+ enable = true;
+ ipv4 = true;
+ ipv6 = true;
+ nssmdns = true;
+ publish = {
+ enable = true;
+ userServices = true;
+ };
+ };
+
+ # Make `/run/user/X` larger.
+ logind.extraConfig = ''
+ RuntimeDirectorySize=20%
+ '';
+
+ # Enable printing by default too
+ printing = {
+ enable = true;
+ drivers = [ pkgs.gutenprint ];
+ };
+
+ # Enable xserver on desktop
+ xserver = {
+ enable = true;
+ enableTCP = false;
+ libinput.enable = true;
+ synaptics.enable = false;
+ layout = "fr";
+ xkbVariant = "bepo";
+ xkbOptions = "grp:menu_toggle,grp_led:caps,compose:caps";
+ };
+
+ };
};
}
diff --git a/systems/modules/profiles/i3.nix b/systems/modules/profiles/i3.nix
@@ -14,18 +14,15 @@ in
config = mkIf cfg.enable {
profiles = {
desktop.enable = true;
- avahi.enable = true;
};
services = {
blueman.enable = true;
autorandr.enable = true;
xserver = {
- enable = true;
displayManager = {
defaultSession = "none+i3";
lightdm.enable = true;
- lightdm.greeters.mini.enable = true;
- lightdm.greeters.mini.user = "vincent";
+ lightdm.greeters.pantheon.enable = true;
};
windowManager.i3.enable = true;
};
diff --git a/users/vincent/home.nix b/users/vincent/home.nix
@@ -1,5 +1,11 @@
-{ pkgs, ... }:
-
+{ lib, nixosConfig, pkgs, ... }:
+let
+ inherit (lib) mkIf;
+in
{
home.packages = with pkgs; [ htop ];
+ xsession.windowManager.i3 = mkIf nixosConfig.profiles.desktop.enable {
+ package = pkgs.i3-gaps;
+ enable = true;
+ };
}