From 9c64fffdc88f29abcfba510efeec38da0b4cc3db Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 17 May 2023 08:43:54 -0400 Subject: [PATCH] Combine system configuration with home-manager This works well since I am not interested in different users on the same machine having different state, and keeps all the relevant configuration for specific programs in one file. --- configuration.nix | 20 -------------------- home-manager/fcitx5/default.nix | 5 +++++ home-manager/neovim/default.nix | 2 ++ home-manager/ranger/default.nix | 4 ++++ home-manager/swaylock/default.nix | 2 ++ home-manager/thunar/default.nix | 5 +++++ home-manager/tig/default.nix | 4 ++++ home-manager/udiskie/default.nix | 2 ++ 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/configuration.nix b/configuration.nix index 4e69eacf..d356ad27 100644 --- a/configuration.nix +++ b/configuration.nix @@ -24,8 +24,6 @@ networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; networking.networkmanager.dns = "none"; networking.useHostResolvConf = true; - services.udisks2.enable = true; - security.pam.services.swaylock = { }; systemd.extraConfig = '' DefaultTimeoutStopSec=10s @@ -63,13 +61,6 @@ services.vnstat.enable = true; services.tumbler.enable = true; security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; users.defaultUserShell = pkgs.fish; environment.shells = with pkgs; [ fish ]; @@ -81,9 +72,7 @@ [ "en_US.UTF-8/UTF-8" "ja_JP.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ]; services.xserver.enable = true; - programs.thunar.enable = true; - programs.neovim.enable = true; programs.firejail.enable = true; nix.package = pkgs.nixFlakes; nix.settings.experimental-features = [ "nix-command" "flakes" ]; @@ -92,14 +81,11 @@ wget grim slurp - librewolf - kitty mullvad-vpn mullvad-browser papirus-icon-theme mediainfo pywal - mpv mpc-cli neofetch tectonic @@ -140,7 +126,6 @@ lnch libnotify dwt1-shell-color-scripts - tig dig trashy swaybg @@ -156,16 +141,11 @@ rustfmt cargo genact - xfce.exo (pkgs.callPackage ./pkgs/srb2.nix {}) ]; - i18n.inputMethod.enabled = "fcitx5"; - i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-mozc ]; - services.mullvad-vpn.enable = true; services.mullvad-vpn.enableExcludeWrapper = false; - networking.networkmanager.wifi.macAddress = "random"; networking.networkmanager.ethernet.macAddress = "random"; services.resolved.llmnr = "false"; diff --git a/home-manager/fcitx5/default.nix b/home-manager/fcitx5/default.nix index 77f1e842..27e1fb3b 100644 --- a/home-manager/fcitx5/default.nix +++ b/home-manager/fcitx5/default.nix @@ -1,4 +1,9 @@ +{ pkgs, ... }: + { + i18n.inputMethod.enabled = "fcitx5"; + i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-mozc ]; + home-manager.sharedModules = [{ xdg.configFile."fcitx5/config".force = true; xdg.configFile."fcitx5/config".text = '' diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index d992c88f..7459ec00 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -1,6 +1,8 @@ { pkgs, ... }: { + programs.neovim.enable = true; + home-manager.sharedModules = [{ programs.neovim = { enable = true; diff --git a/home-manager/ranger/default.nix b/home-manager/ranger/default.nix index f5c9a8a8..d46393d0 100644 --- a/home-manager/ranger/default.nix +++ b/home-manager/ranger/default.nix @@ -1,4 +1,8 @@ +{ pkgs, ... }: + { + environment.systemPackages = [ pkgs.ranger ]; + home-manager.sharedModules = [{ xdg.configFile."ranger/rc.conf".text = '' set line_numbers absolute diff --git a/home-manager/swaylock/default.nix b/home-manager/swaylock/default.nix index 1c431ed3..1f06835e 100644 --- a/home-manager/swaylock/default.nix +++ b/home-manager/swaylock/default.nix @@ -1,6 +1,8 @@ { pkgs, ... }: { + security.pam.services.swaylock = { }; + home-manager.sharedModules = [{ programs.swaylock = { package = pkgs."swaylock-effects"; diff --git a/home-manager/thunar/default.nix b/home-manager/thunar/default.nix index 00161e0d..a7aff9d7 100644 --- a/home-manager/thunar/default.nix +++ b/home-manager/thunar/default.nix @@ -1,4 +1,9 @@ +{ pkgs, ... }: + { + programs.thunar.enable = true; + environment.systemPackages = [ pkgs.xfce.exo ]; + home-manager.sharedModules = [{ xdg.configFile."xfce4/helpers.rc".text = '' TerminalEmulator=kitty diff --git a/home-manager/tig/default.nix b/home-manager/tig/default.nix index cb723874..a3f23ea3 100644 --- a/home-manager/tig/default.nix +++ b/home-manager/tig/default.nix @@ -1,4 +1,8 @@ +{ pkgs, ... }: + { + environment.systemPackages = [ pkgs.tig ]; + home-manager.sharedModules = [{ xdg.configFile."tig/config".text = '' color cursor black green bold diff --git a/home-manager/udiskie/default.nix b/home-manager/udiskie/default.nix index 19840555..dcad4e26 100644 --- a/home-manager/udiskie/default.nix +++ b/home-manager/udiskie/default.nix @@ -1,4 +1,6 @@ { + services.udisks2.enable = true; + home-manager.sharedModules = [{ services.udiskie.enable = true; }];