From 52ef45715fa2501db36980089df5d89a2d473529 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 9 Feb 2022 08:25:51 -0800 Subject: home-manager: simplify the configuration I'm still struggling with documentation, and I'd rather have something simple that works rather than smart and does not work. The configuration for the host imports the modules that are relevant to that host (in the case of carmel, desktop and systems). For the home-manager, I create a profile "desktop" that contains stuff related to a desktop (i3, etc), and it includes the module "common" that contains stuff that I want on any machines (so that in the future, for a machine that is a server, the home manager will only import "common"). --- flake.nix | 5 +---- hosts/carmel/configuration.nix | 3 +++ users/fcuny/common.nix | 20 ++++++++++++++++++++ users/fcuny/desktop.nix | 18 ++++++++++++++++++ users/fcuny/home-manager.nix | 34 ---------------------------------- users/fcuny/i3.nix | 1 - 6 files changed, 42 insertions(+), 39 deletions(-) create mode 100644 users/fcuny/common.nix create mode 100644 users/fcuny/desktop.nix delete mode 100644 users/fcuny/home-manager.nix diff --git a/flake.nix b/flake.nix index 388fb48..750c21a 100644 --- a/flake.nix +++ b/flake.nix @@ -23,13 +23,10 @@ system = "x86_64-linux"; modules = [ ./hosts/carmel/configuration.nix - ./users/fcuny - ./modules/systems - ./modules/desktop home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.fcuny = import ./users/fcuny/home-manager.nix; + home-manager.users.fcuny = import ./users/fcuny/desktop.nix; } ]; }; diff --git a/hosts/carmel/configuration.nix b/hosts/carmel/configuration.nix index 5cbea50..449564b 100644 --- a/hosts/carmel/configuration.nix +++ b/hosts/carmel/configuration.nix @@ -4,6 +4,9 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../users/fcuny + ../../modules/systems + ../../modules/desktop ]; nix = { diff --git a/users/fcuny/common.nix b/users/fcuny/common.nix new file mode 100644 index 0000000..04bc1c1 --- /dev/null +++ b/users/fcuny/common.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs ... } + +{ + home.packages = [ + pkgs.jq + pkgs.ripgrep + ]; + + home.sessionVariables = { + LANG = "en_US.UTF-8"; + LC_CTYPE = "en_US.UTF-8"; + LC_ALL = "en_US.UTF-8"; + EDITOR = "vim"; + }; + + programs.go = { + enable = true; + goPath = "workspace/go"; + }; +} diff --git a/users/fcuny/desktop.nix b/users/fcuny/desktop.nix new file mode 100644 index 0000000..6ded2a0 --- /dev/null +++ b/users/fcuny/desktop.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + xdg.enable = true; + + imports = [ + ./common.nix + ./i3.nix + ]; + + programs.alacritty = { + enable = true; + + settings = { + env.TERM = "xterm-256color"; + }; + }; +} diff --git a/users/fcuny/home-manager.nix b/users/fcuny/home-manager.nix deleted file mode 100644 index 95c1820..0000000 --- a/users/fcuny/home-manager.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - xdg.enable = true; - - imports = [ - ./i3.nix - ]; - - home.packages = [ - pkgs.jq - pkgs.ripgrep - ]; - - home.sessionVariables = { - LANG = "en_US.UTF-8"; - LC_CTYPE = "en_US.UTF-8"; - LC_ALL = "en_US.UTF-8"; - EDITOR = "vim"; - }; - - programs.go = { - enable = true; - goPath = "workspace/go"; - }; - - programs.alacritty = { - enable = true; - - settings = { - env.TERM = "xterm-256color"; - }; - }; -} diff --git a/users/fcuny/i3.nix b/users/fcuny/i3.nix index b09a439..aa97cb8 100644 --- a/users/fcuny/i3.nix +++ b/users/fcuny/i3.nix @@ -14,7 +14,6 @@ extraConfig = { modi = "drun"; show-icons = true; - icon-theme = "Numix-Square"; combi-modi = "window,drun,ssh"; }; }; -- cgit 1.4.1